File tree Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 2626}
2727// Fixes the width for the bootstrap progress bar in tables
2828.table-progress {
29- width : 100% ;
29+ width : 100% !important ;
3030}
3131.severity-critical-bg , .bg-severity-critical , .bg-CRITICAL {
3232 background : $severity-critical none ;
4343.severity-info-bg , .bg-severity-info , .bg-INFO {
4444 background : $severity-info none ;
4545}
46+ .severity-warn-bg {
47+ background : $severity-medium none ;
48+ }
49+ .severity-fail-bg {
50+ background : $severity-critical none ;
51+ }
4652.bg-violation-type {
4753 background : $widget-3 ;
4854}
Original file line number Diff line number Diff line change 1+ <template >
2+ <span v-if =" total === 0" class =" progress" >
3+ <b-progress class =" table-progress" :max =" '0'" show-value >
4+ <b-progress-bar class =" table-progress" value =" 0" ></b-progress-bar >
5+ </b-progress >
6+ </span >
7+ <span v-else class =" progress" >
8+ <b-progress class =" table-progress" :max =" total" show-value >
9+ <b-progress-bar :value =" info" class =" severity-info-bg" ></b-progress-bar >
10+ <b-progress-bar :value =" warn" class =" severity-warn-bg" ></b-progress-bar >
11+ <b-progress-bar :value =" fail" class =" severity-fail-bg" ></b-progress-bar >
12+ </b-progress >
13+ </span >
14+ </template >
15+
16+ <script >
17+ export default {
18+ props: {
19+ total: Number ,
20+ info: Number ,
21+ warn: Number ,
22+ fail: Number ,
23+ }
24+ }
25+ </script >
Original file line number Diff line number Diff line change 2424 import PortfolioWidgetRow from " ../../dashboard/PortfolioWidgetRow" ;
2525 import ProjectCreateProjectModal from " ./ProjectCreateProjectModal" ;
2626 import SeverityProgressBar from " ../../components/SeverityProgressBar" ;
27+ import PolicyViolationProgressBar from " ../../components/PolicyViolationProgressBar" ;
2728 import xssFilters from " xss-filters" ;
2829 import permissionsMixin from " ../../../mixins/permissionsMixin" ;
2930
119120 },
120121 {
121122 title: this .$t (' message.policy_violations' ),
122- field: " metrics.policyViolationsTotal"
123+ field: " metrics" ,
124+ formatter (metrics , row , index ) {
125+ if (typeof metrics === " undefined" ) {
126+ return " -" ; // No vulnerability info available
127+ }
128+ console .log (metrics);
129+
130+ let ComponentClass = Vue .extend (PolicyViolationProgressBar);
131+ let progressBar = new ComponentClass ({
132+ propsData: {
133+ total: metrics .policyViolationsTotal ,
134+ warn: metrics .policyViolationsWarn ,
135+ fail: metrics .policyViolationsFail ,
136+ info: metrics .policyViolationsInfo
137+ }
138+ });
139+ progressBar .$mount ();
140+ return progressBar .$el .outerHTML ;
141+ }
123142 },
124143 {
125144 title: this .$t (' message.vulnerabilities' ),
You can’t perform that action at this time.
0 commit comments