From 51310bfdac0caf47be2ba7291eb74ddefd06ffc1 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 27 Jan 2024 13:13:22 -0500 Subject: [PATCH 1/2] feat(violations): add current fail, warn, info metrics to footer Signed-off-by: Adam Setch --- src/views/Dashboard.vue | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index dea4eba64..299fe4741 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -50,6 +50,55 @@ +
+ + +
+ {{ $t("policy_violation.fails") }} +
+ {{ failViolations }} ({{ failViolationsPercent }}%) + +
+ +
+ {{ $t("policy_violation.warns") }} +
+ {{ warnViolations }} ({{ warnViolationsPercent }}%) + +
+ +
+ {{ $t("policy_violation.infos") }} +
+ {{ infoViolations }} ({{ infoViolationsPercent }}%) + +
+
+
@@ -177,6 +226,12 @@ totalViolations: 0, auditedViolations: 0, auditedViolationsPercent: 0, + failViolations: 0, + failViolationsPercent: 0, + warnViolations: 0, + warnViolationsPercent: 0, + infoViolations: 0, + infoViolationsPercent: 0, vulnerabilities: 0, suppressed: 0, @@ -204,6 +259,12 @@ this.totalViolations = common.valueWithDefault(metric.policyViolationsTotal, "0"); this.auditedViolations = common.valueWithDefault(metric.policyViolationsAudited, "0"); this.auditedViolationsPercent = common.calcProgressPercent(this.totalViolations, this.auditedViolations); + this.failViolations = common.valueWithDefault(metric.policyViolationsFail, "0"); + this.failViolationsPercent = common.calcProgressPercent(this.totalViolations, this.failViolations); + this.warnViolations = common.valueWithDefault(metric.policyViolationsWarn, "0"); + this.warnViolationsPercent = common.calcProgressPercent(this.totalViolations, this.warnViolations); + this.infoViolations = common.valueWithDefault(metric.policyViolationsInfo, "0"); + this.infoViolationsPercent = common.calcProgressPercent(this.totalViolations, this.infoViolations); this.vulnerabilities = common.valueWithDefault(metric.vulnerabilities, "0"); this.suppressed = common.valueWithDefault(metric.suppressed, "0"); From 88f19970a1ce34f6e5216893f7d5c4732dd3205c Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 27 Jan 2024 13:26:23 -0500 Subject: [PATCH 2/2] feat(violations): add current fail, warn, info metrics to footer Signed-off-by: Adam Setch --- src/views/Dashboard.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 299fe4741..8bdb5ed5b 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -63,7 +63,7 @@ height="{}" class="progress-xs mt-2" :precision="1" - variant="info" + variant="danger" v-bind:value="failViolationsPercent" > @@ -93,7 +93,7 @@ height="{}" class="progress-xs mt-2" :precision="1" - variant="danger" + variant="info" v-bind:value="infoViolationsPercent" >