Skip to content

Commit 03a6f04

Browse files
NickChungSUSExingzhang-suse
authored andcommitted
feat: add Dashboard with mockdata
1 parent c26c0ac commit 03a6f04

File tree

6 files changed

+1057
-1
lines changed

6 files changed

+1057
-1
lines changed

pkg/sbombastic-image-vulnerability-scanner/components/TopSevereVulnerabilitiesChart.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<SevereVulnerabilitiesItem
88
v-for="vulnerability in topSevereVulnerabilities"
99
:vulnerability="vulnerability"
10+
:eventHandler="eventHandler"
1011
/>
1112
</div>
1213
</div>
@@ -25,6 +26,10 @@
2526
type: Array,
2627
required: true
2728
},
29+
eventHandler: {
30+
type: Function,
31+
default: null
32+
}
2833
},
2934
data() {}
3035
}

pkg/sbombastic-image-vulnerability-scanner/components/common/SevereVulnerabilitiesItem.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<BlockPercentageBar
1111
class="percentage-bar"
1212
:percentage="(vulnerability.spec.impactedImages / vulnerability.spec.totalImages) * 100"
13+
:eventHandler="eventHandler"
1314
/>
1415
</div>
1516
</div>
@@ -31,6 +32,10 @@
3132
type: Object,
3233
required: true
3334
},
35+
eventHandler: {
36+
type: Function,
37+
default: null
38+
}
3439
},
3540
data() {
3641
return { };

pkg/sbombastic-image-vulnerability-scanner/config/sbombastic-image-vulnerability-scanner.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ export function init($plugin: IPlugin, store: any) {
3939
}
4040
});
4141

42+
virtualType({
43+
labelKey: "imageScanner.dashboard.title",
44+
name: PAGE.DASHBOARD,
45+
namespaced: false,
46+
route: {
47+
name: `c-cluster-${PRODUCT_NAME}-${PAGE.DASHBOARD}`,
48+
params: {
49+
product: PRODUCT_NAME,
50+
},
51+
meta: { pkg: PRODUCT_NAME, product: PRODUCT_NAME },
52+
},
53+
});
54+
4255
virtualType({
4356
labelKey: "imageScanner.vulnerabilities.title",
4457
name: PAGE.VULNERABILITY_OVERVIEW,
@@ -52,6 +65,19 @@ export function init($plugin: IPlugin, store: any) {
5265
},
5366
});
5467

68+
virtualType({
69+
labelKey: "imageScanner.vexManagement.title",
70+
name: PAGE.VEX_MANAGEMENT,
71+
namespaced: false,
72+
route: {
73+
name: `c-cluster-${PRODUCT_NAME}-${PAGE.VEX_MANAGEMENT}`,
74+
params: {
75+
product: PRODUCT_NAME,
76+
},
77+
meta: { pkg: PRODUCT_NAME, product: PRODUCT_NAME },
78+
},
79+
});
80+
5581
virtualType({
5682
label: "Components Demo",
5783
name: "demo",
@@ -66,11 +92,12 @@ export function init($plugin: IPlugin, store: any) {
6692
});
6793

6894
basicType([
95+
PAGE.DASHBOARD,
6996
PAGE.IMAGE_OVERVIEW,
7097
PAGE.VULNERABILITY_OVERVIEW,
7198
//"demo"
7299
]);
73100
// Prepend spaces on group name, as Rancher 2.12 render group name algin with sidemenu
74-
basicType([PAGE.REGISTRIES, RESOURCE.VEX_HUB], '&nbsp;&nbsp;&nbsp;&nbsp;Advanced');
101+
basicType([PAGE.REGISTRIES, PAGE.VEX_MANAGEMENT, RESOURCE.VEX_HUB], '&nbsp;&nbsp;&nbsp;&nbsp;Advanced');
75102

76103
}

pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
product:
22
imageScanner: Image Vulnerability Scanner
33
imageScanner:
4+
dashboard:
5+
title: Dashboard
6+
description: Main highlights and overview of image vulnerability scanning status
7+
lastUpdated: Last updated
8+
button:
9+
refresh: Refresh
10+
registryDropdown:
11+
placeholder: All registries
12+
vulnerabilityStats:
13+
title: Affecting vulnerabilities distribution
14+
critical: Critical
15+
high: High
16+
medium: Medium
17+
low: Low
18+
total: Total vulnerabilities
19+
scanningStatus:
20+
title: Scanning stats
21+
lastScan: Last scan
22+
totalImages: Total images
23+
failedScans: Failed scans
24+
errors: Errors
25+
topVulnerabilities:
26+
title: Most severe, affecting vulnerabilities
27+
viewAll: View all
28+
affectedImages: affected images
29+
mostAffectedImages:
30+
title: Most affected images at risk
31+
viewAll: View all
32+
totalVulns: total vulnerabilities
433
registries:
534
title: Registries configuration
635
button:

0 commit comments

Comments
 (0)