From 9c9e5743a5e3d0f91874fa76779b65c0117bcbfb Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Wed, 25 Dec 2024 01:50:08 +0800 Subject: [PATCH] Add Security Checklist --- frontend/components/advanced-tools/SecurityChecklist.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/components/advanced-tools/SecurityChecklist.vue b/frontend/components/advanced-tools/SecurityChecklist.vue index a930e297..3d5dce31 100644 --- a/frontend/components/advanced-tools/SecurityChecklist.vue +++ b/frontend/components/advanced-tools/SecurityChecklist.vue @@ -113,10 +113,9 @@ countItems({ action: 'checked', category: item }) }}/{{ countItems({ action: 'total', category: item }) - countItems({ action: 'ignored', category: item }) }}) - + v-if=" countItems({ action: 'percentage', category: item }) === 100 "> @@ -461,7 +460,8 @@ const countItems = ({ action, category, priority }) => { const total = items.length; const ignored = items.filter(item => item.ignored).length; const checked = items.filter(item => item.checked).length; - return (total - ignored) === 0 ? '100' : ((checked / (total - ignored)) * 100).toFixed(0); + const denominator = total - ignored; + return denominator === 0 ? 100 : Math.round((checked / denominator) * 100); }, };