mirror of
https://github.com//cppla/ServerStatus
synced 2026-08-06 12:23:57 +08:00
+1
-1
@@ -67,7 +67,7 @@ table.data th,table.data td{font-variant-numeric:tabular-nums}
|
||||
.caps-traffic.duo .half{flex:0 0 auto;display:flex;align-items:center;justify-content:center;padding:2px 4px;font-variant-numeric:tabular-nums;font-weight:600;line-height:1.25; /* 与 .pill 保持一致高度 */ letter-spacing:.25px;color:#fff;font-size:12px;white-space:nowrap;}
|
||||
/* 双色胶囊配色:
|
||||
normal (默认): 左绿右蓝
|
||||
heavy (>=500GB 总量): 黄色提醒,不再使用故障红
|
||||
heavy (>=1000GB 总量): 黄色提醒,不再使用故障红
|
||||
*/
|
||||
/* normal 初始:淡绿色(入) + 淡蓝色(出) */
|
||||
.caps-traffic.duo.normal .half.in{background:#d1fae5;color:#065f46;} /* emerald-100 / text-emerald-800 */
|
||||
|
||||
+2
-2
@@ -116,7 +116,7 @@ function metrics(s){
|
||||
const blocked = online && losses.every(p => p >= 100);
|
||||
const resourceCritical = online && (num(s.cpu) >= 90 || memPct >= 90 || hddPct >= 90);
|
||||
const resourceWarning = online && (num(s.cpu) >= 75 || memPct >= 80 || hddPct >= 85);
|
||||
const trafficWarning = online && traffic >= 500 * 1000 * 1000 * 1000;
|
||||
const trafficWarning = online && traffic >= 1000 * 1000 * 1000 * 1000;
|
||||
const lossCritical = online && loss >= 40;
|
||||
const lossWarning = online && !lossCritical && loss >= 30;
|
||||
const critical = online && (resourceCritical || blocked || lossCritical);
|
||||
@@ -263,7 +263,7 @@ function protoPill(s){
|
||||
}
|
||||
function trafficCaps(s, small){
|
||||
const m = metrics(s);
|
||||
const heavy = m.traffic >= 500 * 1000 * 1000 * 1000;
|
||||
const heavy = m.traffic >= 1000 * 1000 * 1000 * 1000;
|
||||
return `<span class="caps-traffic duo ${heavy ? 'heavy' : 'normal'}${small ? ' sm' : ''}" title="本月下行 | 上行"><span class="half in">${humanMinMBFromB(m.monthIn)}</span><span class="half out">${humanMinMBFromB(m.monthOut)}</span></span>`;
|
||||
}
|
||||
function gaugeHTML(type, value){
|
||||
|
||||
Reference in New Issue
Block a user