<!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 User List</title>

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

    <link href="static/css/jquery.dataTables.min.css" rel="stylesheet">
    <link rel="stylesheet" href="static/css/nouislider.min.css">

</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">
                <div class="row">
                    <div class="col-xl-12">
                        <div class="row">
                            <div class="col-xl-12">
                                <div class="row">
                                    <div class="col-xl-12" id="morris_area_div">
                                        <div class="card-header border-0 pb-0">
                                            <h4 class="fs-20 font-w700 mb-0" id="h4TitleForTable"></h4>
                                            <h4 class="fs-20 font-w700 mb-0" id="h4TotalWoker"></h4>
                                            <h4 class="fs-20 font-w700 mb-0" id="h4TotalHashRate"></h4>
                                            <h4 class="fs-20 font-w700 mb-0" id="AverageFeePoint"></h4>
                                            <h4 class="fs-20 font-w700 mb-0" id="AverageLatency"></h4>
                                        </div>   
                                        <div id="morris_area" class="revenueMap"></div>
                                    </div>
                                    <div class="col-xl-12" id="jkjkjk">
                                        <div class="card">
                                            <div class="card-header">
                                                <h4 class="card-title">矿池列表</h4>
                                                <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>
                                            </div>
                                            <div class="card-body">
                                                <div class="row">
                                                    <div class="col-sm-2">
                                                        <div class="nav flex-column nav-pills mb-3" id="flex_column_addpool">
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-10">
                                                        <div class="tab-content">
                                                            <div class="table-responsive">
                                                                <table id="userlistTable" class="display" style="min-width: 780">
                                                                    <thead>
                                                                        <tr>
                                                                            <th>矿工</th>
                                                                            <th>矿机</th>
                                                                            <th>总算力</th>
                                                                            <th>总份额</th>
                                                                            <th>抽水份额</th>
                                                                            <th>抽水占比</th>
                                                                            <th>平均难度</th>
                                                                            <th>平均延迟</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody id="clientList">
                                                                        <!--就是动态添加-->
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </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>
    <!-- Chart Morris plugin files -->
    <!-- Apex Chart -->
    <script src="static/js/apexchart.js"></script>
    <!-- <script src="static/js/morris-init.js"></script> -->
    <script src="static/js/custom.min.js"></script>
    <script src="static/js/dlabnav-init.js"></script>
    <script src="static/js/demo.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>
        // 获取币种
        GetCoinTypeFunc();
        // 获取当前页面的url参数
        function getQueryVariable(variable)
        {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i=0;i<vars.length;i++) {
                    var pair = vars[i].split("=");
                    if(pair[0] == variable){return pair[1];}
            }
            return(false);
        }
        // 更新url参数
        function replaceParamVal(key, value){
            let oUrl = window.location.href.toString();
            let re = eval('/(' + key + '=)([^&]*)/gi');
            let nUrl = oUrl.replace(re, key + '=' + value);
           // window.location = nUrl;//跳转
            history.pushState("","",nUrl);//不跳转
        }
        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 GobCoinType = "{{.CoinTypeSet}}";
        var GobConnectMethod ="ALL";
        document.getElementById("morris_area_div").style.display = "none";
        function timestampToTime(timestamp) {
            var date = new Date(timestamp * 1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
            var Y = date.getFullYear() + '-';
            var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
            var D = date.getDate() + ' ';
            var h = date.getHours() + ':';
            var m = date.getMinutes();
            return Y+M+D+h+m;
        }
        function CalHash(v){
            var tmptmp = v+"Sol";
            // sol m g t p e
            if( v>1000){
                tmptmp = v/(1000).toFixed(3)+"KH";
            }
            if( v>1000*1000){
                tmptmp = v/(1000*1000).toFixed(3)+"MH";
            }
            if( v>1000*1000*1000){
                tmptmp = v/(1000*1000*1000).toFixed(3)+"GH";
            }
            if( v>1000*1000*1000*1000){
                tmptmp = v/(1000*1000*1000*1000).toFixed(3)+"TH";
            }
            if( v>1000*1000*1000*1000*1000){
                tmptmp = v/(1000*1000*1000*1000*1000).toFixed(3)+"PH";
            }
            if( v>1000*1000*1000*1000*1000*1000){
                tmptmp = v/(1000*1000*1000*1000*1000*1000).toFixed(3)+"PH";
            }
           return tmptmp;
        }
        var areaChart = function(QueryCoinType,QueryPort) {
            var op = {
                series: [{
                    name: '矿机',
                    data: [0],
                    color: 'rgba(55,142,240,0.7)',
                },
                {
                    name: '算力',
                    data: [0],
                    color: 'rgba(241,92,128,0.7)',
                },{
                    name: '平均延迟',
                    data: [0],
                    color: 'rgba(43,144,143,0.7)',
                },{
                    name: '抽水转换率',
                    data: [0],
                    color: 'rgba(247,163,92,0.7)',
                } ],
                chart: {
                    type: 'line',
                    height: 300,
                    toolbar: {
                        show: false,
                    },
                },
                plotOptions: {
                    bar: {
                        horizontal: false,
                        columnWidth: '70%',
                        endingShape: 'rounded'
                    },
                },
                colors: ['#886CC0'],
                dataLabels: {
                    enabled: false,
                },
                markers: {
                    shape: "circle",
                },
                legend: {
                    show: true,
                },
                stroke: {
                    show: true,
                    width: 5,
                    curve: 'smooth',
                    colors: ['var(--primary)'],
                },
                grid: {
                    borderColor: '#eee',
                    show: true,
                    xaxis: {
                        lines: {
                            show: false,
                        }
                    },
                    yaxis: {
                        lines: {
                            show: false,
                        }
                    },
                },
                xaxis: {
                    categories: [],
                    show: false,
                    labels: {
                        style: {
                            colors: '#7E7F80',
                            fontSize: '13px',
                            fontFamily: 'Poppins',
                            fontWeight: 100,
                            cssClass: 'apexcharts-xaxis-label',
                        },
                        show: false
                    },
                    crosshairs: {
                        show: false,
                    }
                },
                yaxis: [{
                    show: false,
                    labels: {
                        offsetX: -15,
                        style: {
                            colors: '#7E7F80',
                            fontSize: '14px',
                            fontFamily: 'Poppins',
                            fontWeight: 100,
                        },
                        formatter: function(y) {
                            return y.toFixed(0) + "台";
                        },
                    },
                },
                {
                    show: false,
                    labels: {
                        offsetX: -15,
                        style: {
                            colors: '#7E7F80',
                            fontSize: '14px',
                            fontFamily: 'Poppins',
                            fontWeight: 100,
                        },
                        formatter: function(y) {
                            return  CalHash(y);
                        },
                    },
                },
                {
                    show: false,
                    labels: {
                        offsetX: -15,
                        style: {
                            colors: '#7E7F80',
                            fontSize: '14px',
                            fontFamily: 'Poppins',
                            fontWeight: 100,
                        },
                        formatter: function(y) {
                            return y.toFixed(1) + "ms";
                        },
                    },
                },
                {
                    show: false,
                    labels: {
                        offsetX: -15,
                        style: {
                            colors: '#7E7F80',
                            fontSize: '14px',
                            fontFamily: 'Poppins',
                            fontWeight: 100,
                        },
                        formatter: function(y) {
                            return y.toFixed(2) + "%";
                        },
                    },
                }],
                fill: {
                    opacity: 1,
                    colors: '#FAC700'
                },
                tooltip: {
                    y: [
                        {
                            formatter: function(val) {
                                return val.toFixed(0) + "台"
                            }
                        },
                        {
                            formatter: function(val) {
                                return CalHash(val)
                            }
                        },
                        {
                            formatter: function(val) {
                                return val.toFixed(2) + "ms"
                            }
                        },
                        {
                            formatter: function(val) {
                                return val.toFixed(2) + "%"
                            }
                        }
                    ]
                }
            };
            var chartBarHashRate = new ApexCharts(document.querySelector("#morris_area"), op);
            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 thish4TotalWoker=0;
                    var thish4h4TotalHashRate=0;
                    var WorkerOffLine=0;
                    var thisAverageFeePoint=0;
                    var thisAverageLatency=0;
                    var data = xhr.responseText;
                    data = JSON.parse(data);
                    for (var p in data.data.history_info) {
                        op.series[0].data[p] = data.data.history_info[p].worker_on_line_cnt;
                        op.series[1].data[p] = data.data.history_info[p].hash_rate;
                        op.series[2].data[p] = data.data.history_info[p].average_latency.toFixed(1);
                        op.series[3].data[p] = (data.data.history_info[p].average_fee_point*100).toFixed(2);
                        op.xaxis.categories[p] = timestampToTime(data.data.history_info[p].time);
                        thish4TotalWoker =   op.series[0].data[p];
                        thish4h4TotalHashRate =   op.series[1].data[p];
                        thisAverageFeePoint =  op.series[3].data[p];
                        thisAverageLatency = op.series[2].data[p];
                        WorkerOffLine = data.data.history_info[p].worker_off_line_cnt;
                    }
                    document.getElementById("h4TotalWoker").innerHTML = "矿机:"+thish4TotalWoker+"/"+'<span class="text-danger">'+WorkerOffLine+'</span> 台'
                    document.getElementById("h4TotalHashRate").innerHTML = "算力:"+CalHash(thish4h4TotalHashRate);
                    document.getElementById("AverageFeePoint").innerHTML = "抽水转换率:"+thisAverageFeePoint+"%";
                    document.getElementById("AverageLatency").innerHTML = "平均延迟:"+thisAverageLatency+"ms";
                    document.getElementById("morris_area").innerHTML ="";
                    chartBarHashRate.render();
                }
            }
            xhr.open('GET', 'api/proxyPoolHistoryInfo?coinType='+QueryCoinType+'&port='+QueryPort, true)
            xhr.send();
        }
        function methodSearchFunc(obj)
        {
           GobConnectMethod = obj.type;
           MinerInfo("");
           PoolInfo(GobCoinType); 
        }
        function getPosition(node) {
            //获取元素相对于其父元素的left值var left
            var left = node.offsetLeft; 
            var top = node.offsetTop;
            // 取得元素的offsetParent
            current = node.offsetParent; 
            // 一直循环直到根元素
            while(current != null) {　　
                left += current.offsetLeft;　　
                top += current.offsetTop;　　
                current = current.offsetParent;　
            }
            return {
                "left": left,
                "top": top
            };
        }
        function mouseover(obj){
            var data = getPosition(obj);
            var data1 = getPosition(document.getElementById("jkjkjk"));
            var x,y;
            var new_x=data1.left;
            if(new_x <80&&new_x>0){
                new_x = 80;
            }
            if(new_x < 0){
                new_x = 200;
            }
            x = (new_x +data.left)+"px";
            y = (data.top)+"px";
            var tooltip ='<div class="popover fade show bs-popover-end" role="tooltip" id="popover364282" style="margin: 0px; position: absolute; left: 0px; top: 0px; right: auto; bottom: auto;" data-popper-placement="right">\
                <div class="popover-arrow" style="position: absolute; top: 0px; transform: translate(0px, 15px);"></div>\
                <h3 class="popover-header">'+obj.text+'['+obj.type+']'+'</h3>\
                <div class="popover-body">'+obj.rel+'</div>\
            </div>';
            $("#jkjkjk").append(tooltip); //追加到文档中
            $("#popover364282").css({
            "transform": 'translate('+x+','+y+')',
            }).show(); //设置X  Y坐标， 并且显示
        }
        function mouseout(obj){
            $("#popover364282").remove(); //移除
        }
        function CalDiff(v){
            var tmptmp = v.toFixed(3)+"Sol";
            // sol m g t p e
            if( v>1000){
                tmptmp = (v/(1000)).toFixed(3)+"K";
            }
            if( v>1000*1000){
                tmptmp = (v/(1000*1000)).toFixed(3)+"M";
            }
            if( v>1000*1000*1000){
                tmptmp = (v/(1000*1000*1000)).toFixed(3)+"G";
            }
            if( v>1000*1000*1000*1000){
                tmptmp = (v/(1000*1000*1000*1000)).toFixed(3)+"T";
            }
            if( v>1000*1000*1000*1000*1000){
                tmptmp = (v/(1000*1000*1000*1000*1000)).toFixed(3)+"P";
            }
            if( v>1000*1000*1000*1000*1000*1000){
                tmptmp = (v/(1000*1000*1000*1000*1000*1000)).toFixed(3)+"P";
            }
           return tmptmp;
        }
        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;
        }
        function PoolInfo(CoinType){
            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 flex_column_addpoolstr = "";
                    var this_total_hashrate =0;
                    var this_total_clients = 0;
                    var UrlPortPar = getQueryVariable("QueryPort");
                    for (var p in data.pool_infos) {
                        if (data.pool_infos[p].coin_type == CoinType){//ConnectMethod 判断连接方式
                            if(GobConnectMethod =="ALL" || data.pool_infos[p].connect_method == GobConnectMethod){
                                var this_hashrate = data.pool_infos[p].hash_rate;
                                this_total_hashrate+=this_hashrate;
                                this_total_clients+=data.pool_infos[p].clients;
                                if (UrlPortPar == data.pool_infos[p].listen_port){
                                    document.getElementById("morris_area_div").style.display = "";
                                    document.getElementById("h4TitleForTable").innerText = data.pool_infos[p].nick_name+'['+UrlPortPar+']';
                                    //过滤掉端口的信息
                                    MinerInfo(data.pool_infos[p].listen_port);
                                    flex_column_addpoolstr += '<a href="#" data-bs-toggle="pill" onmouseover="mouseover(this)" onmouseout="mouseout(this)"  onclick="fand_minerbyport_function(this)" rel="总算力:'+CalHash(this_hashrate)+';总矿机数:'+data.pool_infos[p].clients+' 台" type='+'"'+data.pool_infos[p].listen_port+'"'+ 'class="nav-link active">'+data.pool_infos[p].nick_name+'</a>';
                                }else{
                                    flex_column_addpoolstr += '<a href="#" data-bs-toggle="pill" onmouseover="mouseover(this)" onmouseout="mouseout(this)"  onclick="fand_minerbyport_function(this)" rel="总算力:'+CalHash(this_hashrate)+';总矿机数:'+data.pool_infos[p].clients+' 台" type='+'"'+data.pool_infos[p].listen_port+'"'+ 'class="nav-link">'+data.pool_infos[p].nick_name+'</a>';
                                }
                            }
                        }
                    }
                    document.getElementById("flex_column_addpool").innerHTML = flex_column_addpoolstr;
                }
            }
            xhr.open('GET', 'api/proxyPoolInfo?coinType='+CoinType, true)
            xhr.send();
        }
        function fand_minerbyport_function(obj){
            var listenPort = obj.type;
            $("#popover364282").remove(); //移除
            MinerInfo(listenPort);
            document.getElementById("morris_area_div").style.display = "";
            areaChart(GobCoinType,listenPort);
            document.getElementById("h4TitleForTable").innerText = obj.text+'['+listenPort+']';
            // 更新url参数
            replaceParamVal("QueryPort",listenPort);
        }
        function MinerInfo(ListPort){
            var xhrClientInfo = new XMLHttpRequest();
            xhrClientInfo.onreadystatechange = function() {
                if (xhrClientInfo.readyState == 4 && xhrClientInfo.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xhrClientInfo.readyState == 4 && xhrClientInfo.status == 200) {
                    var data = xhrClientInfo.responseText;
                    data = JSON.parse(data);
                    var divelementstr = "";
                    for (var p in data.miner_base) {
                        if (data.miner_base[p].coin_type == GobCoinType){
                            var this_hashrate = CalHash(data.miner_base[p].total_hash_rate);
                            var feePointReal = (data.miner_base[p].average_fee_point*100).toFixed(2);
                            divelementstr += '<tr>'+
                                '<td>' + data.miner_base[p].name +
                                '<td>' + data.miner_base[p].total_worker+"台" + '<a href="userDashboard?coinType='+data.miner_base[p].coin_type+'&miner=' + data.miner_base[p].name + '"' + 'target="_blank"> 详情</a></td>'+ '</td>' +
                                '<td>' + this_hashrate + '</td>' +
                                '<td>' + data.miner_base[p].total_shares +'/<span class="text-danger">'+data.miner_base[p].total_invalid_share+'</span>'+ '</td>' +
                                '<td>' + data.miner_base[p].total_fee_shares +'</td>' + 
                                '<td>' + feePointReal +'%' + '</td>' + 
                                '<td>' + CalDiff(data.miner_base[p].average_difficulty) + '</td>' + 
                                '<td>' + data.miner_base[p].pool_average_latency.toFixed(2) +'ms' + '</td>' + 
                                '</tr>';
                        }
                    }
                    if($('#userlistTable').hasClass('dataTable')){
                        var oldTable = $('#userlistTable').dataTable();
                        oldTable.fnClearTable(); //清空一下table
                        oldTable.fnDestroy(); //还原初始化了的dataTable
                        document.getElementById("clientList").innerHTML = "";
                    }
                    document.getElementById("clientList").innerHTML = divelementstr;
                    //加载数据后面好选择使用
                    var tableuserlist = $('#userlistTable').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>'
                            }
                        }
                    });
                    tableuserlist.on('click', 'tbody tr', function() {
                        var $row = tableuserlist.row(this).nodes().to$();
                        var hasClass = $row.hasClass('selected');
                        if (hasClass) {
                            //$row.removeClass('selected')
                        } else {
                            //$row.addClass('selected')
                        }
                    })
                    tableuserlist.rows().every(function() {
                        this.nodes().to$().removeClass('selected')
                    });
                }
            }
            if(ListPort ==""){
                xhrClientInfo.open('GET', 'api/minerInfo/'+GobCoinType, true)
                xhrClientInfo.send();
            }else{
                xhrClientInfo.open('GET', 'api/minerInfoByPort?queryPort='+ListPort, true)
                xhrClientInfo.send();
            }
        }        
        MinerInfo("");
        PoolInfo(GobCoinType);
        jQuery(window).on('load', function() {
            setTimeout(function() {
                var port = getQueryVariable("QueryPort");
                if(port!=false){
                    areaChart(GobCoinType,port);
                }
            }, 1000);
        });
    </script>
</body>

</html>