<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="keywords" content="">
    <meta name="author" content="">
    <meta name="robots" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Fillow : Fillow Saas Admin  Bootstrap 5 Template">
    <meta property="og:title" content="Fillow : Fillow Saas Admin  Bootstrap 5 Template">
    <meta property="og:description" content="Fillow : Fillow Saas Admin  Bootstrap 5 Template">
    <meta name="format-detection" content="telephone=no">

    <!-- PAGE TITLE HERE -->
    <title>Fxpool proxy pool</title>

    <!-- FAVICONS ICON -->
    <link rel="stylesheet" href="static/css/toastr.min.css">
    <link rel="stylesheet" href="static/css/select2.min.css">
    <link href="static/css/nice-select.css" rel="stylesheet">
    <link href="static/css/style4.css" rel="stylesheet">

    <link href="static/css/jquery.dataTables.min.css" rel="stylesheet">
    <link rel="stylesheet" href="static/css/nouislider.min.css">
    <style type="text/css">
        .simple-switch {
            width: 70px;
            height: 32px;
            border: solid 2px #ddd;
            border-radius: 30px;
            background-color: #FFF;
            position: relative;
            padding-left: 28px;
            -webkit-transition: background-color 0.3s;
            transition: background-color 0.3s;
            -webkit-user-select: none;
            font-size: 14px;
        }
        .simple-switch > input[type="checkbox"] {
            display: none;
        }
        .simple-switch:before {
            content: '关';
            text-align: center;
            display: block;
            width: 100%;
            height: 100%;
            line-height: 28px;
            color: #999;
        }
        .simple-switch > .switch-handler {
            position: absolute;
            left: 2px;
            top: 0px;
            width: 28px;
            height: 28px;
            background-color: #FFF;
            border-radius: 50%;
            -webkit-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.52);
            box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.52);
            -webkit-transition: all 0.3s;
            transition: all 0.3s;
        }
        .simple-switch.active {
            border-color: #4cd964;
            background-color: #4cd964;
            padding-left: 0;
            padding-right: 28px;
        }
        .simple-switch.active:before {
            content: '开';
            color: #FFF;
        }
        .simple-switch.active > .switch-handler {
            left: 38px;
        }
    </style>
</head>

<body>

    <!--*******************
        Preloader start
    ********************-->
    <div id="preloader">
        <div class="lds-ripple">
            <div></div>
            <div></div>
        </div>
    </div>
    <!--*******************
        Preloader end
    ********************-->


    <!--**********************************
        Main wrapper start
    ***********************************-->
    <div id="main-wrapper">

        <!--**********************************
            Nav header start
        ***********************************-->
        <div class="nav-header">
            <a href="index" class="brand-logo">
                <svg class="logo-abbr" width="55" height="55" viewbox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path fill-rule="evenodd" clip-rule="evenodd"
                        d="M27.5 0C12.3122 0 0 12.3122 0 27.5C0 42.6878 12.3122 55 27.5 55C42.6878 55 55 42.6878 55 27.5C55 12.3122 42.6878 0 27.5 0ZM28.0092 46H19L19.0001 34.9784L19 27.5803V24.4779C19 14.3752 24.0922 10 35.3733 10V17.5571C29.8894 17.5571 28.0092 19.4663 28.0092 24.4779V27.5803H36V34.9784H28.0092V46Z"
                        fill="url(#paint0_linear)"></path>
                    <defs>
                    </defs>
                </svg>
                <div class="brand-title">
                    <h2 class="">Fxpool.</h2>
                    <span class="brand-sub-title">Saas Fxpool Dashboard</span>
                </div>
            </a>
            <div class="nav-control">
                <div class="hamburger">
                    <span class="line"></span><span class="line"></span><span class="line"></span>
                </div>
            </div>
        </div>
        <!--**********************************
            Nav header end
        ***********************************-->

        <!--**********************************
            Chat box start
        ***********************************-->

        <!--**********************************
            Chat box End
        ***********************************-->

        <!--**********************************
            Header start
        ***********************************-->
        <div class="header">
            <div class="header-content">
                <nav class="navbar navbar-expand">
                    <div class="collapse navbar-collapse justify-content-between">
                        <div class="header-left">
                            <div class="dashboard_bar">
                                端口设置
                            </div>
                        </div>
                        <div class="card-tabs mt-3 mt-sm-0 mb-3 ">
                            <ul class="nav nav-tabs" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link active" data-bs-toggle="tab" id="theme_light" role="tab">明亮</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" data-bs-toggle="tab" id="theme_dark" role="tab">灰暗</a>
                                </li>
                            </ul>
                        </div>
                        <ul class="navbar-nav header-right">
                            <li class="nav-item dropdown notification_dropdown">
                                <div class="dropdown-menu dropdown-menu-end">
                                    <div id="DZ_W_Notification1" class="widget-media dlab-scroll p-3" style="height:380px;">
                                        <ul class="timeline">
                                            <li>
                                                <div class="timeline-panel">
                                                    <div class="media me-2">
                                                        <!-- <img alt="image" width="50" src="static/picture/1.jpg"> -->
                                                    </div>
                                                    <div class="media-body">
                                                        <h6 class="mb-1">Dr sultads Send you Photo</h6>
                                                        <small class="d-block">29 July 2020 - 02:26 PM</small>
                                                    </div>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="timeline-panel">
                                                    <div class="media me-2 media-info">
                                                        KG
                                                    </div>
                                                    <div class="media-body">
                                                        <h6 class="mb-1">Resport created successfully</h6>
                                                        <small class="d-block">29 July 2020 - 02:26 PM</small>
                                                    </div>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="timeline-panel">
                                                    <div class="media me-2 media-success">
                                                        <i class="fa fa-home"></i>
                                                    </div>
                                                    <div class="media-body">
                                                        <h6 class="mb-1">Reminder : Treatment Time!</h6>
                                                        <small class="d-block">29 July 2020 - 02:26 PM</small>
                                                    </div>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="timeline-panel">
                                                    <div class="media me-2">
                                                        <!-- <img alt="image" width="50" src="static/picture/1.jpg"> -->
                                                    </div>
                                                    <div class="media-body">
                                                        <h6 class="mb-1">Dr sultads Send you Photo</h6>
                                                        <small class="d-block">29 July 2020 - 02:26 PM</small>
                                                    </div>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="timeline-panel">
                                                    <div class="media me-2 media-danger">
                                                        KG
                                                    </div>
                                                    <div class="media-body">
                                                        <h6 class="mb-1">Resport created successfully</h6>
                                                        <small class="d-block">29 July 2020 - 02:26 PM</small>
                                                    </div>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="timeline-panel">
                                                    <div class="media me-2 media-primary">
                                                        <i class="fa fa-home"></i>
                                                    </div>
                                                    <div class="media-body">
                                                        <h6 class="mb-1">Reminder : Treatment Time!</h6>
                                                        <small class="d-block">29 July 2020 - 02:26 PM</small>
                                                    </div>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                    <a class="all-notification" href="javascript:void(0);">See all notifications <i class="ti-arrow-end"></i></a>
                                </div>
                            </li>
                            <li class="nav-item dropdown notification_dropdown">
                                <div class="dropdown-menu dropdown-menu-end">
                                    <div id="DZ_W_TimeLine02" class="widget-timeline dlab-scroll style-1 ps ps--active-y p-3 height370">
                                        <ul class="timeline">
                                            <li>
                                                <div class="timeline-badge primary"></div>
                                                <a class="timeline-panel text-muted" href="javascript:void(0);">
                                                    <span>10 minutes ago</span>
                                                    <h6 class="mb-0">Youtube, a video-sharing website, goes live <strong class="text-primary">$500</strong>.</h6>
                                                </a>
                                            </li>
                                            <li>
                                                <div class="timeline-badge info">
                                                </div>
                                                <a class="timeline-panel text-muted" href="javascript:void(0);">
                                                    <span>20 minutes ago</span>
                                                    <h6 class="mb-0">New order placed <strong class="text-info">#XF-2356.</strong></h6>
                                                    <p class="mb-0">Quisque a consequat ante Sit amet magna at volutapt...</p>
                                                </a>
                                            </li>
                                            <li>
                                                <div class="timeline-badge danger">
                                                </div>
                                                <a class="timeline-panel text-muted" href="javascript:void(0);">
                                                    <span>30 minutes ago</span>
                                                    <h6 class="mb-0">john just buy your product <strong class="text-warning">Sell $250</strong></h6>
                                                </a>
                                            </li>
                                            <li>
                                                <div class="timeline-badge success">
                                                </div>
                                                <a class="timeline-panel text-muted" href="javascript:void(0);">
                                                    <span>15 minutes ago</span>
                                                    <h6 class="mb-0">StumbleUpon is acquired by eBay. </h6>
                                                </a>
                                            </li>
                                            <li>
                                                <div class="timeline-badge warning">
                                                </div>
                                                <a class="timeline-panel text-muted" href="javascript:void(0);">
                                                    <span>20 minutes ago</span>
                                                    <h6 class="mb-0">Mashable, a news website and blog, goes live.</h6>
                                                </a>
                                            </li>
                                            <li>
                                                <div class="timeline-badge dark">
                                                </div>
                                                <a class="timeline-panel text-muted" href="javascript:void(0);">
                                                    <span>20 minutes ago</span>
                                                    <h6 class="mb-0">Mashable, a news website and blog, goes live.</h6>
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </li>
                            <li class="nav-item dropdown  header-profile">
								<a class="nav-link" id="setImage" href="javascript:void(0);" role="button" data-bs-toggle="dropdown">
									<img src="static/picture/currency-ETH.png" width="56" alt="">
								</a>
								<div class="dropdown-menu dropdown-menu-end">
									<a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="ETH">
										<img src="static/picture/currency-ETH.png"  alt="">
										<span class="ms-2">ETH</span>
									</a>
									<a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="ETC">
										<img src="static/picture/currency-ETC.png"  alt="">
										<span class="ms-2">ETC</span>
									</a>
									<a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="BTC">
										<img src="static/picture/currency-BTC.png"  alt="">
										<span class="ms-2">BTC</span>
                                    </a>
                                    <a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="LTC">
										<img src="static/picture/currency-LTC.png"  alt="">
										<span class="ms-2">LTC</span>
                                    </a>
                                    <a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="RVN">
										<img src="static/picture/currency-RVN.png"  alt="">
										<span class="ms-2">RVN</span>
                                    </a>
                                    <a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="BEAM">
										<img src="static/picture/currency-BEAM.png"  alt="">
										<span class="ms-2">BEAM</span>
                                    </a>
                                    <a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="ERG">
										<img src="static/picture/currency-ERG.png"  alt="">
										<span class="ms-2">ERG</span>
                                    </a>
                                    <a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="CFX">
										<img src="static/picture/currency-CFX.png"  alt="">
										<span class="ms-2">CFX</span>
                                    </a>
                                    <a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="BTG">
										<img src="static/picture/currency-BTG.png"  alt="">
										<span class="ms-2">BTG</span>
                                    </a>
                                    <!-- <a href="javascript:;" class="dropdown-item ai-icon" onclick="selectCoinTypeFunc(this)" type="TON">
										<img src="static/picture/currency-TON.png"  alt="">
										<span class="ms-2">TON</span>
                                    </a> -->
								</div>
							</li>
                        </ul>
                    </div>
                </nav>
            </div>
        </div>

        <!--**********************************
            Header end ti-comment-alt
        ***********************************-->

        <!--**********************************
            Sidebar start
        ***********************************-->
        <div class="dlabnav">
            <div class="dlabnav-scroll">
                <ul class="metismenu" id="menu">
                    <li>
                        <a class=""  href="index" aria-expanded="false">
                            <i class="fas fa-home"></i>
                            <span class="nav-text">主页</span>
                        </a>
                    </li>
                    <li>
                        <a class="" href="proxyPool" aria-expanded="false">
                            <i class="fas fa-clone"></i>
                            <span class="nav-text">端口</span>
                        </a>
                    </li>
                    <li>
                        <a class="" href="userList" aria-expanded="false">
                            <i class="fas fa-table"></i>
                            <span class="nav-text">矿池</span>
                        </a>
                    </li>
                    <li>
                        <a  class=""  href="confuseSet"aria-expanded="false">
                            <i class="fas fa-info-circle"></i>
                            <span class="nav-text">混淆</span>
                        </a>
                    </li>
                    <li>
                        <a  class=""  href="log"aria-expanded="false">
                            <i class="fas fa-file-alt"></i>
                            <span class="nav-text">日志</span>
                        </a>
                    </li>
                    <li>
                        <a href="setting" class="" aria-expanded="false">
                            <i class="fas fa-user-check"></i>
                            <span class="nav-text">设置</span>
                        </a>
                    </li>
                </ul>
                <div class="side-bar-profile">
                </div>
                <div class="copyright">
                    <p><strong>Admin</strong> © fxpool.org 2022 All Rights Reserved</p>
                </div>
            </div>
        </div>
        <!--**********************************
            Sidebar end
        ***********************************-->

        <!--**********************************
            Content body start
        ***********************************-->
        <div class="content-body">
            <div class="container-fluid">
                <!-- row -->
                <div class="row">
                    <div class="col-xl-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">端口配置</h4>
                                <div>
                                    <button type="button" id="new_proxy_pool_reset_button" class="btn btn-danger light" data-bs-dismiss="modal">重置</button>
                                    <button type="button" id="new_proxy_pool_add_button" class="btn btn-primary">创建</button>
                                    
                                </div>
                            </div>
                            <div class="card-body">
                                <div class="form-validation">
                                    <form class="needs-validation" name="proxySetingBase" novalidate="">
                                        <div class="row">
                                            <div class="col-xl-1">
                                                <div class="mb-3 row">
                                                    <label >前置代理
                                                        <a href="#" class="text-info" title="将你的高防服务器作为前置代理&#10;目标地址填写你后置服务器地址(TCP或SSL)&#10;前置代理连接协议和后置代理连接协议可以&#10;不相同,注意前置服务器连接后置服务器不能&#10;用tcp+aes协议">?</a>
                                                    </label>
                                                    <div class="col-lg-12">
                                                        <div class="form-check">
                                                            <input class="form-check-input" type="checkbox" id="CheckProxyMode">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-xl-2">
                                                <div class="mb-3 row">
                                                    <div class="col-lg-12">
                                                        <input type="text" class="form-control" id="adddiv_proxyname" placeholder="输入一个代理名称" required="">
                                                        <div class="invalid-feedback">
                                                            Please enter a username.
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-xl-2">
                                                <div class="mb-3 row">
                                                    <div class="col-lg-12">
                                                        <select class=" wide form-control" id="adddiv_connect_method">
                                                            <option value="">连接协议</option>
                                                            <option value="stratum+tcp">STRATUM+TCP</option>
                                                            <option value="stratum+ssl">STRATUM+SSL</option>
                                                            <option value="tcp+aes">TCP+AES混淆</option>
                                                        </select>
                                                        <div class="invalid-feedback">
                                                            Please select a one.
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-xl-2">
                                                <div class="mb-3 row">
                                                    <div class="col-lg-12">
                                                        <select class="wide form-control" id="adddiv_targetaddress">
                                                            <option value="">目标矿池</option>
                                                        </select>
                                                        <div class="invalid-feedback">
                                                            Please select a one.
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-xl-2">
                                                <div class="mb-3 row">
                                                    <div class="col-lg-12">
                                                        <input type="text" class="form-control" id="adddiv_listenport" placeholder="监听端口0-65535" required="">
                                                        <div class="invalid-feedback">
                                                            Please enter a username.
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-xl-3">
                                                <div class="mb-3 row">
                                                    <div class="col-lg-12" id="adddiv_feeaccount_div">
                                                        <input type="text" class="form-control" id="adddiv_feeaccount" placeholder="请选择或添加抽水账户" readonly="readonly" required="">
                                                        <div class="invalid-feedback">
                                                            Please enter a username.
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xl-12">
                        <div class="card">
                            <div class="card-header border-0 flex-wrap">
                                <div class="card-header">
                                    <h4 class="card-title">代理列表</h4>
                                </div>
                                <div class="d-flex align-items-center project-tab mb-2">	
                                    <div class="card-tabs mt-3 mt-sm-0 mb-3 ">
                                        <ul class="nav nav-tabs" role="tablist">
                                            <li class="nav-item">
                                                <a class="nav-link" data-bs-toggle="tab" href="javascript:void(0)" onclick="methodSearchFunc(this)" type="stratum+tcp" role="tab">TCP</a>
                                            </li>
                                            <li class="nav-item">
                                                <a class="nav-link" data-bs-toggle="tab" href="javascript:void(0)" onclick="methodSearchFunc(this)" type="stratum+ssl" role="tab">SSL</a>
                                            </li>
                                            <li class="nav-item">
                                                <a class="nav-link" data-bs-toggle="tab" href="javascript:void(0)" onclick="methodSearchFunc(this)" type="tcp+aes" role="tab">AES</a>
                                            </li>
                                        </ul>
                                    </div>
                                    <div class="dropdown ms-2">
                                        <div class="btn-link" data-bs-toggle="dropdown" aria-expanded="false">
                                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <circle cx="12.4999" cy="3.5" r="2.5" fill="#A5A5A5"></circle>
                                                <circle cx="12.4999" cy="11.5" r="2.5" fill="#A5A5A5"></circle>
                                                <circle cx="12.4999" cy="19.5" r="2.5" fill="#A5A5A5"></circle>
                                            </svg>
                                        </div>
                                        <div class="dropdown-menu dropdown-menu-right" style="margin: 0px;">
                                            <a class="dropdown-item config_import" href="javascript:void(0)">导入配置</a>
                                            <a class="dropdown-item" href="download/localcoinconfig.json" target="_blank">导出配置</a>
                                        </div>
                                    </div>
                                </div>	
                            </div>
                            <div class="card-body" id="alreadyAllPoolDiv">
                                <div class="table-responsive">
                                    <table id="table-poollist" class="display" style="min-width: 845px">
                                        <thead>
                                            <tr>
                                                <th>代理名称</th>
                                                <th>端口</th>
                                                <th>目标矿池</th>
                                                <!-- <th>抽水比例</th> -->
                                                <th>前置</th>
                                                <th>抽水</th>
                                                <th>抽水比例</th>
                                                <th>连接方式</th>
                                                <th>总算力</th>
                                                <th>在线</th>
                                                <th>状态</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody id="pool-list">
                                            <!--就是动态添加-->
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <span style="DISPLAY:none">
                <!-- 目标矿池工作设置-->
               <button type="button" id="adddiv_targetpoolworkmanage" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#modaladddiv_targetpoolworkset">Grid Inside Modal</button>
               </span>
                   <!-- Modal -->
               <div class="modal fade" id="modaladddiv_targetpoolworkset">
                   <div class="modal-dialog" role="document">
                       <div class="modal-content">
                           <div class="modal-header">
                               <h5 class="modal-title" id="adddiv_targettitletext"></h5>
                               <button type="button" class="btn-close" data-bs-dismiss="modal">
                               </button>
                           </div>
                           <div class="modal-body">
                               <div class="card">
                                   <div class="card-body">
                                       <div class="form-validation">
                                           <form class="needs-validation" novalidate="">
                                               <div class="row">
                                                   <div class="col-xl-12">
                                                        <div class="mb-3 row">
                                                            <label class="col-lg-4 col-form-label" for="adddiv_localHashRatePercentage">本地上报算力百分比
                                                                <a href="#" class="text-info" title="比如设置98,如果矿机&#10;算力100M那么矿池&#10;显示98M">?</a>
                                                            </label>
                                                            <div class="col-lg-3">
                                                                <input type="text" class="form-control" name="adddiv_localHashRatePercentage" id="adddiv_localHashRatePercentage" placeholder="0-100" required="">
                                                                <div class="invalid-feedback">
                                                                    Please enter a Currency.
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="mb-3 row">
                                                            <label class="col-lg-4 col-form-label" for="adddiv_isFastResponseInput">快速响应
                                                                <a href="#" class="text-info" title="矿机显示的延迟是本机&#10;服务器到矿机的延迟">?</a>
                                                            </label>
                                                            <div class="col-lg-6">
                                                                <div class="form-check">
                                                                    <input class="form-check-input" type="checkbox" id="adddiv_isFastResponseInput" value="false" onclick='this.value=(this.value=="false")?"true":"false"'>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="mb-3 row">
                                                            <label class="col-lg-4 col-form-label" id="adddiv_connecttest">
                                                            </label>
                                                        </div>
                                                   </div>
                                               </div>
                                           </form>
                                       </div>
                                   </div>
                               </div>
                           </div>
                           <div class="modal-footer" id="addproxydiv">
                               <button type="button" class="btn btn-danger light" data-bs-dismiss="modal">取消</button>
                               <button type="button" class="btn btn-primary"  data-bs-dismiss="modal">确定</button>
                           </div>
                       </div>
                   </div>
               </div>

            <span style="DISPLAY:none">
             <!-- 添加新的代理矿池 -->
            <button type="button" id="adddiv_feeaccountmanage" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#modaladddiv_feeaccountmanage">Grid Inside Modal</button>
            </span>
                <!-- Modal -->
            <div class="modal fade" id="modaladddiv_feeaccountmanage">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title">抽水设置</h5>
                            <button type="button" class="btn-close" data-bs-dismiss="modal">
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="card">
                                <div class="card-body">
                                    <div class="form-validation">
                                        <form class="needs-validation" novalidate="">
                                            <div class="row">
                                                <div class="col-xl-12">
                                                    <div class="mb-3 row" >
                                                        <label class="col-lg-4 col-form-label" for="adddiv_fee_algorithm">抽水算法
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <select class="wide form-control" name="adddiv_fee_algorithm" id="adddiv_fee_algorithm">
                                                                <option value="1">全天平均</option>
                                                                <option value="2">多次随机</option>
                                                            </select>
                                                            <div class="invalid-feedback">
                                                                Please select a one.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" >
                                                        <label class="col-lg-4 col-form-label" for="adddiv_selsetFeeAccount">选择抽水账户<span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <select class="wide form-control" name="adddiv_selsetFeeAccount" id="adddiv_selsetFeeAccount" onchange="adddiv_selsetFeeAccountfun(this.options[this.options.selectedIndex])">
                                                                <option value="">请选择</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="adddiv_pool_target_address">矿池地址<span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <input type="text" class="form-control"  name="adddiv_pool_target_address" id="adddiv_pool_target_address" placeholder="矿池ssl地址使用ssl://前缀,tcp不用前缀" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a username.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="adddiv_fee_wallet_address">钱包地址
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-2">
                                                            <select class="wide form-control"  id="adddiv_wallet_select" onchange="adddiv_wallet_selectfun(this.options[this.options.selectedIndex])">
                                                                <option value="">请选择</option>
                                                            </select>
                                                        </div>
                                                        <div class="col-lg-4">
                                                            <input type="text" class="form-control"  name="adddiv_fee_wallet_address" id="adddiv_fee_wallet_address" placeholder="输入你的钱包地址" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a Email.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="adddiv_pool_login_password" >登录密码
                                                            <a href="#" class="text-info" title="如果矿池不需要密码或你不清楚意思，则默认填写x">?</a>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <input type="text" class="form-control" value="x" name="adddiv_pool_login_password" id="adddiv_pool_login_password" placeholder="有些矿池需要密码,不需要则默认x" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a password.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="adddiv_fee_prefix_name">矿机名称
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <input type="text" class="form-control"  name="adddiv_fee_prefix_name" id="adddiv_fee_prefix_name" placeholder="矿池显示的矿机名称" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a password.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="adddiv_fee_proportion">抽水比例
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-3">
                                                            <input type="text" class="form-control"  name="adddiv_fee_proportion" id="adddiv_fee_proportion" value="1" placeholder="比例最大20%." required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a Currency.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="adddiv_filter_miner_fee">过滤矿工
                                                            <a href="#" class="text-info" title="如果你想过滤一些矿工的抽&#10;水或者过滤你自己的钱包，&#10;输入矿池的钱包地址即可，&#10;支持多个地址输入">?</a>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <textarea class="form-control" name="adddiv_filter_miner_fee" id="adddiv_filter_miner_fee" rows="50" placeholder="输入矿工钱包地址回车换行输入多个,注意钱包区分大小写" required=""></textarea>
                                                            <div class="invalid-feedback">
                                                                Please enter a Suggestions.
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer" id="addproxydiv">
                            <button type="button" class="btn btn-danger light" data-bs-dismiss="modal">取消</button>
                            <button type="button" id="addproxydiv_cfm" class="btn btn-primary"  data-bs-dismiss="modal">确定</button>
                        </div>
                    </div>
                </div>
            </div>

            <span style="DISPLAY:none">
            <!-- Button trigger modal -->
            <button type="button" id="proxyPoolAddOrEditButton" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#modalGrid">Grid Inside Modal</button>
            </span>
            <!-- Modal -->
            <div class="modal fade" id="modalGrid">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title" id="proxyTitle">代理矿池设置</h5>
                            <button type="button" class="btn-close" data-bs-dismiss="modal">
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="card">
                                <div class="card-body">
                                    <div class="form-validation">
                                        <form class="needs-validation" name="proxySetingBase" novalidate="">
                                            <div class="row">
                                                <div class="col-xl-12">
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="proxyName">代理开关
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <div id = "switch_proxy_id" class="simple-switch">
                                                                <input type="checkbox">
                                                                <span class="switch-handler"></span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="proxyName">代理名称
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <input type="text" class="form-control" id="proxyName"  placeholder="为代理设置一个名字" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a Currency.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="isPayDiv">
                                                        <label class="col-lg-4 col-form-label" for="is_pay_text">是否抽水<span
                                                                class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-3">
                                                            <select class="wide form-control" name="is_pay" id="is_pay" onchange="isPayFun(this.options[this.options.selectedIndex])">
                                                                <option value="yes">是</option>
                                                                <option value="no">否</option>
                                                            </select>
                                                            <div class="invalid-feedback">
                                                                Please select a one.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="fee_algorithm_div">
                                                        <label class="col-lg-4 col-form-label" for="fee_algorithm">抽水算法
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <select class="wide form-control" name="fee_algorithm" id="fee_algorithm">
                                                                <option value="1">全天平均</option>
                                                                <option value="2">多次随机</option>
                                                            </select>
                                                            <div class="invalid-feedback">
                                                                Please select a one.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="s_l_port">监听端口
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-3">
                                                            <input type="text" class="form-control"  name="s_l_port" id="s_l_port" placeholder="0-65535" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a Currency.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" id="targerPoolLabel">目标矿池
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-3" id="targerPoolSelectDiv">
                                                            <select class="wide form-control" id="targerPoolSelect">
                                                            </select>
                                                            <div class="invalid-feedback">Please select a one.</div>
                                                        </div>
                                                        <label class="col-lg-4 col-form-label" id="dispayTargetPollInfo">
                                                        </label>
                                                    </div>
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" for="connect_method_txt" id="connect_method_txt">连接协议
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <select class="wide form-control" name="connect_method" id="connect_method">
                                                                <option value="">请选择</option>
                                                                <option value="stratum+tcp">STRATUM+TCP</option>
                                                                <option value="stratum+ssl">STRATUM+SSL</option>
                                                                <option value="tcp+aes">TCP+AES混淆</option>
                                                            </select>
                                                            <div class="invalid-feedback">
                                                                Please select a one.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="localHashRatePercentage_div">
                                                        <label class="col-lg-4 col-form-label" for="localHashRatePercentage">本地上报算力百分比
                                                            <a href="#" class="text-info" title="比如设置98,如果矿机&#10;算力100M那么矿池&#10;显示98M">?</a>
                                                        </label>
                                                        <div class="col-lg-3">
                                                            <input type="text" class="form-control" name="localHashRatePercentage" id="localHashRatePercentage" placeholder="0-100" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a Currency.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="isFastResponseInput_div">
                                                        <label class="col-lg-4 col-form-label" for="isFastResponseInput">快速响应
                                                            <a href="#" class="text-info" title="矿机显示的延迟是本机&#10;服务器到矿机的延迟">?</a>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <div class="form-check">
                                                                <input class="form-check-input" type="checkbox" id="isFastResponseInput" value="false" onclick='this.value=(this.value=="false")?"true":"false"'>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <div class="card-header" id="feePool_div">
                                    <h4 class="card-title">抽水账户</h4>
                                </div>
                                <div class="card-body">
                                    <div class="form-validation">
                                        <form class="needs-validation" name="proxySetingAccount" novalidate="">
                                            <div class="row">
                                                <div class="col-xl-12">
                                                    <div class="mb-3 row" id="selsetFeeAccount_div">
                                                        <label class="col-lg-4 col-form-label" for="selsetFeeAccount">选择抽水账户<span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <select class="wide form-control" name="selsetFeeAccount" id="selsetFeeAccount" onchange="selsetFeeAccountfun(this.options[this.options.selectedIndex])">
                                                                <option value="">请选择</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="pool_target_address_div">
                                                        <label class="col-lg-4 col-form-label" for="pool_target_address">矿池地址<span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <input type="text" class="form-control"  name="pool_target_address" id="pool_target_address" placeholder="矿池ssl地址使用ssl://前缀,tcp不用前缀" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a username.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="fee_wallet_address_div">
                                                        <label class="col-lg-4 col-form-label" for="fee_wallet_address">钱包地址
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-2">
                                                            <select class="wide form-control"  id="wallet_select" onchange="wallet_selectfun(this.options[this.options.selectedIndex])">
                                                                <option value="">请选择</option>
                                                            </select>
                                                        </div>
                                                        <div class="col-lg-4">
                                                            <input type="text" class="form-control"  name="fee_wallet_address" id="fee_wallet_address" placeholder="输入你的钱包地址" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a Email.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="pool_login_password_div">
                                                        <label class="col-lg-4 col-form-label" for="pool_login_password" >登录密码
                                                            <a href="#" class="text-info" title="如果矿池不需要密码或你不清楚意思，则默认填写x">?</a>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <input type="text" class="form-control" value="x" name="pool_login_password" id="pool_login_password" placeholder="有些矿池需要密码,不需要则默认x" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a password.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="fee_prefix_name_div">
                                                        <label class="col-lg-4 col-form-label" for="fee_prefix_name">矿机名称
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <input type="text" class="form-control"  name="fee_prefix_name" id="fee_prefix_name" placeholder="矿池显示的矿机名称" required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a password.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="fee_proportion_div">
                                                        <label class="col-lg-4 col-form-label" for="fee_proportion">抽水比例
                                                            <span class="text-danger">*</span>
                                                        </label>
                                                        <div class="col-lg-3">
                                                            <input type="text" class="form-control"  name="fee_proportion" id="fee_proportion" value="1" placeholder="比例最大20%." required="">
                                                            <div class="invalid-feedback">
                                                                Please enter a Currency.
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="mb-3 row" id="filter_miner_fee_div">
                                                        <label class="col-lg-4 col-form-label" for="filter_miner_fee">过滤矿工
                                                            <a href="#" class="text-info" title="如果你想过滤一些矿工的抽&#10;水或者过滤你自己的钱包，&#10;输入矿池的钱包地址即可，&#10;支持多个地址输入">?</a>
                                                        </label>
                                                        <div class="col-lg-6">
                                                            <textarea class="form-control" name="filter_miner_fee" id="filter_miner_fee" rows="50" placeholder="输入矿工钱包地址回车换行输入多个,注意钱包区分大小写" required=""></textarea>
                                                            <div class="invalid-feedback">
                                                                Please enter a Suggestions.
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer" id="saveChangeDiv">
                        </div>
                    </div>
                </div>
            </div>

            <span style="DISPLAY:none">
                <button id="customPoolAddButton" type="button" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#customPoolAdd">Modal with tooltip</button>
            </span>
            <div class="modal fade" id="customPoolAdd">
                <div class="modal-dialog modal-dialog-centered" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="Modal-title">目标矿池管理</h5>
                            <button type="button" class="btn-close" data-bs-dismiss="modal">
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="card">
                                <div class="card-body">
                                    <div class="form-validation">
                                        <form class="needs-validation" name="proxySetingBase" novalidate="">
                                            <div class="row">
                                                <div class="col-xl-12">
                                                    <div class="mb-3 row">
                                                        <div class="col-lg-12">
                                                            <select class="wide form-control" id="targerPoolSelectManage"  onchange="TargetPoolManageFunc(this.options[this.options.selectedIndex])">
                                                                <option value="">请选择</option>
                                                            </select>
                                                        </div>
                                                    </div>  
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" >修改矿池名字
                                                        </label>
                                                        <div class="col-lg-8">
                                                            <input type="text" class="form-control" id="tpNoteDisplay" placeholder="" required="">
                                                        </div>
                                                    </div> 
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" >修改矿池地址
                                                        </label>
                                                        <div class="col-lg-8">
                                                            <input type="text" class="form-control" id="tpAddressDisplay" placeholder="" required="">
                                                        </div>
                                                    </div>   
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label" >添加矿池名字
                                                        </label>
                                                        <div class="col-lg-8">
                                                            <input type="text" class="form-control"  id="tpNoteName" placeholder="添加:输入备注名称" required="">
                                                        </div>
                                                    </div>  
                                                    <div class="mb-3 row">
                                                        <label class="col-lg-4 col-form-label">添加矿池地址
                                                        </label>
                                                        <div class="col-lg-8">
                                                            <input type="text" class="form-control" id="tpAddress" placeholder="添加:输入矿池TCP直连地址或ssl地址(ssl://)" required="">
                                                        </div>
                                                        
                                                    </div>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div> 
                        <div class="modal-footer">
                            <button type="button" id="addTagetPoolButton" class="btn btn-primary">添加</button>
                            <button type="button" id="deltetTagetPoolButton" class="btn btn-danger">删除</button>
                            <button type="button" id="ModfilyTagetPoolButton" class="btn btn-info">修改</button>
                        </div> 
                    </div>
                </div>
            </div>

            <span style="DISPLAY:none">
                <button id="exampleModalpopoverButton" type="button" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#exampleModalpopover">Modal with tooltip</button>
            </span>
            <div class="modal fade" id="exampleModalpopover">
                <div class="modal-dialog modal-dialog-centered" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="Modal-title">证书上传:请将证书[<code>crt</code>或<code>pem</code>]和[<code>key</code>]文件重命名为<code>server文件名</code></h5>
                            <button type="button" id="exampleModalpopoverCloseButton" class="btn-close" data-bs-dismiss="modal">
                            </button>
                        </div>
                        <div class="modal-body">
                            <h5>请选择证书类型</h5>
                            <select class="wide form-control" id="crtFileTypeSelect">
                               <option value="crt">*.crt</option>
                               <option value="pem">*.pem</option>
                           </select>
                       </div>
                        <div class="modal-body">
                            <h5>选择你的证书和私钥文件</h5>
                            <form action="/api/uploadfiles" method="post" enctype="multipart/form-data" target="_blank" id="uploadform">
                                <input type="file" name="f1s">
                                <input type="file" name="f1s">
                                <input class="btn btn-primary" type="button" onclick="uploadfiles();" value="上传">
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            
            <span style="DISPLAY:none">
             <!-- Button trigger modal -->
             <button id="cfButton" type="button" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#cf">Modal centered</button>
            </span>
             <!-- Modal -->
             <div class="modal fade" id="cf">
                 <div class="modal-dialog modal-dialog-centered" role="document">
                     <div class="modal-content">
                         <div class="modal-header">
                             <h5 class="modal-title">操作</h5>
                             <button type="button" class="btn-close" data-bs-dismiss="modal">
                             </button>
                         </div>
                         <div class="modal-body">
                             <p id="cfSaveNewPool"></p>
                         </div>
                         <div class="modal-footer" id="cfButtonSetting">
                         </div>
                     </div>
                 </div>
             </div>
        </div>

        <span style="DISPLAY:none">
            <button id="exampleConfigImportButton" type="button" class="btn btn-primary mb-2" data-bs-toggle="modal" data-bs-target="#exampleConfigImport">Modal with tooltip</button>
        </span>
        <div class="modal fade" id="exampleConfigImport">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-body">
                        <h5>选择配置文件</h5>
                        <form  method="post" enctype="multipart/form-data" id="uploadConfigform">
                            <input type="file" name="f1s">
                            <input class="btn btn-primary" type="button" onclick="uploadConfigfiles();" value="导入">
                        </form>
                    </div>
                </div>
            </div>
        </div>


        <!--**********************************
            Content body end
        ***********************************-->

        <!--**********************************
            Footer start
        ***********************************-->
        <div class="footer">
            <div class="copyright">
                <p>Copyright © Designed &amp; Developed by <a href="http://www.fxpool.org" target="_blank">Fxpool</a> 2021</p>
            </div>
        </div>
        <!--**********************************
            Footer end
        ***********************************-->

        <!--**********************************
           Support ticket button start
        ***********************************-->

        <!--**********************************
           Support ticket button end
        ***********************************-->


    </div>
    <!--**********************************
        Main wrapper end
    ***********************************-->

    <!--**********************************
        Scripts
    ***********************************-->
    <!-- Required vendors -->
    <script src="static/js/global.min.js"></script>
    <script src="static/js/jquery.nice-select.min.js"></script>
    <script src="static/js/custom.min.js"></script>
    <script src="static/js/dlabnav-init.js"></script>
    <script src="static/js/apexchart.js"></script>
    <script src="static/js/demo.js"></script>
    <script src="static/js/select2.full.min.js"></script>
    <script src="static/js/select2-init.js"></script>
    <script src="static/js/toastr-init.js"></script>
    <script src="static/js/toastr.min.js"></script>
    <script src="static/js/jquery.dataTables.min.js"></script>
    <script src="static/js/datatables.init.js"></script>
    <script>
            $.fn.extend({
                simpleSwitch: function(method, value){
                    var that = this;
                    method = method || 'init';
                    function toggle(flag){
                        that.each(function(){
                            var isActive = $(this).hasClass('active');
                            if(flag != undefined && flag == isActive) return;
                            var value = flag == undefined ? !isActive : flag;
                            $(this).toggleClass('active', value);
                            $(this).children('input[type="checkbox"]').prop('checked', value);
                            var event = document.createEvent("CustomEvent");
                            event.initCustomEvent("switch-change", true, true, value);
                            this.dispatchEvent(event);
                    });
                }
            if(method == 'state'){ 
                return this.children('input[type="checkbox"]').prop('checked');
            }
            else if(method == 'toggle') toggle(value);
            else if(method == 'init') // 初始化
            {
                this.each(function()
                {
                    var checked = $(this).children('input[type="checkbox"]').prop('checked');
                    $(this).toggleClass('active', checked)
                    .append('');
                })
            }
            else if(method == 'bindEvent') // 绑定事件
            {
                this.on('click', function()
                {
                    $(this).simpleSwitch('toggle');
                });
            }
            return this;
            }
        });
        $('.simple-switch').simpleSwitch('bindEvent');
    </script>
    <script>
        var IsFrontProxyMode = false;
        var getFrontProxyMode = false;
        function reloadThisPage(){
            location.reload();
        }
        //配置文件导入
        function uploadConfigfiles(){
            var form = document.getElementById('uploadConfigform'), 
                formData = new FormData(form); 
                $.ajax({ 
                url:"api/uploadConfigFile", 
                type:"post", 
                data:formData, 
                processData:false, 
                contentType:false, 
                success:function(res){ 
                   // var data = JSON.parse(res.text);
                    if(res.status =="ok"){
                        toastrAll("代理配置文件上传成功，重启中...","成功","success");
                        setTimeout("reloadThisPage()","2000");
                    }else if(res.status =="err"){
                        toastrAll(res.message,"失败","error");
                    }
                    // $("#f1s").val(""); 
                }, 
                error:function(err){ 
                    toastrAll("网络连接失败,稍后重试","失败","error");
                } 
            }) 
        }
        document.querySelector(".config_import").onclick = function(){
            document.getElementById("exampleConfigImportButton").click();
        }
        // 获取币种
        GetCoinTypeFunc();
        function GetCoinTypeFunc(){
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    if(data.status == "ok"){
                        document.getElementById("setImage").innerHTML ='<img src="static/picture/currency-'+data.data+'.png" width="56" alt="">';
                        //document.getElementById("getCoinTypeH4").innerText = data.data;
                    }
                }
            }
            xhr.open('GET','api/coinTypeGet',true);
            xhr.send();
        }
        // 设置币种
        function selectCoinTypeFunc(obj){
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    if(data.status == "ok"){
                        location.reload();
                    }
                }
            }
            var newData = 'coinType='+obj.type;
            xhr.open('POST','api/coinTypeSet',true);
            xhr.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded");
            xhr.send(newData);
        }
    </script>
    <script>
        var selectReStr = "";
        var isEadtor = false;
        var GobConnectMethod ="ALL";
        var GobCoinType = "{{.CoinTypeSet}}";
        $("#addproxydiv_cfm").on("click", function() {
            document.getElementById("adddiv_feeaccount").value = document.getElementById("adddiv_fee_wallet_address").value;
        });
        $("#adddiv_feeaccount").click( function () {
            document.getElementById('adddiv_feeaccountmanage').click();
        });
        document.getElementById("CheckProxyMode").onclick = function(){
            if(this.checked){
                document.getElementById("adddiv_feeaccount_div").style.display = "none";
                IsFrontProxyMode = true;
            }else{
                IsFrontProxyMode = false;
                document.getElementById("adddiv_feeaccount_div").style.display = "";
            }
        }
        function methodSearchFunc(obj)
        {
           GobConnectMethod = obj.type;
           ProxyPoolInfo();
        }
        //文件上传
        function uploadfiles() { 
            var form = document.getElementById('uploadform'), 
                formData = new FormData(form); 
                var crtfileType = document.getElementById("crtFileTypeSelect").value;
                $.ajax({ 
                url:"api/uploadCertificate?CertFileType="+crtfileType, 
                type:"post", 
                data:formData, 
                processData:false, 
                contentType:false, 
                success:function(res){ 
                   // var data = JSON.parse(res.text);
                    if(res.status =="ok"){
                        toastrAll("证书上传成功,文件名:"+res.fileName,"成功","success");
                        document.getElementById("exampleModalpopoverCloseButton").click();
                        document.getElementById("connect_method_txt").innerHTML = '连接协议 <span class="text-danger">*</span><a style="color:#00BCD4" href="#" onclick="uploadSslFile(this)" type="1">点击更改证书</a>';
                    }else if(res.status =="err"){
                        toastrAll(res.message,"失败","error");
                    }
                    // $("#f1s").val(""); 
                }, 
                error:function(err){ 
                    toastrAll("网络连接失败,稍后重试","失败","error");
                } 
            }) 
        }
        //目标矿池添加管理
        $("#adddiv_targetaddress").change(function(){
            var obj = this.options[this.options.selectedIndex];
            if(obj.text == "管理目标矿池"){
                document.getElementById("targerPoolLabel").innerHTML = '目标矿池 <span class="text-danger">*</span>';
                document.getElementById("dispayTargetPollInfo").innerHTML = "";
                getTargetPoolInfo(GobCoinType);
                document.getElementById("customPoolAddButton").click();
            }else{
                document.getElementById("adddiv_targetpoolworkmanage").click();
                document.getElementById("adddiv_targettitletext").innerText = '['+obj.text+']'+obj.value+' 设置';
                document.getElementById("adddiv_connecttest").innerHTML = '<a style="color:#00BCD4" href="#" onclick="dailConnectTest(this)" title="将会进行TCP端口连接,超时5s.&#10;若返回timeout错误则可能这个&#10;端口连接不成功，目标矿池必须&#10;是直连端口" type='+obj.value+'>点击连接测试</a>'
            }
            $(this).blur();
        }).focus(function(){
            $(this)[0].selectedIndex = 0;
        });
        //目标矿池选择编辑
        $("#targerPoolSelect").change(function(){
            var obj = this.options[this.options.selectedIndex];
            if(obj.text == "管理目标矿池"){
                document.getElementById("targerPoolLabel").innerHTML = '目标矿池 <span class="text-danger">*</span>';
                document.getElementById("dispayTargetPollInfo").innerHTML = "";
                getTargetPoolInfo(GobCoinType);
                document.getElementById("customPoolAddButton").click();
            }else{
                document.getElementById("targerPoolLabel").innerHTML = '目标矿池 <span class="text-danger">*</span><a style="color:#00BCD4" href="#" onclick="dailConnectTest(this)" title="将会进行TCP端口连接,超时5S.&#10;若返回timeout错误则可能这个&#10;端口连接不成功，目标矿池必须&#10;是直连端口" type='+obj.value+'>点击连接测试</a>';//，<a style="color:#EE11EE" href="#">点击修改</a>
                document.getElementById("dispayTargetPollInfo").innerHTML = obj.value;
            }
            $(this).blur();
        }).focus(function(){
            $(this)[0].selectedIndex = 0;
        });
        //连接方式选择添加
        $("#adddiv_connect_method").change(function(){
            var obj = this.options[this.options.selectedIndex];
            if(obj.value =="stratum+ssl")
            {
                var xhr = new XMLHttpRequest();
                xhr.onreadystatechange = function() {
                    if (xhr.readyState == 4 && xhr.status == 400) {
                        window.location.href="/login";
                        return;
                    }
                    if (xhr.readyState == 4 && xhr.status == 200) {
                        var data = xhr.responseText;
                        data = JSON.parse(data);
                        if(data.status == "err")
                        {
                            document.getElementById("exampleModalpopoverButton").click();
                            document.getElementById("connect_method_txt").innerHTML = '连接协议 <span class="text-danger">*</span><a style="color:#BC00D4" href="javascript:void();;" onclick="uploadSslFile(this)" type="1">证书不存在,点击上传</a>';
                        }
                        else if (data.status == "ok")
                        {
                            document.getElementById("connect_method_txt").innerHTML = '连接协议 <span class="text-danger">*</span><a style="color:#00BCD4" href="javascript:void();;" onclick="uploadSslFile(this)" type="1">点击更改证书</a>';
                        }
                    }
                }
                xhr.open('GET', 'api/certificateFileCheck', true)
                xhr.send();
            }
            $(this).blur();
        }).focus(function(){
            $(this)[0].selectedIndex = 0;
        });
        //连接方式选择编辑
        $("#connect_method").change(function(){
            var obj = this.options[this.options.selectedIndex];
            if(obj.value =="stratum+ssl")
            {
                var xhr = new XMLHttpRequest();
                xhr.onreadystatechange = function() {
                    if (xhr.readyState == 4 && xhr.status == 400) {
                        window.location.href="/login";
                        return;
                    }
                    if (xhr.readyState == 4 && xhr.status == 200) {
                        var data = xhr.responseText;
                        data = JSON.parse(data);
                        if(data.status == "err")
                        {
                            document.getElementById("connect_method_txt").innerHTML = '连接协议 <span class="text-danger">*</span><a style="color:#BC00D4" href="javascript:void();;" onclick="uploadSslFile(this)" type="1">证书不存在,点击上传</a>';
                        }
                        else if (data.status == "ok")
                        {
                            document.getElementById("connect_method_txt").innerHTML = '连接协议 <span class="text-danger">*</span><a style="color:#00BCD4" href="javascript:void();;" onclick="uploadSslFile(this)" type="1">点击更改证书</a>';
                        }
                    }
                }
                xhr.open('GET', 'api/certificateFileCheck', true)
                xhr.send();
            }else if(obj.value =="tcp+aes"){
                document.getElementById("connect_method_txt").innerHTML = '连接协议 <span class="text-danger">*</span><a style="color:#00BCD4" >需配合混淆客户端</a>';
            }else{
                document.getElementById("connect_method_txt").innerHTML = '连接协议 <span class="text-danger">*</span>';
            }
            $(this).blur();
        }).focus(function(){
            $(this)[0].selectedIndex = 0;
        });
        //是否抽水
        function isPayFun(obj){
            if(obj.value == "yes"){
                document.getElementById("fee_algorithm_div").style.display="";//显示
                document.getElementById("localHashRatePercentage_div").style.display="";//显示
                document.getElementById("isFastResponseInput_div").style.display="";//显示
                document.getElementById("pool_target_address_div").style.display="";//显示
                document.getElementById("selsetFeeAccount_div").style.display="";//显示
                document.getElementById("fee_wallet_address_div").style.display="";//显示
                document.getElementById("pool_login_password_div").style.display="";//显示
                document.getElementById("fee_prefix_name_div").style.display="";//显示
                document.getElementById("fee_proportion_div").style.display="";//显示
                document.getElementById("filter_miner_fee_div").style.display="";//显示
                document.getElementById("feePool_div").style.display=""; //显示
                document.getElementById("isPayDiv").style.display = "";
            }else{
                document.getElementById("fee_algorithm_div").style.display="none";//隐藏
                // document.getElementById("localHashRatePercentage_div").style.display="none";//隐藏
                // document.getElementById("isFastResponseInput_div").style.display="none";//隐藏
                document.getElementById("pool_target_address_div").style.display="none";//隐藏
                document.getElementById("selsetFeeAccount_div").style.display="none";//隐藏
                document.getElementById("fee_wallet_address_div").style.display="none";//隐藏
                document.getElementById("pool_login_password_div").style.display="none";//隐藏
                document.getElementById("fee_prefix_name_div").style.display="none";//隐藏
                document.getElementById("fee_proportion_div").style.display="none";
                document.getElementById("filter_miner_fee_div").style.display="none";//隐藏
                document.getElementById("feePool_div").style.display="none";//隐藏
            }
        }
        //连接测试
        function dailConnectTest(obj){
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    if(data.status == "ok")
                    {
                        toastrAll("连接成功", "成功", "success");
                    }
                    else if (data.status == "err")
                    {
                        toastrAll(data.info,"连接出错请重试", "error");
                    }
                }
            }
            xhr.open('GET', 'api/targetConnTest?Address='+obj.type, true)
            xhr.send();
            toastrAll(obj.type+"连接中请稍等...", "消息", "info");
        }
        //选择已经添加的钱包地址
        function adddiv_wallet_selectfun(obj){
            document.getElementById("adddiv_fee_wallet_address").value = obj.value;
        }
        //选择已经添加的抽水账户
        function adddiv_selsetFeeAccountfun(obj){
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    if(data.status =="ok"){
                        //抽水账户
                        document.getElementById("adddiv_pool_target_address").value = data.proxy_pool_info.pay[0].pay_pool;//抽水目标地址
                        document.getElementById("adddiv_fee_wallet_address").value = data.proxy_pool_info.pay[0].pay_wallet;//钱包地址
                        document.getElementById("adddiv_pool_login_password").value = data.proxy_pool_info.pay[0].pay_password;//登录密码
                        document.getElementById("adddiv_fee_prefix_name").value = data.proxy_pool_info.pay[0].pay_name;//矿机名称
                        document.getElementById("adddiv_fee_proportion").value = data.proxy_pool_info.pay[0].proportion;//比例
                        document.getElementById("adddiv_filter_miner_fee").value = data.proxy_pool_info.filter_wallet;//过滤
                        var newT = document.getElementById("adddiv_filter_miner_fee").value.split(",");
                        var this_filter_miner_fee = "";
                        for (var p in newT) {
                            this_filter_miner_fee+=newT[p];
                            if (p<(newT.length-1)){
                                this_filter_miner_fee+='\n';
                            }
                        }
                        document.getElementById("adddiv_filter_miner_fee").value = this_filter_miner_fee;
                    }
                }
            }
            targetPollInfoGetHttp.open('GET','api/proxyPoolConfigInfo'+obj.value, true)
            targetPollInfoGetHttp.send();
        }
        //选择已经添加的钱包地址
        function wallet_selectfun(obj){
            document.getElementById("fee_wallet_address").value = obj.value;
        }
        //选择已经添加的抽水账户
        function selsetFeeAccountfun(obj){
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    if(data.status =="ok"){
                        //抽水账户
                        document.getElementById("pool_target_address").value = data.proxy_pool_info.pay[0].pay_pool;//抽水目标地址
                        document.getElementById("fee_wallet_address").value = data.proxy_pool_info.pay[0].pay_wallet;//钱包地址
                        document.getElementById("pool_login_password").value = data.proxy_pool_info.pay[0].pay_password;//登录密码
                        document.getElementById("fee_prefix_name").value = data.proxy_pool_info.pay[0].pay_name;//矿机名称
                        document.getElementById("fee_proportion").value = data.proxy_pool_info.pay[0].proportion;//比例
                        document.getElementById("filter_miner_fee").value = data.proxy_pool_info.filter_wallet;//过滤
                        var newT = document.getElementById("filter_miner_fee").value.split(",");
                        var this_filter_miner_fee = "";
                        for (var p in newT) {
                            this_filter_miner_fee+=newT[p];
                            if (p<(newT.length-1)){
                                this_filter_miner_fee+='\n';
                            }
                        }
                        document.getElementById("filter_miner_fee").value = this_filter_miner_fee;
                    }
                }
            }
            targetPollInfoGetHttp.open('GET','api/proxyPoolConfigInfo'+obj.value, true)
            targetPollInfoGetHttp.send();
        }
        //设置币种选择
        function coinSelect_function(obj){
            getTargetPoolInfoForSetting(obj.type);
        }
        // 复制
        function poolListActionCopy(obj){
            var NewPoolNickName = obj.type;
            //加载列表
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    var restr = '<option value="">请选择</option>';
                    for (var p in data.target_pool_info) {
                        if(data.target_pool_info[p].coin_type == GobCoinType){
                            if (data.target_pool_info[p].address.indexOf("ssl")!=-1){
                                restr += '<option value="' + data.target_pool_info[p].address + '">' + "[ssl]"+data.target_pool_info[p].note +'</option>';
                            }else{
                                restr += '<option value="' + data.target_pool_info[p].address + '">' + "[tcp]"+data.target_pool_info[p].note +'</option>';
                            }
                        }
                    }
                    document.getElementById("targerPoolSelect").innerHTML  = restr;
                    //获取已经配置的信息
                    getproxyConfigInfo(GobCoinType,NewPoolNickName);
                    //获取所有的代理池的信息添加到列表中
                    getproxyConfigInfoAll();
                    // document.getElementById("proxyName").value = "";
                    // document.getElementById("s_l_port").value = "";
                    // 点击按键
                    document.getElementById("proxyPoolAddOrEditButton").click();
                }
            }
            targetPollInfoGetHttp.open('GET','api/targetPoolInfo', true)
            targetPollInfoGetHttp.send();
            isEadtor = true;
            document.getElementById("saveChangeDiv").innerHTML = '<button type="button" id="copy_proxy_pool_close_button" class="btn btn-danger light" data-bs-dismiss="modal">取消</button>\
            <button type="button" id="copy_proxy_pool_save_button" class="btn btn-primary">保存</button>'
            //编辑修改保存
            $("#copy_proxy_pool_save_button").on("click", function() {
                toastrAll("添加中请稍等...", "消息", "info");
                saveProxyInfo(1,"Add",0);
            });
        }
        //已经添加的列表操作编辑
        function poolListActionEditor(obj){
            var newObj = obj.type.split(',');
            var NewPoolNickName = newObj[0];
            //加载列表
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    var restr = '<option value="">请选择</option>';
                    for (var p in data.target_pool_info) {
                        if(data.target_pool_info[p].coin_type == GobCoinType){
                            if (data.target_pool_info[p].address.indexOf("ssl://")!=-1){
                                restr += '<option value="' + data.target_pool_info[p].address + '">' + "[ssl]"+data.target_pool_info[p].note +'</option>';
                            }else{
                                restr += '<option value="' + data.target_pool_info[p].address + '">' + "[tcp]"+data.target_pool_info[p].note +'</option>';
                            }
                        }
                    }
                    document.getElementById("targerPoolSelect").innerHTML  = restr;
                    //获取已经配置的信息
                    getproxyConfigInfo(GobCoinType,NewPoolNickName);
                    //获取所有的代理池的信息添加到列表中
                    getproxyConfigInfoAll();
                    // 点击按键
                    document.getElementById("proxyPoolAddOrEditButton").click();
                }
            }
            targetPollInfoGetHttp.open('GET','api/targetPoolInfo', true)
            targetPollInfoGetHttp.send();
            isEadtor = true;
            document.getElementById("saveChangeDiv").innerHTML = '<button type="button" id="modify_proxy_pool_close_button" class="btn btn-danger light" data-bs-dismiss="modal">取消</button>\
            <button type="button" id="modify_proxy_pool_save_button" class="btn btn-primary">保存</button>'
            //编辑修改保存
            $("#modify_proxy_pool_save_button").on("click", function() {
                toastrAll("修改中请稍等...", "消息", "info");
                saveProxyInfo(1,"Modify",newObj[1]);
            });
        }
        //代理矿池删除
        function poolListActionDel(obj){
            //确定保存
            document.getElementById("cfSaveNewPool").innerText = '删除后当前端口的矿机马上会断线，确定要删除吗?'
            document.getElementById("cfButtonSetting").innerHTML = '<button \
            id="cfButtonClose" type="button" class="btn btn-danger light" data-bs-dismiss="modal">取消</button>\
            <button id="cfDelProxyPoolButton" type="button" class="btn btn-primary">确定</button>';
            document.getElementById("cfButton").click();
             //确定删除代理矿池
            $("#cfDelProxyPoolButton").on("click", function() {
                var xhr = new XMLHttpRequest();
                xhr.onreadystatechange = function() {
                    if (xhr.readyState == 4 && xhr.status == 400) {
                    window.location.href="/login";
                    return;
                }
                    if (xhr.readyState == 4 && xhr.status == 200) {
                        var data = xhr.responseText;
                        data = JSON.parse(data);
                        if(data.status =="ok"){
                            toastrAll("删除成功", "成功", "success");
                            document.getElementById("cfButtonClose").click();
                            if(isEadtor == true){
                                //document.getElementById("proxypooldivhiddenctl").innerHTML = '<div></div>';
                            }
                            ProxyPoolInfo();
                        }else{
                            toastrAll(data.info, "错误", "error");
                        }
                    }
                }
                xhr.open('DELETE', 'api/proxyInfoDelete?Port='+obj.type, true)
                xhr.send();
            });
        }
        //上传ssl证书
        function uploadSslFile(obj){
            document.getElementById("modify_proxy_pool_close_button").click();
            document.getElementById("exampleModalpopoverButton").click();
        }
        //目标矿池信息选择
        function TargetPoolManageFunc(obj)
        {
            document.getElementById("tpNoteDisplay").value = obj.text;
            document.getElementById("tpAddressDisplay").value = obj.value;
        }
        //修改目标矿池信息按键
        $("#ModfilyTagetPoolButton").on("click", function() {
            //开始发送数据到服务器
            var NewNoteName = document.getElementById("tpNoteDisplay").value;
            var NewAddress = document.getElementById("tpAddressDisplay").value;
            var targerPoolSelect = document.getElementById("targerPoolSelectManage");
            var obj = targerPoolSelect.options[targerPoolSelect.options.selectedIndex];
            var OldNote = obj.text;
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    if(data.status =="ok"){
                        toastrAll("修改成功", "成功", "success");
                        getTargetPoolInfo(GobCoinType);
                        updateTargetPoolInfo(GobCoinType);
                        document.getElementById("tpAddressDisplay").value = "";
                        document.getElementById("tpNoteDisplay").value = "";
                        TargetPoolInfo();
                    }else{
                        toastrAll(data.info, "错误", "error");
                    }
                }
            }
            var new_data = 'Note=' + OldNote + '&NewAddress=' + NewAddress +'&NewNote='+NewNoteName+'&CoinType='+GobCoinType;
            xhr.open('POST', 'api/targetPoolInfoModify', true);
            xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            xhr.send(new_data);
        });
        //删除目标矿池信息按键
        $("#deltetTagetPoolButton").on("click", function() {
            //开始发送数据到服务器
            var targerPoolSelect = document.getElementById("targerPoolSelectManage");
            var obj = targerPoolSelect.options[targerPoolSelect.options.selectedIndex];
            var thisNote = obj.text;
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    if(data.status =="ok"){
                        toastrAll("删除成功", "成功", "success");
                        getTargetPoolInfo(GobCoinType);
                        updateTargetPoolInfo(GobCoinType);
                        TargetPoolInfo();
                    }else{
                        toastrAll(data.info, "错误", "error");
                    }
                }
            }
            xhr.open('DELETE', 'api/targetPoolInfoDelete?Note='+thisNote+'&CoinType='+GobCoinType, true);
            xhr.send();
        });
        //添加目标矿池消息按键
        $("#addTagetPoolButton").on("click", function() {
            var thisAddress = document.getElementById("tpAddress").value;
            var thisNote = document.getElementById("tpNoteName").value;
            var new_data = 'Address=' + thisAddress + '&Note=' + thisNote +'&CoinType='+GobCoinType;
            //开始提交到服务器
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    if(data.status =="ok"){
                        toastrAll("添加成功", "成功", "success");
                        document.getElementById("tpNoteName").value = "";
                        document.getElementById("tpAddress").value = "";
                        getTargetPoolInfo(GobCoinType);
                        updateTargetPoolInfo(GobCoinType);
                        TargetPoolInfo();
                    }else{
                        toastrAll(data.info, "错误", "error");
                    }
                }
            }
            xhr.open('POST', 'api/targetPoolInfoAdd', true);
            xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            xhr.send(new_data);
        });        
        //添加新的代理触发按键 
        $("#new_proxy_pool_add_button").on("click", function() {
            toastrAll("添加中请稍等...", "消息", "info");
            saveProxyInfo(0,"Add",0);
        });
        $("#new_proxy_pool_reset_button").on("click", function() {
            ResetParAddNewPool();
        });
        function ResetParAddNewPool(){
            document.getElementById("adddiv_fee_algorithm").selected = true;//算法  
            document.getElementById("adddiv_listenport").value="";//端口 
            document.getElementById("adddiv_targetaddress").value="";//矿机目标地址
            document.getElementById("adddiv_proxyname").value="";//代理池名称
            document.getElementById("adddiv_connect_method")[0].selected = true//连接方式
            document.getElementById("adddiv_targetaddress")[0].selected =true;
            document.getElementById("adddiv_localHashRatePercentage").value=100;//本地算力百分比
            document.getElementById("adddiv_isFastResponseInput").value="false";//快速响应
            //抽水账户
            document.getElementById("adddiv_feeaccount").value = "";
            document.getElementById("adddiv_selsetFeeAccount")[0].selected = true;
            document.getElementById("adddiv_pool_target_address").value = "";//抽水目标地址
            document.getElementById("adddiv_wallet_select")[0].selected = true;
            document.getElementById("adddiv_fee_wallet_address").value = "";//钱包地址
            document.getElementById("adddiv_pool_login_password").value = "x";//登录密码
            document.getElementById("adddiv_fee_prefix_name").value = "";//矿机名称
            document.getElementById("adddiv_fee_proportion").value = 1;//比例
            document.getElementById("adddiv_filter_miner_fee").value = "";//过滤
        }
        //保存代理数据
        function saveProxyInfo(whereValue,opType,ListenPort){
            //确定保存添加
            var this_is_pay;
            var this_fee_algorithm;
            var this_s_l_port;
            var this_targerPoolSelect;
            var this_targerPoolSelectNickName;
            var this_connect_method;
            var this_localHashRatePercentage;
            var this_isFastResponseInput;
            //抽水账户
            var this_pool_target_address="";
            var this_fee_wallet_address="";
            var this_pool_login_password="";
            var this_fee_prefix_name="";
            var this_fee_proportion=1;
            var this_IsFrontProxyMode = false;
            var this_is_open = true;
            if(whereValue ==0){
                this_IsFrontProxyMode = IsFrontProxyMode;
                //确定保存添加
                this_fee_algorithm = document.getElementById("adddiv_fee_algorithm").value ;//算法  
                this_s_l_port = document.getElementById("adddiv_listenport").value;//端口 
                this_targerPoolSelect = document.getElementById("adddiv_targetaddress").value;//矿机目标地址
                this_targerPoolSelectNickName = document.getElementById("adddiv_proxyname").value;//代理池名称
                this_connect_method = document.getElementById("adddiv_connect_method").value;//连接方式
                this_localHashRatePercentage = document.getElementById("adddiv_localHashRatePercentage").value;//本地算力百分比
                this_isFastResponseInput = document.getElementById("adddiv_isFastResponseInput").value;//快速响应
                //抽水账户
                this_pool_target_address = document.getElementById("adddiv_pool_target_address").value;//抽水目标地址
                this_fee_wallet_address = document.getElementById("adddiv_fee_wallet_address").value;//钱包地址
                this_pool_login_password = document.getElementById("adddiv_pool_login_password").value;//登录密码
                this_fee_prefix_name = document.getElementById("adddiv_fee_prefix_name").value;//矿机名称
                this_fee_proportion = document.getElementById("adddiv_fee_proportion").value;//比例
                var this_filter_miner_fee_tmp = document.getElementById("adddiv_filter_miner_fee").value;//过滤
                var newT = this_filter_miner_fee_tmp.split('\n');
                var this_filter_miner_fee = "";
                for (var p in newT) {
                    this_filter_miner_fee+='"'+newT[p]+'"'
                    if (p<(newT.length-1)){
                        this_filter_miner_fee+=',';
                    }
                }
                if(this_fee_wallet_address==""||this_fee_algorithm==""||this_pool_target_address==""||this_fee_prefix_name==""||this_fee_proportion==""){
                    this_is_pay = "no";
                }else{
                    this_is_pay = "yes";
                }
            }else if(whereValue ==1){
                this_IsFrontProxyMode = getFrontProxyMode;
                //确定保存添加
                this_is_pay = document.getElementById("is_pay").value;//抽水
                this_fee_algorithm = document.getElementById("fee_algorithm").value ;//算法  
                this_s_l_port = document.getElementById("s_l_port").value;//端口 
                this_targerPoolSelect = document.getElementById("targerPoolSelect").value;//矿机目标地址
                this_targerPoolSelectNickName = document.getElementById("proxyName").value;//代理池名称
                this_connect_method = document.getElementById("connect_method").value;//连接方式
                this_localHashRatePercentage = document.getElementById("localHashRatePercentage").value;//本地算力百分比
                this_isFastResponseInput = document.getElementById("isFastResponseInput").value;//本地延迟篡改
                //抽水账户
                this_pool_target_address = document.getElementById("pool_target_address").value;//抽水目标地址
                this_fee_wallet_address = document.getElementById("fee_wallet_address").value;//钱包地址
                this_pool_login_password = document.getElementById("pool_login_password").value;//登录密码
                this_fee_prefix_name = document.getElementById("fee_prefix_name").value;//矿机名称
                this_fee_proportion = document.getElementById("fee_proportion").value;//比例
                var this_filter_miner_fee_tmp = document.getElementById("filter_miner_fee").value;//过滤
                var newT = this_filter_miner_fee_tmp.split('\n');
                var this_filter_miner_fee = "";
                for (var p in newT) {
                    this_filter_miner_fee+='"'+newT[p]+'"'
                    if (p<(newT.length-1)){
                        this_filter_miner_fee+=',';
                    }
                }
            }
            //判断抽水相关的参数
            if(this_is_pay == "yes"){
                if(this_fee_wallet_address==""||this_fee_algorithm==""||this_pool_target_address==""||this_fee_prefix_name==""||this_fee_proportion==""){
                    toastrAll("不能为空,请检查抽水参数", "错误", "error");
                    return;
                }
            }
            if(this_s_l_port =="" ||this_targerPoolSelectNickName==""||this_targerPoolSelect==""||this_connect_method==""){
                toastrAll("不能为空,请检查基础参数", "错误", "error");
                return;
            }
            if(this_s_l_port <0 || this_s_l_port>65535){
                toastrAll("端口的范围0-65535", "错误", "error");
                return;
            }
            if(this_localHashRatePercentage ==""){
                this_localHashRatePercentage = 100.0;
            }
            if(this_localHashRatePercentage >100.0 || this_localHashRatePercentage<0){
                this_localHashRatePercentage =0;
                alert("本地算力百分比,不能超过100或小于0");
            }
            if(this_localHashRatePercentage >100){
                toastrAll("本地算力百分比范围在必须0-100之间", "错误", "error");
                retirn;
            }
            //保存后提交到服务器
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 400) {
                    var data = JSON.parse(xhr.responseText);
                    if (data.status == "err"){
                        toastrAll(data.info, "错误", "error");
                        return;
                    }
                    window.location.href="/login";
                    return;
                }
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    if(data.status =="ok"){
                        toastrAll(data.info, "成功", "success");
                        ProxyPoolInfo();
                        if(opType =="Modify"&& whereValue==1){
                            document.getElementById("modify_proxy_pool_close_button").click();
                        }else if(opType == "Add" && whereValue==1){
                            document.getElementById("copy_proxy_pool_close_button").click();
                        }
                        if(whereValue ==0 &&opType == "Add"){
                            ResetParAddNewPool();
                        }
                    }else{
                        toastrAll(data.info, "错误", "error");
                    }
                }
            }
            if (this_is_pay=="yes"){
                this_is_pay = true;
            }else{
                this_is_pay = false;
            }
            if(opType =="Add"){
                xhr.open('POST', 'api/proxyInfoAdd', true);
            }else if(opType =="Modify"){
                console.log("编辑")
                this_is_open = $('#switch_proxy_id').simpleSwitch('state');
                xhr.open('POST', 'api/proxyInfoModify/'+ListenPort, true);
            }
            var new_data = '{\
                "coin_type": "'+GobCoinType+'",\
                "is_open":'+this_is_open+',\
                "is_pay": '+this_is_pay+',\
                "fee_algorithm": '+this_fee_algorithm+',\
                "transit": {\
                    "listen_port": '+this_s_l_port+',\
                    "target_address": "'+this_targerPoolSelect+'",\
                    "nick_name": "'+this_targerPoolSelectNickName+'"\
                },\
                "connect_method": "'+this_connect_method+'",\
                "local_hash_rate_percentage": '+this_localHashRatePercentage+',\
                "is_fast_response": '+this_isFastResponseInput+',\
                "is_front_proxy":'+this_IsFrontProxyMode+',\
                "pay":[\
                    {\
                        "pay_pool": "'+this_pool_target_address+'",\
                        "pay_wallet": "'+this_fee_wallet_address+'",\
                        "pay_password": "'+this_pool_login_password+'",\
                        "pay_name": "'+this_fee_prefix_name+'",\
                        "proportion": '+this_fee_proportion+'\
                    }\
                ],\
                "filter_wallet": ['+this_filter_miner_fee+']\
            }';
            console.log(new_data)
            xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            xhr.send(new_data);
        }
        //获取目标矿池列表信息
        function getTargetPoolInfo(thiscoinType){
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {//style="visibility: hidden;"
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    var restr = '';
                    for (var p in data.target_pool_info) {
                        if (data.target_pool_info[p].coin_type == thiscoinType){
                            restr += '<option value="' + data.target_pool_info[p].address + '">' + data.target_pool_info[p].note +'</option>';
                        }
                    }
                    document.getElementById("targerPoolSelectManage").innerHTML = '<option value="">请选择</option>'+restr;//已经添加的目标矿池
                }
            }
            targetPollInfoGetHttp.open('GET','api/targetPoolInfo', true)
            targetPollInfoGetHttp.send();
        }
        // 更新目标矿池信息
        function updateTargetPoolInfo(thiscoinType){
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    var restr = "";
                    for (var p in data.target_pool_info) {
                        if(data.target_pool_info[p].coin_type == thiscoinType){
                            restr += '<option value="' + data.target_pool_info[p].address + '">' + data.target_pool_info[p].note +'</option>';
                        }
                    }
                    restr+=' <option value="">请选择</option>';
                    document.getElementById("targerPoolSelect").innerHTML  = restr;
                }
            }
            targetPollInfoGetHttp.open('GET','api/targetPoolInfo', true)
            targetPollInfoGetHttp.send();
        }
        //获取目标矿池信息
        function getTargetPoolInfoForSetting(thiscoinType){
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.onreadystatechange = function(){
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    var restr = "";
                    for (var p in data.target_pool_info) {
                        if(data.target_pool_info[p].coin_type == thiscoinType){
                            restr += '<option value="' + data.target_pool_info[p].address + '">' + data.target_pool_info[p].note +'</option>';
                        }
                    }
                    restr+='<option style="color:#00BCD4" value="add">管理'+thiscoinType+'目标矿池</option>-->';
                    selectReStr = '<select class="default-select wide form-control" id="targerPoolSelect">'+
                    restr+' </select>' +'<div class="invalid-feedback">Please select a one.</div>';
                    document.getElementById("targerPoolSelectDiv").innerHTML  = selectReStr;
                }
            }
            targetPollInfoGetHttp.open('GET','api/targetPoolInfo', true)
            targetPollInfoGetHttp.send();
        }
        // 显示隐藏
        function IsDispayFeeInfo(IsDispay){
            var is_pay_select = document.getElementById("is_pay");//抽水
            document.getElementById("isPayDiv").style.display = "";
            if(IsDispay == true){
                is_pay_select[0].selected = true;
                document.getElementById("fee_algorithm_div").style.display="";//显示
                document.getElementById("localHashRatePercentage_div").style.display="";//显示
                document.getElementById("isFastResponseInput_div").style.display="";//显示
                document.getElementById("pool_target_address_div").style.display="";//显示
                document.getElementById("selsetFeeAccount_div").style.display="";//显示
                document.getElementById("fee_wallet_address_div").style.display="";//显示
                document.getElementById("pool_login_password_div").style.display="";//显示
                document.getElementById("fee_prefix_name_div").style.display="";//显示
                document.getElementById("fee_proportion_div").style.display="";//显示
                document.getElementById("filter_miner_fee_div").style.display="";//显示
                document.getElementById("feePool_div").style.display=""; //显示
            }else if(IsDispay == false){
                is_pay_select[1].selected = true;
                //隐藏抽水相关的操作
                document.getElementById("fee_algorithm_div").style.display="none";//隐藏
                // document.getElementById("localHashRatePercentage_div").style.display="none";//隐藏
                // document.getElementById("isFastResponseInput_div").style.display="none";//隐藏
                document.getElementById("pool_target_address_div").style.display="none";//隐藏
                document.getElementById("selsetFeeAccount_div").style.display="none";//隐藏
                document.getElementById("fee_wallet_address_div").style.display="none";//隐藏
                document.getElementById("pool_login_password_div").style.display="none";//隐藏
                document.getElementById("fee_prefix_name_div").style.display="none";//隐藏
                document.getElementById("fee_proportion_div").style.display="none";
                document.getElementById("filter_miner_fee_div").style.display="none";//隐藏
                document.getElementById("feePool_div").style.display="none";//隐藏
            }
        }
        //获取代理池的信息
        function getproxyConfigInfo(thiscoinType,NewPoolNickName){
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.open('GET','api/proxyPoolConfigInfo?CoinType='+thiscoinType+'&NickName='+NewPoolNickName, true);
            targetPollInfoGetHttp.send();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                        window.location.href="/login";
                        return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    if (data.status == "ok"){
                        document.getElementById("proxyTitle").innerHTML = "代理矿池设置";
                        getFrontProxyMode = data.proxy_pool_info.is_front_proxy;
                        // 判断是否是前置代理
                        if (data.proxy_pool_info.is_front_proxy == true){
                            document.getElementById("proxyTitle").innerHTML = "前置代理设置";
                            document.getElementById("fee_algorithm_div").style.display="none";//隐藏
                            document.getElementById("localHashRatePercentage_div").style.display="none";//隐藏
                            document.getElementById("isFastResponseInput_div").style.display="none";//隐藏
                            document.getElementById("pool_target_address_div").style.display="none";//隐藏
                            document.getElementById("selsetFeeAccount_div").style.display="none";//隐藏
                            document.getElementById("fee_wallet_address_div").style.display="none";//隐藏
                            document.getElementById("pool_login_password_div").style.display="none";//隐藏
                            document.getElementById("fee_prefix_name_div").style.display="none";//隐藏
                            document.getElementById("fee_proportion_div").style.display="none";
                            document.getElementById("filter_miner_fee_div").style.display="none";//隐藏
                            document.getElementById("feePool_div").style.display="none";//隐藏
                            document.getElementById("isPayDiv").style.display = "none";//隐藏
                        }else{
                            if(data.proxy_pool_info.is_pay == true){
                                IsDispayFeeInfo(true);
                            }else{
                                IsDispayFeeInfo(false);
                            }
                        }
                        // 判断端口的开启状态
                        if (data.proxy_pool_info.is_open == true){
                            $('#switch_proxy_id').simpleSwitch('toggle', true);
                        }else{
                            $('#switch_proxy_id').simpleSwitch('toggle', false);
                        }
                        var is_algorithm_select =  document.getElementById("fee_algorithm");//算法
                        if(data.proxy_pool_info.fee_algorithm == 1){
                            is_algorithm_select[0].selected = true;
                        }else if(data.proxy_pool_info.fee_algorithm == 2){
                            is_algorithm_select[1].selected = true;
                        }
                        document.getElementById("s_l_port").value = data.proxy_pool_info.transit.listen_port;//端口 
                        document.getElementById("targerPoolSelect").value = data.proxy_pool_info.transit.target_address;//矿机目标地址
                        document.getElementById("dispayTargetPollInfo").innerHTML = data.proxy_pool_info.transit.target_address;//矿机目标地址显示
                        //显示连接参数测试
                        document.getElementById("targerPoolLabel").innerHTML = '目标矿池 <span class="text-danger">*</span><a style="color:#00BCD4" href="#" onclick="dailConnectTest(this)" title="将会进行TCP端口连接,超时5s.&#10;若返回timeout错误则可能这个&#10;端口连接不成功，目标矿池必须&#10;是直连端口" type='+data.proxy_pool_info.transit.target_address+'>点击连接测试</a>';//，<a style="color:#EE11EE" href="#">点击修改</a>
                        document.getElementById("proxyName").value = data.proxy_pool_info.transit.nick_name; //代理池名称
                        document.getElementById("connect_method").value = data.proxy_pool_info.connect_method;//连接方式
                        document.getElementById("localHashRatePercentage").value = data.proxy_pool_info.local_hash_rate_percentage;//本地算力百分比
                        document.getElementById("isFastResponseInput").checked = data.proxy_pool_info.is_fast_response;//开始响应
                        document.getElementById("isFastResponseInput").value = data.proxy_pool_info.is_fast_response;//开始响应值
                        //抽水账户
                        document.getElementById("pool_target_address").value = data.proxy_pool_info.pay[0].pay_pool;//抽水目标地址
                        document.getElementById("fee_wallet_address").value = data.proxy_pool_info.pay[0].pay_wallet;//钱包地址
                        document.getElementById("pool_login_password").value = data.proxy_pool_info.pay[0].pay_password;//登录密码
                        document.getElementById("fee_prefix_name").value = data.proxy_pool_info.pay[0].pay_name;//矿机名称
                        document.getElementById("fee_proportion").value = data.proxy_pool_info.pay[0].proportion;//比例
                        document.getElementById("filter_miner_fee").value = data.proxy_pool_info.filter_wallet;//过滤
                        var newT = document.getElementById("filter_miner_fee").value.split(",");
                        var this_filter_miner_fee = "";
                        for (var p in newT) {
                            this_filter_miner_fee+=newT[p];
                            if (p<(newT.length-1)){
                                this_filter_miner_fee+='\n';
                            }
                        }
                        document.getElementById("filter_miner_fee").value = this_filter_miner_fee;
                    }
                }
            }
        }
        //获取所有的代理池的信息
        function getproxyConfigInfoAll(){
            var targetPollInfoGetHttp = new XMLHttpRequest();
            targetPollInfoGetHttp.open('GET','api/proxyPoolConfigInfoAll/'+GobCoinType, true);
            targetPollInfoGetHttp.send();
            targetPollInfoGetHttp.onreadystatechange = function() {
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (targetPollInfoGetHttp.readyState == 4 && targetPollInfoGetHttp.status == 200) {
                    var data = targetPollInfoGetHttp.responseText;
                    data = JSON.parse(data);
                    var feeAccount="";
                    var WalletInfo = '<option value="选择一个已添加的钱包">钱包</option>';
                    if (data.status == "ok"){
                        for (var p in data.proxy_pool_info) {
                            if(data.proxy_pool_info[p].is_pay ==true && data.proxy_pool_info[p].coin_type == GobCoinType){
                                WalletInfo+='<option value="' + data.proxy_pool_info[p].pay[0].pay_wallet + '">' + data.proxy_pool_info[p].transit.nick_name+'的钱包地址' +'</option>';;
                                feeAccount +='<option value="' +'?CoinType='+data.proxy_pool_info[p].coin_type+'&NickName='+data.proxy_pool_info[p].transit.nick_name  + '">' + data.proxy_pool_info[p].transit.nick_name +"的抽水账户信息"+'</option>';
                            }
                        }
                    }
                    document.getElementById("selsetFeeAccount").innerHTML = '<option value="">请选择</option>'+feeAccount;
                    document.getElementById("wallet_select").innerHTML = WalletInfo;
                    document.getElementById("adddiv_selsetFeeAccount").innerHTML = '<option value="">请选择</option>'+feeAccount;
                    document.getElementById("adddiv_wallet_select").innerHTML = WalletInfo;
                }
            }
        }
        //操作结果显示
        function toastrAll(this_infostr, this_titlemsg, type) {
            if (type == "info") {
                toastr.info(this_infostr, this_titlemsg, {
                    positionClass: "toast-top-center",
                    timeOut: 5e3,
                    closeButton: !0,
                    debug: !1,
                    newestOnTop: !0,
                    progressBar: !0,
                    preventDuplicates: !0,
                    onclick: null,
                    showDuration: "300",
                    hideDuration: "1000",
                    extendedTimeOut: "1000",
                    showEasing: "swing",
                    hideEasing: "linear",
                    showMethod: "fadeIn",
                    hideMethod: "fadeOut",
                    tapToDismiss: !1
                });
            } else if (type == "success") {
                toastr.success(this_infostr, this_titlemsg, {
                    positionClass: "toast-top-center",
                    timeOut: 5e3,
                    closeButton: !0,
                    debug: !1,
                    newestOnTop: !0,
                    progressBar: !0,
                    preventDuplicates: !0,
                    onclick: null,
                    showDuration: "300",
                    hideDuration: "1000",
                    extendedTimeOut: "1000",
                    showEasing: "swing",
                    hideEasing: "linear",
                    showMethod: "fadeIn",
                    hideMethod: "fadeOut",
                    tapToDismiss: !1
                });
            } else if (type == "error") {
                toastr.error(this_infostr, this_titlemsg, {
                    positionClass: "toast-top-center",
                    timeOut: 5e3,
                    closeButton: !0,
                    debug: !1,
                    newestOnTop: !0,
                    progressBar: !0,
                    preventDuplicates: !0,
                    onclick: null,
                    showDuration: "300",
                    hideDuration: "1000",
                    extendedTimeOut: "1000",
                    showEasing: "swing",
                    hideEasing: "linear",
                    showMethod: "fadeIn",
                    hideMethod: "fadeOut",
                    tapToDismiss: !1
                });
            }
        }
        //目标矿池信息获取
        var TargetPoolInfo = function(){
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 400) {
                    window.location.href="/login";
                        return;
                }
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    var restr = "";
                    for (var p in data.target_pool_info) {
                        if(data.target_pool_info[p].coin_type == GobCoinType){
                            if (data.target_pool_info[p].address.indexOf("ssl://")!=-1){
                                restr += '<option value="' + data.target_pool_info[p].address + '">' + "[ssl]"+data.target_pool_info[p].note +'</option>';
                            }else{
                                restr += '<option value="' + data.target_pool_info[p].address + '">' + "[tcp]"+data.target_pool_info[p].note +'</option>';
                            }
                        }
                    }
                    restr+='<option style="color:#00BCD4" value="add">管理目标矿池</option>-->';
                    document.getElementById("adddiv_targetaddress").innerHTML = '<option  value="">目标矿池</option>'+restr;
                }
            }
            xhr.open('GET','api/targetPoolInfo', true)
            xhr.send();
        }
        function CalHash(v){
            var tmptmp = v.toFixed(2)+"Sol";
            // sol m g t p e
            if( v>1000){
                tmptmp = (v/(1000)).toFixed(2)+"KH";
            }
            if( v>1000*1000){
                tmptmp = (v/(1000*1000)).toFixed(2)+"MH";
            }
            if( v>1000*1000*1000){
                tmptmp = (v/(1000*1000*1000)).toFixed(2)+"GH";
            }
            if( v>1000*1000*1000*1000){
                tmptmp = (v/(1000*1000*1000*1000)).toFixed(2)+"TH";
            }
            if( v>1000*1000*1000*1000*1000){
                tmptmp = (v/(1000*1000*1000*1000*1000)).toFixed(2)+"PH";
            }
            if( v>1000*1000*1000*1000*1000*1000){
                tmptmp = (v/(1000*1000*1000*1000*1000*1000)).toFixed(2)+"PH";
            }
           return tmptmp;
        }
        //代理矿池信息获取
        var ProxyPoolInfo = function() {
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    var divelementstr = "";
                    for (var p in data.pool_infos) {
                        if (data.pool_infos[p].coin_type==GobCoinType){
                            var this_hashrate = CalHash(data.pool_infos[p].hash_rate);
                            var isFrontProxy="否";
                            var isFee="否";
                            var isOpen = '<span class="badge badge-danger">未启动</span>';
                            if (data.pool_infos[p].is_front_proxy == true){
                                isFrontProxy = "是";
                            }
                            if(data.pool_infos[p].is_open == true){
                                isOpen =  '<span class="badge light badge-success">运行中</span>';
                            }
                            if(data.pool_infos[p].is_pay == true)
                            {
                                isFee = "是";
                            }
                            if (GobConnectMethod == "ALL" || data.pool_infos[p].connect_method == GobConnectMethod){
                                divelementstr += '<tr>'+
                                     '<td>' + data.pool_infos[p].nick_name +'<a href="userList?QueryPort='+data.pool_infos[p].listen_port+'"> 详情</a>'+ '</td>'+
                                    '<td>' + data.pool_infos[p].listen_port + '</td>' + 
                                    '<td>' + data.pool_infos[p].address + '</td>'+
                                    // '<td>' + (data.pool_infos[p].average_fee_point*100).toFixed(2)+"%" + '</td>'+
                                    '<td>' + isFrontProxy + '</td>'+
                                    '<td>' + isFee + '</td>'+
                                    '<td>' + data.pool_infos[p].average_fee_point_set.toFixed(2)+"%" + '</td>' +
                                    '<td>' + data.pool_infos[p].connect_method + '</td>' +
                                    '<td>' + this_hashrate + '</td>'  + 
                                    '<td>' + data.pool_infos[p].clients + '</td>'  + 
                                    '<td>' + isOpen + '</td>'  + 
                                    '<td>\
                                        <div class="d-flex">\
                                            <a href="#" class="btn btn-primary shadow btn-xs sharp me-1" onclick="poolListActionEditor(this)" title="编辑" type="'+data.pool_infos[p].nick_name+','+data.pool_infos[p].listen_port+'"><i class="fas fa-pencil-alt"></i></a>\
                                            <a href="#" class="btn btn-info shadow btn-xs sharp me-1" onclick="poolListActionCopy(this)" title="复制" type="'+data.pool_infos[p].nick_name+'"><i class="fas fa-copy"></i></a>\
                                            <a href="#" class="btn btn-danger shadow btn-xs sharp" onclick="poolListActionDel(this)" title="删除" type='+data.pool_infos[p].listen_port+'><i class="fa fa-trash"></i></a>\
                                        </div>\
                                    </td>\
                                    </tr>';
                            }
                        }
                        
                    }
                    if($('#table-poollist').hasClass('dataTable')){
                        var oldTable = $('#table-poollist').dataTable();
                        oldTable.fnClearTable(); //清空一下table
                        oldTable.fnDestroy(); //还原初始化了的dataTable
                        document.getElementById("pool-list").innerHTML = "";
                    }
                    document.getElementById("pool-list").innerHTML = divelementstr;
                    var table2 = $('#table-poollist').DataTable( {
                            createdRow: function(row, data, index) {
                                $(row).addClass('selected')
                            },
                            language: {
                                paginate: {
                                    next: '<i class="fa fa-angle-double-right" aria-hidden="true"></i>',
                                    previous: '<i class="fa fa-angle-double-left" aria-hidden="true"></i>'
                                }
                            }
                        });
                    table2.on('click', 'tbody tr', function() {
                        var $row = table2.row(this).nodes().to$();
                        var hasClass = $row.hasClass('selected');
                        if (hasClass) {
                            //$row.removeClass('selected')
                        } else {
                            //$row.addClass('selected')
                        }
                    })
                    table2.rows().every(function() {
                        this.nodes().to$().removeClass('selected')
                    });

                    // $('#table-poollist').dataTable().fnAddData(
                    //     ["12","jkasj","asdas","1992","ETH","l"]
                    // );
                }
            }
            xhr.open('GET', 'api/proxyPoolInfo?coinType='+GobCoinType, true)
            xhr.send();
        }
        ProxyPoolInfo();
        TargetPoolInfo();
        getproxyConfigInfoAll();
    </script>
</body>

</html>