From 463b92a6f6eda49b759ed0fa1c4b96ee965dfadd Mon Sep 17 00:00:00 2001
From: macos <tengyue.li@100credit.com>
Date: Mon, 29 Jun 2020 11:04:33 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=EF=BC=8C?=
 =?UTF-8?q?=E4=B8=89=E7=BD=91=E5=BB=B6=E8=BF=9F=E6=89=A9=E5=B1=95=E5=88=97?=
 =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=B1=95=E7=A4=BA=E5=87=BA=E6=9D=A5=E8=80=8C?=
 =?UTF-8?q?=E4=B8=8D=E6=98=AF=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=8A=A8=E6=8F=90?=
 =?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 web/index.html         |  2 +-
 web/js/serverstatus.js | 22 +++++++++++++---------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/web/index.html b/web/index.html
index 91164df..7d73407 100644
--- a/web/index.html
+++ b/web/index.html
@@ -76,7 +76,7 @@
 			<table class="table table-striped table-condensed table-hover">
 				<thead>
 				<tr>
-					<th id="status4" style="text-align: center;">IPv4</th>
+					<th id="status4" style="text-align: center;">协议</th>
 					<th id="ipstatus" style="text-align: center;">Flight</th>
 					<th id="name">节点名</th>
 					<th id="type">虚拟化</th>
diff --git a/web/js/serverstatus.js b/web/js/serverstatus.js
index a10f35a..36c658f 100644
--- a/web/js/serverstatus.js
+++ b/web/js/serverstatus.js
@@ -104,6 +104,7 @@ function uptime() {
 						"<div id=\"expand_swap\">加载中</div>" +
 						"<div id=\"expand_hdd\">加载中</div>" +
 						"<div id=\"expand_tupd\">加载中</div>" +
+						"<div id=\"expand_ping\">加载中</div>" +
 						"<div id=\"expand_custom\">加载中</div>" +
 					"</div></td></tr>"
 				);
@@ -118,9 +119,15 @@ function uptime() {
 			}
 
 			// Online4
-			if (result.servers[i].online4) {
+			if (result.servers[i].online4 && !result.servers[i].online6) {
 				TableRow.children["online4"].children[0].children[0].className = "progress-bar progress-bar-success";
-				TableRow.children["online4"].children[0].children[0].innerHTML = "<small>开启</small>";
+				TableRow.children["online4"].children[0].children[0].innerHTML = "<small>IPv4</small>";
+			} else if (result.servers[i].online4 && result.servers[i].online6) {
+				TableRow.children["online4"].children[0].children[0].className = "progress-bar progress-bar-success";
+				TableRow.children["online4"].children[0].children[0].innerHTML = "<small>双栈</small>";
+			} else if (!result.servers[i].online4 && result.servers[i].online6) {
+			    TableRow.children["online4"].children[0].children[0].className = "progress-bar progress-bar-success";
+				TableRow.children["online4"].children[0].children[0].innerHTML = "<small>IPv6</small>";
 			} else {
 				TableRow.children["online4"].children[0].children[0].className = "progress-bar progress-bar-danger";
 				TableRow.children["online4"].children[0].children[0].innerHTML = "<small>关闭</small>";
@@ -136,6 +143,7 @@ function uptime() {
 			//}
 
 			// Ipstatus
+			// mh361 or mh370, mourn mh370, 2014-03-08 01:20 lost from all over the world.
 			if (result.servers[i].ip_status) {
 				TableRow.children["ip_status"].children[0].children[0].className = "progress-bar progress-bar-success";
 				TableRow.children["ip_status"].children[0].children[0].innerHTML = "<small>MH361</small>";
@@ -274,21 +282,17 @@ function uptime() {
 
 				// tcp, udp, process, thread count
 				ExpandRow[0].children["expand_tupd"].innerHTML = "TCP/UDP/进/线: " + result.servers[i].tcp_count + " / " + result.servers[i].udp_count + " / " + result.servers[i].process_count+ " / " + result.servers[i].thread_count;
-
+				ExpandRow[0].children["expand_ping"].innerHTML = "联通/电信/移动: " + result.servers[i].time_10010 + "ms / " + result.servers[i].time_189 + "ms / " + result.servers[i].time_10086 + "ms"
 
                 // ping
                 var PING_10010 = result.servers[i].ping_10010.toFixed(0);
                 var PING_189 = result.servers[i].ping_189.toFixed(0);
                 var PING_10086 = result.servers[i].ping_10086.toFixed(0);
-                var pingTime = result.servers[i].time_10010 + "ms💻" + result.servers[i].time_189 + "ms💻" + result.servers[i].time_10086 + "ms"
-                if (PING_10010 >= 10 || PING_189 >= 10 || PING_10086 >= 10)
+                if (PING_10010 >= 20 || PING_189 >= 20 || PING_10086 >= 20)
                     TableRow.children["ping"].children[0].children[0].className = "progress-bar progress-bar-danger";
                 else
                     TableRow.children["ping"].children[0].children[0].className = "progress-bar progress-bar-success";
-                    TableRow.children["ping"].children[0].children[0].setAttribute("data-toggle", "tooltip");
-                    TableRow.children["ping"].children[0].children[0].setAttribute("data-placement", "right");
-                    TableRow.children["ping"].children[0].children[0].setAttribute("title", pingTime);
-				TableRow.children["ping"].children[0].children[0].innerHTML = PING_10010 + "%💻" + PING_189 + "%💻" + PING_10086 + "%";
+	            TableRow.children["ping"].children[0].children[0].innerHTML = PING_10010 + "%💻" + PING_189 + "%💻" + PING_10086 + "%";
 
 				// Custom
 				if (result.servers[i].custom) {