aboutsummaryrefslogtreecommitdiffstats
path: root/static/modules/stats.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/modules/stats.js')
-rw-r--r--static/modules/stats.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/static/modules/stats.js b/static/modules/stats.js
index b29b4ae..a119c6c 100644
--- a/static/modules/stats.js
+++ b/static/modules/stats.js
@@ -6,10 +6,18 @@ const uptime = (s) => {
const m = Math.floor((s % 3600) / 60);
return d ? `${d}d ${h}h` : `${h}h ${m}m`;
};
+const gib = (b) => (b / 1073741824).toFixed(1);
const gpu = (g) => {
if (!g) return "—";
if (g.asleep) return `${g.name} (asleep)`;
- return `${g.name} ${g.util}%${g.temp != null ? ` · ${g.temp}°C` : ""}`;
+ const parts = [g.name];
+ if (g.util != null) parts.push(`${g.util}%`);
+ if (g.temp != null) parts.push(`${g.temp}°C`);
+ if (g.fan != null) parts.push(`${g.fan} rpm`);
+ if (g.memUsed != null) {
+ parts.push(g.memTotal ? `${gib(g.memUsed)} / ${gib(g.memTotal)} GiB` : `${gib(g.memUsed)} GiB`);
+ }
+ return parts.join(" · ");
};
function row(label, value) {