Skip to content

Commit

Permalink
refactor(statistics): update portfolio statistics
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <[email protected]>
  • Loading branch information
setchy committed Jan 28, 2024
1 parent 38711e6 commit 272c65d
Showing 1 changed file with 46 additions and 6 deletions.
52 changes: 46 additions & 6 deletions src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,28 @@
<strong class="h4">{{totalProjects}}</strong>
</Callout>
</b-col>
<b-col sm="6">
<Callout variant="danger">
<small class="text-muted">{{ $t('message.vulnerable_projects') }}</small><br>
<strong class="h4">{{vulnerableProjects}}</strong>
</Callout>
</b-col>
</b-row>
</b-col>
<b-col sm="12" lg="4">
<b-row>
<b-col sm="6">
<Callout variant="info">
<small class="text-muted">{{ $t('message.components') }}</small><br>
<strong class="h4">{{totalComponents}}</strong>
</Callout>
</b-col>
<b-col sm="6">
<Callout variant="danger">
<small class="text-muted">{{ $t('message.vulnerable_components') }}</small><br>
<strong class="h4">{{vulnerableComponents}}</strong>
</Callout>
</b-col>
</b-row>
</b-col>
<b-col sm="12" lg="4">
Expand All @@ -141,25 +157,43 @@
</Callout>
</b-col>
<b-col sm="6">
<Callout variant="danger">
<Callout variant="warning">
<small class="text-muted">{{ $t('message.suppressed') }}</small><br>
<strong class="h4">{{suppressed}}</strong>
</Callout>
</b-col>
</b-row>
</b-col>
</b-row>
<b-row>
<b-col sm="12" lg="4">
<b-row>
<b-col sm="6">
<Callout variant="info">
<small class="text-muted">{{ $t('message.policy_violations') }}</small><br>
<strong class="h4">{{totalViolations}}</strong>
</Callout>
</b-col>
<b-col sm="6">
<Callout variant="info">
<small class="text-muted">{{ $t('policy_violation.license') }}</small><br>
<strong class="h4">{{licenseViolations}}</strong>
</Callout>
</b-col>
</b-row>
</b-col>
<b-col sm="12" lg="4">
<b-row>
<b-col sm="6">
<Callout variant="info">
<small class="text-muted">{{ $t('message.findings') }}</small><br>
<strong class="h4">{{totalFindings}}</strong>
<small class="text-muted">{{ $t('policy_violation.operational') }}</small><br>
<strong class="h4">{{operationalViolations}}</strong>
</Callout>
</b-col>
<b-col sm="6">
<Callout variant="warning">
<small class="text-muted">{{ $t('message.suppressed') }}</small><br>
<strong class="h4">{{suppressed}}</strong>
<Callout variant="info">
<small class="text-muted">{{ $t('policy_violation.security') }}</small><br>
<strong class="h4">{{securityViolations}}</strong>
</Callout>
</b-col>
</b-row>
Expand Down Expand Up @@ -218,6 +252,9 @@
warnViolationsPercent: 0,
infoViolations: 0,
infoViolationsPercent: 0,
licenseViolations: 0,
operationalViolations: 0,
securityViolations: 0,
vulnerabilities: 0,
suppressed: 0,
Expand Down Expand Up @@ -251,6 +288,9 @@
this.warnViolationsPercent = common.calcProgressPercent(this.totalViolations, this.warnViolations);
this.infoViolations = common.valueWithDefault(metric.policyViolationsInfo, "0");
this.infoViolationsPercent = common.calcProgressPercent(this.totalViolations, this.infoViolations);
this.licenseViolations = common.valueWithDefault(metric.policyViolationsLicenseTotal,"0");
this.operationalViolations = common.valueWithDefault(metric.policyViolationsOperationalTotal,"0");
this.securityViolations = common.valueWithDefault(metric.policyViolationsSecurityTotal,"0");
this.vulnerabilities = common.valueWithDefault(metric.vulnerabilities, "0");
this.suppressed = common.valueWithDefault(metric.suppressed, "0");
Expand Down

0 comments on commit 272c65d

Please sign in to comment.