From 8a242cb229f2f104ec72ce00fda8ee4f6e68055b Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 3 Mar 2026 11:32:47 +0100 Subject: [PATCH] fix(cdn-cache): Use correct field name for bandwidth saved stats The RPCD returns 'bytes_saved' but the JS was looking for 'bandwidth_saved_bytes', causing the "BW Saved" stat to always show 0. Co-Authored-By: Claude Opus 4.5 --- .../htdocs/luci-static/resources/view/cdn-cache/overview.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/secubox/luci-app-cdn-cache/htdocs/luci-static/resources/view/cdn-cache/overview.js b/package/secubox/luci-app-cdn-cache/htdocs/luci-static/resources/view/cdn-cache/overview.js index 7cc45c46..f8e7fa46 100644 --- a/package/secubox/luci-app-cdn-cache/htdocs/luci-static/resources/view/cdn-cache/overview.js +++ b/package/secubox/luci-app-cdn-cache/htdocs/luci-static/resources/view/cdn-cache/overview.js @@ -90,7 +90,7 @@ return view.extend({ KissTheme.stat(stats.hit_ratio || 0, 'Hit Ratio %', 'var(--kiss-green)'), KissTheme.stat(formatBytes((cacheSize.used_kb || 0) * 1024), 'Cache Used'), KissTheme.stat((stats.requests || 0).toLocaleString(), 'Requests'), - KissTheme.stat(formatBytes(stats.bandwidth_saved_bytes || 0), 'BW Saved', 'var(--kiss-cyan)') + KissTheme.stat(formatBytes(stats.bytes_saved || 0), 'BW Saved', 'var(--kiss-cyan)') ]), // Details Grid @@ -131,7 +131,7 @@ return view.extend({ ]) ]), KissTheme.E('div', { 'style': 'text-align:center;padding:16px;background:rgba(0,200,83,0.05);border-radius:8px;margin-top:12px;' }, [ - KissTheme.E('div', { 'style': 'font-family:Orbitron,monospace;font-size:24px;color:var(--kiss-green);' }, formatBytes(stats.bandwidth_saved_bytes || 0)), + KissTheme.E('div', { 'style': 'font-family:Orbitron,monospace;font-size:24px;color:var(--kiss-green);' }, formatBytes(stats.bytes_saved || 0)), KissTheme.E('div', { 'style': 'font-size:11px;color:var(--kiss-muted);text-transform:uppercase;letter-spacing:1px;' }, 'Bandwidth Saved') ]) ]) @@ -188,7 +188,7 @@ return view.extend({ statValues[0].textContent = (stats.hit_ratio || 0); statValues[1].textContent = formatBytes((cacheSize.used_kb || 0) * 1024); statValues[2].textContent = (stats.requests || 0).toLocaleString(); - statValues[3].textContent = formatBytes(stats.bandwidth_saved_bytes || 0); + statValues[3].textContent = formatBytes(stats.bytes_saved || 0); } },