From 0123ff005c257afe0c1ecc1de2ee6f11433d1cd1 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 7 Jan 2026 11:39:53 +0100 Subject: [PATCH] fix: Hub components showing incorrect counts in metrics view (v0.6.0-r11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed installed detection from checking i.installed property - Now checks i.status === 'enabled' or i.local_version exists - Fixes Hub Components showing 0 when collections are installed - Fixes Installed Collections list showing empty 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../resources/view/crowdsec-dashboard/metrics.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/metrics.js b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/metrics.js index 5e921e39..76c57e91 100644 --- a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/metrics.js +++ b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/metrics.js @@ -162,7 +162,10 @@ return view.extend({ var countInstalled = function(items) { if (!Array.isArray(items)) return 0; - return items.filter(function(i) { return i.installed; }).length; + // Check for status === 'enabled' or if local_version exists (means installed) + return items.filter(function(i) { + return i.status === 'enabled' || i.local_version; + }).length; }; return E('div', { 'class': 'cs-stats-grid' }, [ @@ -198,7 +201,9 @@ return view.extend({ ]); } - var installed = collections.filter(function(c) { return c.installed; }); + var installed = collections.filter(function(c) { + return c.status === 'enabled' || c.local_version; + }); var items = installed.slice(0, 15).map(function(c) { return E('div', { 'class': 'cs-metric-item' }, [