From 6126ca272582eaadb8c999b410f4edf12814d1b1 Mon Sep 17 00:00:00 2001 From: kzolotarev95 Date: Sat, 4 Jul 2026 22:13:27 +0400 Subject: [PATCH] Fix RAM usage display in router cards --- vps/owrt-remote-hub.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vps/owrt-remote-hub.py b/vps/owrt-remote-hub.py index 22789bf..7940fae 100644 --- a/vps/owrt-remote-hub.py +++ b/vps/owrt-remote-hub.py @@ -1766,8 +1766,10 @@ function formatMemory(value) {{ const text = String(value || ''); const match = text.match(/(\\d+)\\s*\\/\\s*(\\d+)\\s*kB/i); if (!match) return value || 'unknown'; - const used = Math.round(Number(match[1]) / 1024); - const total = Math.round(Number(match[2]) / 1024); + const freeKb = Number(match[1]); + const totalKb = Number(match[2]); + const used = Math.max(0, Math.round((totalKb - freeKb) / 1024)); + const total = Math.max(0, Math.round(totalKb / 1024)); return used + ' / ' + total + ' МБ'; }}