mirror of
https://github.com//cppla/ServerStatus
synced 2025-07-10 03:35:59 +08:00
bug test
This commit is contained in:
parent
654ecd7a3e
commit
6a15832966
web
@ -20,7 +20,7 @@ tr.odd.expandRow > :hover { background: #212e36 !important; }
|
|||||||
#month_traffic { min-width: 85px; max-width: 95px;}
|
#month_traffic { min-width: 85px; max-width: 95px;}
|
||||||
#network { min-width: 115px; }
|
#network { min-width: 115px; }
|
||||||
#cpu, #ram, #hdd { min-width: 45px; max-width: 90px; }
|
#cpu, #ram, #hdd { min-width: 45px; max-width: 90px; }
|
||||||
#io { min-width: 55px; }
|
#io { width: 90px; }
|
||||||
#ping { max-width: 95px; }
|
#ping { max-width: 95px; }
|
||||||
|
|
||||||
@media only screen and (max-width: 1080px) {
|
@media only screen and (max-width: 1080px) {
|
||||||
|
@ -17,7 +17,7 @@ tr.odd.expandRow > :hover { background: #FFF !important; }
|
|||||||
#month_traffic { min-width: 85px; max-width: 95px;}
|
#month_traffic { min-width: 85px; max-width: 95px;}
|
||||||
#network { min-width: 115px; }
|
#network { min-width: 115px; }
|
||||||
#cpu, #ram, #hdd { min-width: 45px; max-width: 90px; }
|
#cpu, #ram, #hdd { min-width: 45px; max-width: 90px; }
|
||||||
#io { min-width: 55px; }
|
#io { width: 90px; }
|
||||||
#ping { max-width: 95px; }
|
#ping { max-width: 95px; }
|
||||||
|
|
||||||
@media only screen and (max-width: 1080px) {
|
@media only screen and (max-width: 1080px) {
|
||||||
|
@ -20,24 +20,16 @@ function bytesToSize(bytes, precision, si)
|
|||||||
var ret;
|
var ret;
|
||||||
si = typeof si !== 'undefined' ? si : 0;
|
si = typeof si !== 'undefined' ? si : 0;
|
||||||
if(si != 0) {
|
if(si != 0) {
|
||||||
var kilobyte = 1000;
|
var megabyte = 1000 * 1000;
|
||||||
var megabyte = kilobyte * 1000;
|
|
||||||
var gigabyte = megabyte * 1000;
|
var gigabyte = megabyte * 1000;
|
||||||
var terabyte = gigabyte * 1000;
|
var terabyte = gigabyte * 1000;
|
||||||
} else {
|
} else {
|
||||||
var kilobyte = 1024;
|
var megabyte = 1024 * 1024;
|
||||||
var megabyte = kilobyte * 1024;
|
|
||||||
var gigabyte = megabyte * 1024;
|
var gigabyte = megabyte * 1024;
|
||||||
var terabyte = gigabyte * 1024;
|
var terabyte = gigabyte * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((bytes >= 0) && (bytes < kilobyte)) {
|
if ((bytes >= megabyte) && (bytes < gigabyte)) {
|
||||||
return bytes + ' B';
|
|
||||||
|
|
||||||
} else if ((bytes >= kilobyte) && (bytes < megabyte)) {
|
|
||||||
ret = (bytes / kilobyte).toFixed(precision) + ' K';
|
|
||||||
|
|
||||||
} else if ((bytes >= megabyte) && (bytes < gigabyte)) {
|
|
||||||
ret = (bytes / megabyte).toFixed(precision) + ' M';
|
ret = (bytes / megabyte).toFixed(precision) + ' M';
|
||||||
|
|
||||||
} else if ((bytes >= gigabyte) && (bytes < terabyte)) {
|
} else if ((bytes >= gigabyte) && (bytes < terabyte)) {
|
||||||
@ -248,8 +240,18 @@ function uptime() {
|
|||||||
TableRow.children["hdd"].children[0].children[0].innerHTML = HDD + "%";
|
TableRow.children["hdd"].children[0].children[0].innerHTML = HDD + "%";
|
||||||
ExpandRow[0].children["expand_hdd"].innerHTML = "硬盘: " + bytesToSize(result.servers[i].hdd_used*1024*1024, 2) + " / " + bytesToSize(result.servers[i].hdd_total*1024*1024, 2);
|
ExpandRow[0].children["expand_hdd"].innerHTML = "硬盘: " + bytesToSize(result.servers[i].hdd_used*1024*1024, 2) + " / " + bytesToSize(result.servers[i].hdd_total*1024*1024, 2);
|
||||||
|
|
||||||
//IO
|
//IO, 过小的B字节单位没有意义
|
||||||
TableRow.children["io"].innerHTML = bytesToSize(result.servers[i].io_read, 2) + "💿" + bytesToSize(result.servers[i].io_write, 2);
|
var io = "";
|
||||||
|
if(result.servers[i].io_read < 1024*1024)
|
||||||
|
io += (result.servers[i].io_read/1024).toFixed(1) + "K";
|
||||||
|
else
|
||||||
|
io += (result.servers[i].io_read/1024/1024).toFixed(1) + "M";
|
||||||
|
io += "💿"
|
||||||
|
if(result.servers[i].io_write < 1024*1024)
|
||||||
|
io += (result.servers[i].io_write/1024).toFixed(1) + "K";
|
||||||
|
else
|
||||||
|
io += (result.servers[i].io_write/1024/1024).toFixed(1) + "M";
|
||||||
|
TableRow.children["network"].innerHTML = io;
|
||||||
|
|
||||||
// delay time
|
// delay time
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user