Skip to content

Commit

Permalink
Merge pull request #709 from setchy/refactor/portfolio-statistics
Browse files Browse the repository at this point in the history
feat(dashboard): display additional portfolio statistics
  • Loading branch information
nscuro authored Jan 30, 2024
2 parents bd4467a + 5ff3870 commit e18c7ee
Showing 1 changed file with 59 additions and 3 deletions.
62 changes: 59 additions & 3 deletions src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,42 @@
<b-col md="12">
<b-card v-bind:header="$t('message.portfolio_statistics')">
<b-row>
<b-col sm="12" lg="6">
<b-col sm="12" lg="4">
<b-row>
<b-col sm="6">
<Callout variant="info">
<small class="text-muted">{{ $t('message.projects') }}</small><br>
<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="6">
<b-col sm="12" lg="4">
<b-row>
<b-col sm="6">
<Callout variant="info">
<Callout variant="danger">
<small class="text-muted">{{ $t('message.portfolio_vulnerabilities') }}</small><br>
<strong class="h4">{{vulnerabilities}}</strong>
</Callout>
Expand All @@ -149,6 +165,40 @@
</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('policy_violation.operational') }}</small><br>
<strong class="h4">{{operationalViolations}}</strong>
</Callout>
</b-col>
<b-col sm="6">
<Callout variant="info">
<small class="text-muted">{{ $t('policy_violation.security') }}</small><br>
<strong class="h4">{{securityViolations}}</strong>
</Callout>
</b-col>
</b-row>
</b-col>
</b-row>
</b-card>
</b-col>
</b-row>
Expand Down Expand Up @@ -202,6 +252,9 @@
warnViolationsPercent: 0,
infoViolations: 0,
infoViolationsPercent: 0,
licenseViolations: 0,
operationalViolations: 0,
securityViolations: 0,
vulnerabilities: 0,
suppressed: 0,
Expand Down Expand Up @@ -235,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 e18c7ee

Please sign in to comment.