From e0aae47efc67fa188994621e94a3220d9ca54581 Mon Sep 17 00:00:00 2001 From: cppla Date: Wed, 1 Jul 2026 19:17:07 +0800 Subject: [PATCH] update css --- README.md | 21 ++++++++------------- web/css/app.css | 2 +- web/js/app.js | 4 ++-- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 8b8fef4..81e870c 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,6 @@ ServerStatus 是一个轻量的服务器探针和云监控面板,支持多节 `Watchdog 的 `interval` 是最小通知间隔,用于避免频繁报警,并不是探测间隔。`rule` 使用 Exprtk 表达式,当前窄字符解析对中文等 Unicode 字符不友好,规则中建议使用英文、数字和字段名。` -## 功能 - -- 主机监控:在线状态、CPU、内存、虚存、硬盘、IO、负载、进程、连接、流量。 -- 网络质量:联通、电信、移动三网延迟和丢包。 -- 服务监测:通过客户端上报自定义监测结果。 -- SSL 证书:检查证书剩余天数、域名不匹配和过期风险。 -- Watchdog:基于表达式规则触发告警回调。 -- WebUI:主机、服务、证书、配置四个页面;配置页可增删改节点、监测、证书和 Watchdog 规则。 -- HTTP 管理 API:方便 WebUI 或 AI Agent 读写配置、重载和重启服务。 - ## 一、服务端 @@ -69,6 +59,11 @@ docker run -d --restart=always --name=serverstatus-client \ cppla/serverstatus:client ``` +```bash +# Shell Run +wget --no-check-certificate -qO client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py' && (nohup python3 client-linux.py SERVER=127.0.0.1 USER=s01 >/dev/null 2>&1 &) +``` + 客户端环境变量和注意事项: `USER` 是常见的宿主机环境变量名。如果没有显式传递,Compose 可能会把系统里的 `$USER` 解析成本机用户名。推荐优先级:1. 运行命令显式传递 `USER=...`,2. 用户修改 `docker-compose-client.yml` 里的 `USER` 默认值 @@ -317,16 +312,16 @@ apt -y install python3-psutil yum -y install python3-pip gcc python3-devel pip3 install psutil -python3 clients/client-psutil.py SERVER=127.0.0.1 USER=s01 PASSWORD=USER_DEFAULT_PASSWORD +python3 clients/client-psutil.py SERVER=127.0.0.1 USER=s01 ``` 后台运行与开机启动: ```bash -nohup python3 client-linux.py SERVER=127.0.0.1 USER=s01 PASSWORD=USER_DEFAULT_PASSWORD & +nohup python3 client-linux.py SERVER=127.0.0.1 USER=s01 & # crontab -e -@reboot /usr/bin/python3 /path/to/client-linux.py SERVER=127.0.0.1 USER=s01 PASSWORD=USER_DEFAULT_PASSWORD +@reboot /usr/bin/python3 /path/to/client-linux.py SERVER=127.0.0.1 USER=s01 ``` ## 本地构建镜像 diff --git a/web/css/app.css b/web/css/app.css index 4c06c04..c157d60 100644 --- a/web/css/app.css +++ b/web/css/app.css @@ -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 */ diff --git a/web/js/app.js b/web/js/app.js index 7715ecf..5c39780 100644 --- a/web/js/app.js +++ b/web/js/app.js @@ -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 `${humanMinMBFromB(m.monthIn)}${humanMinMBFromB(m.monthOut)}`; } function gaugeHTML(type, value){