From 4e9c11ae574ec029e6c5f04940474617eb563cb4 Mon Sep 17 00:00:00 2001 From: Filippo Carletti Date: Tue, 17 Mar 2026 14:18:54 +0100 Subject: [PATCH 1/3] fix(dashboard): get total memory from meminfo --- src/components/standalone/dashboard/SystemInfoCard.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/standalone/dashboard/SystemInfoCard.vue b/src/components/standalone/dashboard/SystemInfoCard.vue index be5510c64..e9abcb1c1 100644 --- a/src/components/standalone/dashboard/SystemInfoCard.vue +++ b/src/components/standalone/dashboard/SystemInfoCard.vue @@ -93,9 +93,9 @@ async function getSystemInfo() { const res = await ubusCall('ns.dashboard', 'system-info') systemInfo.value = res.data.result - freeMemory.value = systemInfo.value.memory.available_bytes - const usedMemory = systemInfo.value.memory.used_bytes - totalMemory.value = usedMemory + freeMemory.value + totalMemory.value = systemInfo.value.memory.MemTotal + freeMemory.value = systemInfo.value.memory.MemAvailable + const usedMemory = totalMemory.value - freeMemory.value memoryUsagePerc.value = round((usedMemory / totalMemory.value) * 100) freeRoot.value = systemInfo.value.storage['/'].available_bytes From 27292a338ce6f4b4383f11e344dec2522c75943b Mon Sep 17 00:00:00 2001 From: Andrea Leardini Date: Wed, 18 Mar 2026 09:46:39 +0100 Subject: [PATCH 2/3] fix(dashboard): change variable names See: NethServer/nethsecurity#1569 --- src/components/standalone/dashboard/SystemInfoCard.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/standalone/dashboard/SystemInfoCard.vue b/src/components/standalone/dashboard/SystemInfoCard.vue index e9abcb1c1..51fdfa7f8 100644 --- a/src/components/standalone/dashboard/SystemInfoCard.vue +++ b/src/components/standalone/dashboard/SystemInfoCard.vue @@ -93,8 +93,8 @@ async function getSystemInfo() { const res = await ubusCall('ns.dashboard', 'system-info') systemInfo.value = res.data.result - totalMemory.value = systemInfo.value.memory.MemTotal - freeMemory.value = systemInfo.value.memory.MemAvailable + totalMemory.value = systemInfo.value.memory.mem_total + freeMemory.value = systemInfo.value.memory.mem_available const usedMemory = totalMemory.value - freeMemory.value memoryUsagePerc.value = round((usedMemory / totalMemory.value) * 100) From 59dc5396027500a16f06af09d424d7fe0ce5ce97 Mon Sep 17 00:00:00 2001 From: Tommaso Bailetti Date: Wed, 18 Mar 2026 11:10:12 +0100 Subject: [PATCH 3/3] handling both format --- .../standalone/dashboard/SystemInfoCard.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/standalone/dashboard/SystemInfoCard.vue b/src/components/standalone/dashboard/SystemInfoCard.vue index 51fdfa7f8..c94965d67 100644 --- a/src/components/standalone/dashboard/SystemInfoCard.vue +++ b/src/components/standalone/dashboard/SystemInfoCard.vue @@ -93,8 +93,21 @@ async function getSystemInfo() { const res = await ubusCall('ns.dashboard', 'system-info') systemInfo.value = res.data.result - totalMemory.value = systemInfo.value.memory.mem_total - freeMemory.value = systemInfo.value.memory.mem_available + // Support both old format (available_bytes, used_bytes) and new format (mem_total, mem_available) + // Introduced by https://github.com/NethServer/nethsecurity/pull/1569, can be removed after the next release since controllers should be updated + if ( + systemInfo.value.memory.mem_total != undefined && + systemInfo.value.memory.mem_available != undefined + ) { + // New format + totalMemory.value = systemInfo.value.memory.mem_total + freeMemory.value = systemInfo.value.memory.mem_available + } else { + // Old format + freeMemory.value = systemInfo.value.memory.available_bytes + const usedMemory = systemInfo.value.memory.used_bytes + totalMemory.value = usedMemory + freeMemory.value + } const usedMemory = totalMemory.value - freeMemory.value memoryUsagePerc.value = round((usedMemory / totalMemory.value) * 100)