<!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 Setting</title>

    <!-- FAVICONS ICON -->

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

</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-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">面板设置</h4>
                            </div>
                            <div class="card-body">
                                <div class="basic-form">
                                    <form class="form-valide-with-icon needs-validation" action="/panelSetting" method="post"
                                        novalidate="">
                                        <table class="table verticle-middle table-responsive-md">
                                            <thead>
                                                <tr>
                                                    <th scope="col">名字</th>
                                                    <th scope="col">变量</th>
                                                    <th scope="col">操作</th>
                                                </tr>
                                            </thead>
                                            <tbody id="swap-pool-list">
                                                <tr>
                                                    <td>版本</td>
                                                    <td>{{.PorttranVersion}}</td>
                                                    <td></td>
                                                </tr>
                                                <tr>
                                                    <td>主端口</td>
                                                    <td id="set_web_port">{{.PorttranWebPort}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item sweet_prompt_set_webport"
                                                                    href="javascript:void();;">编辑</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>观察者端口</td>
                                                    <td id="set_obweb_port">{{.ObserverWebPort}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                            data-bs-toggle="dropdown">
                                                            <svg xmlns="http://www.w3.org/2000/svg"
                                                                xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                width="18px" height="18px" viewbox="0 0 24 24"
                                                                version="1.1">
                                                                <g stroke="none" stroke-width="1" fill="none"
                                                                    fill-rule="evenodd">
                                                                    <rect x="0" y="0" width="24" height="24"></rect>
                                                                    <circle fill="#000000" cx="12" cy="5" r="2">
                                                                    </circle>
                                                                    <circle fill="#000000" cx="12" cy="12" r="2">
                                                                    </circle>
                                                                    <circle fill="#000000" cx="12" cy="19" r="2">
                                                                    </circle>
                                                                </g>
                                                            </svg>
                                                        </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item sweet_prompt_set_obwebport"
                                                                    href="javascript:void();;">编辑</a>
                                                                <a class="dropdown-item"  href="http://{{.ExternIP}}:{{.ObserverWebPort}}" target="_blank">连接查看</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>日志</td>
                                                    <td id="log_status">{{.LogStatus}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <!-- <a class="dropdown-item log_open_file" data-bs-toggle="modal" data-bs-target="#exampleModalLong" href="logpage">查看</a> -->
                                                                <!-- <a class="dropdown-item " href="logpage" target="_blank">查看</a> -->
                                                                <a class="dropdown-item"  href="/download/porttran.log" target="_blank">下载</a>
                                                                <a class="dropdown-item log_open" href="javascript:void();;" >打开</a>
                                                                <a class="dropdown-item log_close"href="javascript:void();;">关闭</a>
                                                                <a class="dropdown-item text-danger log_clear"href="javascript:void();;">清除</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>代理配置文件</td>
                                                    <td id="confile_name">{{.configName}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <!-- <a class="dropdown-item log_open_file" data-bs-toggle="modal" data-bs-target="#exampleModalLong" href="logpage">查看</a> -->
                                                                <!-- <a class="dropdown-item " href="logpage" target="_blank">查看</a> -->
                                                                <a class="dropdown-item config_import" href="javascript:void();;" >导入</a>
                                                                <a class="dropdown-item"  href="download/localcoinconfig.json" target="_blank">下载</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>SSL证书上传</td>
                                                    <td id="ssl_file_upload">{{.SSLName}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item ssl_file_upload_button" href="javascript:void();;" >上传</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>数据统计间隔时间(秒)</td>
                                                    <td id="set_statistical_time_interval">{{.StatisticalRefreshTime}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item sweet_prompt_set_timeinterval"
                                                                    href="javascript:void();;">编辑</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <!-- <tr>
                                                    <td>混淆工具客户端</td>
                                                    <td id="set_statistical_time_interval">操作下载</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item" href="/download/redxx_latest_amd64_x86.zip" target="_blank">下载</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr> -->
                                            </tbody>
                                        </table>
                                        <span style="DISPLAY:none">
                                            <button type="button" id="panel_update_button" class="btn me-2 btn-primary" >更新</button>
                                        </span>
                                        <button type="button" id="panel_reboot_button" class="btn me-2 btn-primary">重启面板</button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">激活设置</h4>
                            </div>
                            <div class="card-body">
                                <div class="basic-form">
                                    <form class="form-valide-with-icon needs-validation" action="/panelSetting" method="post"
                                        novalidate="">
                                        <table class="table verticle-middle table-responsive-md">
                                            <thead>
                                                <tr>
                                                    <th scope="col">名字</th>
                                                    <th scope="col">变量</th>
                                                    <th scope="col">操作</th>
                                                </tr>
                                            </thead>
                                            <tbody id="swap-pool-list">
                                                <tr>
                                                    <td>期限</td>
                                                    <td id="time_limit"></td>
                                                    <td></td>
                                                </tr>
                                                <tr>
                                                    <td>UUID</td>
                                                    <td id="machine_code">{{.MachineCode}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item machine_code_button"href="javascript:void();;">修改</a>
                                                            </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>激活码</td>
                                                    <td id="activation_code">{{.ActivationCode}}</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item activation_code_button"href="javascript:void();;">激活</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>迁移</td>
                                                    <td id="migration">如果你需要更换服务器那么将需要进行这一步</td>
                                                    <td>
                                                        <div class="dropdown custom-dropdown mb-0">
                                                            <div class="btn sharp btn-primary tp-btn"
                                                                data-bs-toggle="dropdown">
                                                                <svg xmlns="http://www.w3.org/2000/svg"
                                                                    xmlns:xlink="http://www.w3.org/1999/xlink"
                                                                    width="18px" height="18px" viewbox="0 0 24 24"
                                                                    version="1.1">
                                                                    <g stroke="none" stroke-width="1" fill="none"
                                                                        fill-rule="evenodd">
                                                                        <rect x="0" y="0" width="24" height="24"></rect>
                                                                        <circle fill="#000000" cx="12" cy="5" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="12" r="2">
                                                                        </circle>
                                                                        <circle fill="#000000" cx="12" cy="19" r="2">
                                                                        </circle>
                                                                    </g>
                                                                </svg>
                                                            </div>
                                                            <div class="dropdown-menu dropdown-menu-end">
                                                                <a class="dropdown-item migration_button"href="javascript:void();;">迁移</a>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">登录信息修改</h4>
                            </div>
                            <div class="card-body">
                                <div class="basic-form">
                                    <form class="form-valide-with-icon needs-validation" name="user_info_form" action="/loginInfoSetting" method="post"
                                        novalidate="">
                                        <div class="mb-3">
                                            <label class="text-label form-label" for="old_username">老用户名</label>
                                            <div class="input-group">
                                                <span class="input-group-text"> <i class="fa fa-user"></i> </span>
                                                <input type="text" class="form-control" name="old_username"
                                                    id="old_username" placeholder="请输入老用户名" required="">
                                                <div class="invalid-feedback">
                                                    Please Enter a username.
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mb-3">
                                            <label class="text-label form-label" for="old_password">老密码 *</label>
                                            <div class="input-group transparent-append">
                                                <span class="input-group-text"> <i class="fa fa-lock"></i> </span>
                                                <input type="password" class="form-control" name="old_password"
                                                    id="old_password" placeholder="请输入老密码" required="">
                                                <span class="input-group-text show-setting-old-pass">
                                                    <i class="fa fa-eye-slash"></i>
                                                    <i class="fa fa-eye"></i>
                                                </span>
                                                <div class="invalid-feedback">
                                                    Please Enter a username.
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mb-3">
                                            <label class="text-label form-label" for="new_username">新用户名</label>
                                            <div class="input-group">
                                                <span class="input-group-text"> <i class="fa fa-user"></i> </span>
                                                <input type="text" class="form-control" name="new_username"
                                                    id="new_username" placeholder="请输入新用户名" required="">
                                                <div class="invalid-feedback">
                                                    Please Enter a username.
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mb-3">
                                            <label class="text-label form-label" for="new_password">新密码 *</label>
                                            <div class="input-group transparent-append">
                                                <span class="input-group-text"> <i class="fa fa-lock"></i> </span>
                                                <input type="password" class="form-control" name="new_password"
                                                    id="new_password" placeholder="请输入新密码" required="">
                                                <span class="input-group-text show-setting-new-pass">
                                                    <i class="fa fa-eye-slash"></i>
                                                    <i class="fa fa-eye"></i>
                                                </span>
                                                <div class="invalid-feedback">
                                                    Please Enter a username.
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mb-3">
                                            <label class="text-label form-label" for="confirm_password">确认新密码 *</label>
                                            <div class="input-group transparent-append">
                                                <span class="input-group-text"> <i class="fa fa-lock"></i> </span>
                                                <input type="password" class="form-control" name="confirm_new_password"
                                                    id="confirm_new_password" placeholder="请再次输入新密码" required="">
                                                <span class="input-group-text show-setting-confirm-new-pass">
                                                    <i class="fa fa-eye-slash"></i>
                                                    <i class="fa fa-eye"></i>
                                                </span>
                                                <div class="invalid-feedback">
                                                    Please Enter a username.
                                                </div>
                                            </div>
                                        </div>
                                        <button type="button" id="user_info_update" class="btn me-2 btn-primary">更新</button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Modal -->
                    <div class="modal fade" id="exampleModalLong">
                        <div class="porttran-modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title">日志</h5>
                                    <button type="button" class="btn-close" id="log_display_close_1" data-bs-dismiss="modal">
                                    </button>
                                </div>
                                <div class="modal-body" id="porttran-loog-content">
                                    <p>nil.</p>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-danger light" id="log_display_close_2" data-bs-dismiss="modal">Close</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">证书上传[请将证书[crt或pem]和key文件重命名为server文件名]</h5>
                                    <button type="button" 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  method="post" enctype="multipart/form-data" 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 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>

                    <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>确定重启吗</p>
                                </div>
                                <div class="modal-footer" id="cfButtonSetting">
                                    <button id="cfButtonClose" type="button" class="btn btn-danger light" data-bs-dismiss="modal">取消</button>
                                    <button id="cfrebootbutton" type="button" class="btn btn-primary">确定</button>
                                </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/global.minSeting.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/demo.js"></script>
    <script src="static/js/sweetalert2.min.js"></script>
    <script src="static/js/toastr.min.js"></script>
    <script>
        // 获取币种
        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>
        //删除目标矿池信息选择
        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");
                } 
            }) 
        }
        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");
                        setTimeout("reloadThisPage()","3000");
                    }else if(res.status =="err"){
                        toastrAll(res.message,"失败","error");
                    }
                    // $("#f1s").val(""); 
                }, 
                error:function(err){ 
                    toastrAll("网络连接失败,稍后重试","失败","error");
                } 
            }) 
        } 
        $('body').append("<div style='display:none;width:100%; margin:0 auto;position:fixed;left:0;top:0;bottom: 0;z-index: 111;opacity: 0.5;' id='loading'><a class='mui-active' style='left: 50%;position: absolute;top:50%'><span class='mui-spinner'></span><p style='margin-left: -10px;'>读取中...</p></a></div>")　    
        var this_limit = '{{.TimeLimit}}';
        if (this_limit == 'infinite'){
            document.getElementById("time_limit").innerText = '剩余无限天';
        }else{
            document.getElementById("time_limit").innerText = '剩余'+this_limit+'天';
        }
        
        document.querySelector(".machine_code_button").onclick = function () {
            var new_machine_code = window.prompt('填入你上台服务器的UUID', '');
            if (new_machine_code != null){
                document.getElementById("machine_code").innerText = new_machine_code;
            }
        }
        document.querySelector(".migration_button").onclick = function () {
            var isMigration = window.prompt('注意:激活码将消失,请先保存你的[UUID]和[激活码]新的服务器需要,输入yes确定', '');
            if (isMigration == "yes"){
                var xh2 = new XMLHttpRequest()
                xh2.onreadystatechange = function(){
                    if (xh2.readyState == 4 && xh2.status == 400) {
                    window.location.href="/login";
                    return;
                }                    
                    if (xh2.readyState == 4 && xh2.status == 200) {
                        var data = xh2.responseText;
                        data = JSON.parse(data);
                        if (data.status == "ok"){                            
                            if (data.info == "update ok"){
                                toastrAll("迁移成功,你有1天的时间在新服务器上激活","成功","success");
                                document.getElementById("time_limit").innerText = '剩余1天';
                                document.getElementById("activation_code").innerText = "";
                            }
                        }else if(data.status == "err"){
                            if (data.info == "database error"){
                                toastrAll("迁移失败,数据库连接出错","失败","error");
                            }else{
                                toastrAll(data.info,"失败","error");
                            }
                        }
                    }
                }
                xh2.open('POST','/api/migration',true);
                xh2.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
                var new_data = 'opctl=yes';
                xh2.send(new_data);
            }
        }
        document.querySelector(".activation_code_button").onclick = function () {
            var thisActivationCode = window.prompt('请输入激活码', '');
            var this_machine_code = document.getElementById("machine_code").innerText;
            if (thisActivationCode != null) {
                var xh2 = new XMLHttpRequest()
                xh2.onreadystatechange = function(){
                    if (xh2.readyState == 4 && xh2.status == 400) {
                    window.location.href="/login";
                    return;
                }
                    if (xh2.readyState == 4 && xh2.status == 200) {
                        var data = xh2.responseText;
                        data = JSON.parse(data);
                        if (data.status == "ok"){
                            if (data.info == "Verify ok"){
                                toastrAll("激活成功","成功","success");
                                document.getElementById("time_limit").innerText = '剩余无限天';
                                document.getElementById("activation_code").innerText = thisActivationCode;
                            }
                        }else if (data.status == "err"){
                            if (data.info == "Verify error"){
                                toastrAll("激活失败,激活码不对","错误","error");
                            }
                            else if (data.info == "database error"){
                                toastrAll("激活失败,数据库连接出错","失败","error");
                            }
                            else if (data.info == "Has been activated"){
                                toastrAll("此UUID已经激活过了","失败","error");
                            }
                            else if (data.info == "no result"){
                                toastrAll("UUID不存在","失败","error");
                            }else{
                                toastrAll(data.info,"失败","error");
                            }
                        }
                    }
                }
                xh2.open('POST','/api/activation',true);
                xh2.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
                var new_data = 'activation_code='+thisActivationCode+'&machine_code='+this_machine_code;
                xh2.send(new_data);
            }
        }
        // $("#log_display_close_1").on("click", function () {
        //     $("#loading").hide();
        // });
        // $("#log_display_close_2").on("click", function () {
        //     $("#loading").hide();
        // });
        // document.querySelector(".log_open_file").onclick = function () {
        //     var xh2 = new XMLHttpRequest()
        //     $("#loading").show();
        //     xh2.onreadystatechange = function(){
        //         if (xh2.readyState == 4 && xh2.status == 200) {
        //             var data = xh2.responseText;
        //             var newDisplayData="";
        //             var newLineData="";
        //             //data=data.replace(/\n/g,"<br/>");
        //             var lines = data.split('\n');
        //             for(var line = 0; line < lines.length-1; line++){
        //                 if (lines[line].indexOf("[36mINFO[0m")!=-1){
        //                     newLineData = lines[line].replace('[36mINFO[0m','<p style="color:green">INFO');
        //                 }else if (lines[line].indexOf("[31mERRO[0m")!=-1){
        //                     newLineData = lines[line].replace('[31mERRO[0m','<p style="color:red">ERRO');
        //                 }else if (lines[line].indexOf("[37mDEBU[0m")!=-1){
        //                     newLineData = lines[line].replace('[37mDEBU[0m','<p>DEBU');
        //                 }
        //                 newLineData+='<\p>';
        //                 newDisplayData+=newLineData;
        //             }
        //             document.getElementById("porttran-loog-content").innerHTML=newDisplayData;
        //         }
        //     }
        //     xh2.open('GET','/download/porttran.log',false);
        //     xh2.send();
        // }
        document.querySelector(".log_open").onclick = function () {
            var xh2 = new XMLHttpRequest()
            xh2.onreadystatechange = function(){
                if (xh2.readyState == 4 && xh2.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xh2.readyState == 4 && xh2.status == 200) {
                    var data = xh2.responseText;
                    data = JSON.parse(data);
                    if (data.status == "ok"){
                        toastrAll("打开成功","成功","success");
                        document.getElementById("log_status").innerText = 'open'
                    }else{
                        toastrAll(data.info,"错误","error");
                    }
                }
            }
            xh2.open('POST','/api/logCtl',true);
            xh2.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
            var new_data = 'log_ctl_op=open';
            xh2.send(new_data);
        }
        document.querySelector(".log_close").onclick = function () {
            var xh2 = new XMLHttpRequest()
            xh2.onreadystatechange = function(){
                if (xh2.readyState == 4 && xh2.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (xh2.readyState == 4 && xh2.status == 200) {
                    var data = xh2.responseText;
                    data = JSON.parse(data);
                    if (data.status == "ok"){
                        toastrAll("关闭成功","成功","success");
                        document.getElementById("log_status").innerText = 'close'
                    }else{
                        toastrAll(data.info,"错误","error");
                    }
                }
            }
            xh2.open('POST','/api/logCtl',true);
            xh2.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
            var new_data = 'log_ctl_op=close';
            xh2.send(new_data);
        }
        document.querySelector(".log_clear").onclick = function () {
            var xh2 = new XMLHttpRequest()
            xh2.open('POST','/api/clearLogFile',true);
            xh2.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
            xh2.send()
            location.reload();
        }
        document.querySelector(".sweet_prompt_set_timeinterval").onclick = function () {
            var tempA = window.prompt('请输入数据统计数据刷新间隔时间(秒)', '');
            if (tempA != null) {
                document.getElementById("set_statistical_time_interval").innerHTML = tempA
                document.getElementById("panel_update_button").click();
            }
        }
        document.querySelector(".sweet_prompt_set_webport").onclick = function () {
            var tempA = window.prompt('请输入面板监听端口', '');
            if (tempA != null) {
                document.getElementById("set_web_port").innerHTML = tempA
                document.getElementById("panel_update_button").click();
            }
        }
        document.querySelector(".sweet_prompt_set_obwebport").onclick = function () {
            var tempA = window.prompt('请输入观察者监听端口', '');
            if (tempA != null) {
                document.getElementById("set_obweb_port").innerHTML = tempA
                document.getElementById("panel_update_button").click();
            }
        }
        document.querySelector(".ssl_file_upload_button").onclick = function(){
            document.getElementById("exampleModalpopoverButton").click();
        }
        document.querySelector(".config_import").onclick = function(){
            document.getElementById("exampleConfigImportButton").click();
        }
        function reloadIndex(){
            window.location.href="/index";
        }
        $("#cfrebootbutton").on("click", function() {
            var xh2 = new XMLHttpRequest()
            xh2.open('POST','/api/reboot',true);
            xh2.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
            xh2.send();
            toastrAll("重启中等待3秒生效","信息","info");
            setTimeout("reloadIndex()","3000");
            document.getElementById("cfButtonClose").click();
        });
        //重启按键
        $("#panel_reboot_button").on("click", function () {
            document.getElementById("cfButton").click();
        });

        $("#panel_update_button").on("click", function () {
           var this_web_port = document.getElementById("set_web_port").innerText;
           var tmpobport = document.getElementById("set_obweb_port").innerText;
           var index = tmpobport.indexOf("IP:");
           var this_obweb_port;
           if(index>0){
            this_obweb_port = tmpobport.substr(index+3,tmpobport.length);
           }else{
            this_obweb_port = document.getElementById("set_obweb_port").innerText;
           }
           var this_statistical_time_interval = document.getElementById("set_statistical_time_interval").innerText;
           var UpdatePanelInfoRequest = new XMLHttpRequest()
           UpdatePanelInfoRequest.onreadystatechange = function(){
            if (UpdatePanelInfoRequest.readyState == 4 && UpdatePanelInfoRequest.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (UpdatePanelInfoRequest.readyState == 4 && UpdatePanelInfoRequest.status == 200) {
                    var data = UpdatePanelInfoRequest.responseText;
                    data = JSON.parse(data);
                    if (data.info == "update ok"){
                        toastrAll("更新成功,请重启面板","成功","success");
                    }
                    else if (data.info == "strconv time err"){
                        toastrAll("时间格式错误","错误","error");
                    }else if (data.info == "strconv port err"){
                        toastrAll("端口格式错误","错误","error");
                    }else{
                        toastrAll(data.info,"错误","error");
                    }
                }
            }
            var new_data = 'set_web_port='+this_web_port+'&set_statistical_time_interval='+this_statistical_time_interval+'&set_obweb_port='+this_obweb_port;
            UpdatePanelInfoRequest.open('POST','/api/panelSetting',true);
            UpdatePanelInfoRequest.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
            UpdatePanelInfoRequest.send(new_data);
        });
        function reloadLogin(){
            window.location.href="/login";
        }
        $("#user_info_update").on("click", function () {
            var this_user_old_name = user_info_form.old_username.value;
            var this_user_old_password = user_info_form.old_password.value;
            var this_user_new_username = user_info_form.new_username.value;
            var this_user_new_password = user_info_form.new_password.value;
            var this_user_confirm_new_password = user_info_form.confirm_new_password.value;
            if (this_user_old_name==""||this_user_old_password==""||this_user_new_username==""||this_user_new_password==""){
                toastrAll("输入的内容不能为空","错误","error");
                return;
            }
            if(this_user_new_password!=this_user_confirm_new_password){
                toastrAll("两次输入的密码不相同","错误","error");
                return;
            }
            var UpdateUserInfoRequest = new XMLHttpRequest()
            UpdateUserInfoRequest.onreadystatechange = function(){
                if (UpdateUserInfoRequest.readyState == 4 && UpdateUserInfoRequest.status == 400) {
                    window.location.href="/login";
                    return;
                }
                if (UpdateUserInfoRequest.readyState == 4 && UpdateUserInfoRequest.status == 200) {
                    var data = UpdateUserInfoRequest.responseText;
                    data = JSON.parse(data);
                    if (data.info == "update ok"){
                        toastrAll("更改成功,即将跳转到登录界面","成功","success");
                        setTimeout("reloadLogin()","3000");
                    }
                    else if (data.info == "old user name error"){
                        toastrAll("老用户名错误","错误","error");
                    }
                    else if (data.info == "old password error"){
                        toastrAll("老密码错误","错误","error");
                    }
                }
            }
            var new_date = 'old_username='+this_user_old_name+'&old_password='+this_user_old_password+'&new_username='+this_user_new_username+'&new_password='+this_user_new_password;
            UpdateUserInfoRequest.open('POST','/api/setUserLoginInfo',true);
            UpdateUserInfoRequest.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" );
            UpdateUserInfoRequest.send(new_date);
        });
        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
                    });
            }
        }
    </script>
</body>

</html>