mirror of https://github.com/cppla/ServerStatus
update disk io style
parent
47cf7a1818
commit
654ecd7a3e
|
@ -307,7 +307,7 @@ def get_realtime_data():
|
||||||
target=_net_speed,
|
target=_net_speed,
|
||||||
)
|
)
|
||||||
t5 = threading.Thread(
|
t5 = threading.Thread(
|
||||||
target=_disk_io(),
|
target=_disk_io,
|
||||||
)
|
)
|
||||||
for ti in [t1, t2, t3, t4, t5]:
|
for ti in [t1, t2, t3, t4, t5]:
|
||||||
ti.setDaemon(True)
|
ti.setDaemon(True)
|
||||||
|
|
|
@ -277,7 +277,7 @@ def get_realtime_data():
|
||||||
target=_net_speed,
|
target=_net_speed,
|
||||||
)
|
)
|
||||||
t5 = threading.Thread(
|
t5 = threading.Thread(
|
||||||
target=_disk_io(),
|
target=_disk_io,
|
||||||
)
|
)
|
||||||
for ti in [t1, t2, t3, t4, t5]:
|
for ti in [t1, t2, t3, t4, t5]:
|
||||||
ti.setDaemon(True)
|
ti.setDaemon(True)
|
||||||
|
|
|
@ -20,6 +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; }
|
||||||
#ping { max-width: 95px; }
|
#ping { max-width: 95px; }
|
||||||
|
|
||||||
@media only screen and (max-width: 1080px) {
|
@media only screen and (max-width: 1080px) {
|
||||||
|
|
|
@ -17,6 +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; }
|
||||||
#ping { max-width: 95px; }
|
#ping { max-width: 95px; }
|
||||||
|
|
||||||
@media only screen and (max-width: 1080px) {
|
@media only screen and (max-width: 1080px) {
|
||||||
|
|
|
@ -20,16 +20,24 @@ 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 megabyte = 1000 * 1000;
|
var kilobyte = 1000;
|
||||||
|
var megabyte = kilobyte * 1000;
|
||||||
var gigabyte = megabyte * 1000;
|
var gigabyte = megabyte * 1000;
|
||||||
var terabyte = gigabyte * 1000;
|
var terabyte = gigabyte * 1000;
|
||||||
} else {
|
} else {
|
||||||
var megabyte = 1024 * 1024;
|
var kilobyte = 1024;
|
||||||
|
var megabyte = kilobyte * 1024;
|
||||||
var gigabyte = megabyte * 1024;
|
var gigabyte = megabyte * 1024;
|
||||||
var terabyte = gigabyte * 1024;
|
var terabyte = gigabyte * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((bytes >= megabyte) && (bytes < gigabyte)) {
|
if ((bytes >= 0) && (bytes < kilobyte)) {
|
||||||
|
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)) {
|
||||||
|
|
Loading…
Reference in New Issue