From 7aa79f4a7dc9ddbc7fafd282041694cdf7ca3eb5 Mon Sep 17 00:00:00 2001 From: posimai Date: Sun, 12 Apr 2026 08:13:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20station=20VPS=20Users/Node=20=E3=83=8F?= =?UTF-8?q?=E3=82=A4=E3=83=95=E3=83=B3=E3=83=BBCPU=20=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=B0=200%=20=E8=A1=A8=E7=A4=BA=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- posimai-dev/station-b.html | 2 +- server.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/posimai-dev/station-b.html b/posimai-dev/station-b.html index 04493787..8ccaad67 100644 --- a/posimai-dev/station-b.html +++ b/posimai-dev/station-b.html @@ -391,7 +391,7 @@ function updateRing(fillId,valId,pct,circ,base,warn,crit){ fill.style.strokeDashoffset=circ*(1-Math.min(pct,100)/100); const color=pct>80?(crit||'#F87171'):pct>60?(warn||'#FB923C'):(base||'#22D3EE'); fill.style.stroke=color; - valEl.textContent=pct>0?`${pct}%`:'—'; + valEl.textContent=`${pct}%`; valEl.style.fill=pct>80?'#F87171':pct>60?'#FB923C':'var(--text)'; } diff --git a/server.js b/server.js index 2fbff61f..f837a41b 100644 --- a/server.js +++ b/server.js @@ -762,6 +762,11 @@ function buildRouter() { const p = df.trim().split('\n')[1].split(/\s+/); disk = { total_gb: Math.round(parseInt(p[1])/1e9*10)/10, used_gb: Math.round(parseInt(p[2])/1e9*10)/10, use_pct: Math.round(parseInt(p[2])/parseInt(p[1])*100) }; } catch(_) {} + let users = 0; + try { + const whoOut = execSync('who 2>/dev/null', { timeout: 1000 }).toString().trim(); + users = whoOut ? whoOut.split('\n').filter(l => l.trim()).length : 0; + } catch(_) {} res.json({ ...base, gemini: !!genAI, @@ -770,6 +775,8 @@ function buildRouter() { mem_used_mb: Math.round((total - mem) / 1024 / 1024), mem_total_mb: Math.round(total / 1024 / 1024), disk, + users, + node_version: process.version, }); });