Skip to content

Commit 0700184

Browse files
xingzhang-suselsongsuse
authored andcommitted
Fixed some style and routing issues
1 parent 30c4a08 commit 0700184

File tree

11 files changed

+69
-39
lines changed

11 files changed

+69
-39
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default {
112112
<div class="about">
113113
<div class="header-section">
114114
<div class="title">
115-
<RouterLink :to="`/c/${this.$route.params.cluster}/${this.PRODUCT_NAME}/${this.PAGE.VULNERABILITY_OVERVIEW}`">{{ t('imageScanner.vulnerabilities.title') }}:</RouterLink>
115+
<RouterLink :to="`/c/${this.$route.params.cluster}/${this.PRODUCT_NAME}/${this.PAGE.VULNERABILITIES}`">{{ t('imageScanner.vulnerabilities.title') }}:</RouterLink>
116116
{{ $route.params.id }}
117117
<BadgeState
118118
:color="getSeverityColor(cveDetail.severity)"

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<!-- Header Section -->
44
<div class="header-section">
55
<div class="title">
6-
Image: {{ imageName }}
6+
<span class="resource-header-name">
7+
<RouterLink :to="`/c/${this.$route.params.cluster}/${ this.PRODUCT_NAME }/${this.PAGE.IMAGES}`">{{ t('imageScanner.images.title') }}:</RouterLink>
8+
{{ $route.params.id }}
9+
</span>
710
<BadgeState
811
:color="getSeverityColor(overallSeverity)"
912
:label="t(`imageScanner.enum.cve.${overallSeverity}`)"
@@ -245,6 +248,7 @@ import ScoreBadge from '@pkg/components/common/ScoreBadge';
245248
import BarChart from '@pkg/components/common/BarChart';
246249
import { VULNERABILITY_DETAILS_TABLE } from "@pkg/config/table-headers";
247250
import { images } from "@pkg/data/sbombastic.rancher.io.image";
251+
import { PRODUCT_NAME, RESOURCE, PAGE } from '@pkg/types';
248252
249253
export default {
250254
name: 'ImageDetails',
@@ -274,6 +278,9 @@ export default {
274278
groupByLayer: false,
275279
},
276280
VULNERABILITY_DETAILS_TABLE,
281+
PRODUCT_NAME,
282+
RESOURCE,
283+
PAGE,
277284
}
278285
},
279286
@@ -554,6 +561,13 @@ export default {
554561
font-size: 24px;
555562
font-weight: 600;
556563
color: #141419;
564+
.resource-header-name {
565+
font-family: Lato;
566+
font-size: 24px;
567+
font-style: normal;
568+
font-weight: 600;
569+
line-height: 32px; /* 133.333% */
570+
}
557571
}
558572
559573
.severity-badge {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
padding: 16px;
4444
flex-direction: column;
4545
align-items: flex-start;
46-
gap: 12px;
46+
gap: 8px;
4747
flex: 1 0 0;
4848
border-right: 1px solid #DCDEE7;
4949
.title {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
font-size: 13px;
7474
font-style: normal;
7575
font-weight: 500;
76-
line-height: 20px; /* 153.846% */
76+
line-height: 24px; /* 153.846% */
7777
&.na {
7878
color: #717179;
7979
}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="vulnerability-record">
33
<div class="cve">
4-
{{ vulnerability.metadata.name }}
4+
<RouterLink :to="`/c/${this.$route.params.cluster}/${ this.PRODUCT_NAME }/${this.PAGE.VULNERABILITIES}/${vulnerability.metadata.name}`">{{ vulnerability.metadata.name }}</RouterLink>
55
</div>
66
<ScoreBadge :score="vulnerability.spec.scoreV3" scoreType="v3" />
77
<div class="impacted-container">
@@ -21,6 +21,10 @@
2121
import BlockPercentageBar from './BlockPercentageBar.vue';
2222
import ScoreBadge from './ScoreBadge.vue';
2323
import debounce from 'lodash/debounce';
24+
import {
25+
PRODUCT_NAME,
26+
PAGE,
27+
} from "@pkg/types";
2428
2529
export default {
2630
name: 'severeVulnerabilitiesItem',
@@ -35,7 +39,10 @@
3539
},
3640
},
3741
data() {
38-
return { };
42+
return {
43+
PRODUCT_NAME,
44+
PAGE,
45+
};
3946
},
4047
methods: {
4148
resize(fn) {

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ export function init($plugin: any, store: any) {
1010
product({
1111
icon: "pod_security",
1212
inStore: "cluster",
13-
inExplorer: true,
14-
removeable: false,
15-
showNamespaceFilter: true
1613
});
1714

1815
virtualType({
@@ -23,8 +20,8 @@ export function init($plugin: any, store: any) {
2320
name: `c-cluster-${PRODUCT_NAME}-${PAGE.DASHBOARD}`,
2421
params: {
2522
product: PRODUCT_NAME
26-
},
27-
meta: { pkg: PRODUCT_NAME, product: PRODUCT_NAME }
23+
},
24+
meta: { pkg: PRODUCT_NAME, product: PRODUCT_NAME }
2825
},
2926
overview: true
3027
});
@@ -81,19 +78,6 @@ export function init($plugin: any, store: any) {
8178
},
8279
});
8380

84-
virtualType({
85-
label: "Components Demo",
86-
name: "demo",
87-
namespaced: false,
88-
route: {
89-
name: `c-cluster-${PRODUCT_NAME}-demo`,
90-
params: {
91-
product: PRODUCT_NAME,
92-
},
93-
meta: { pkg: PRODUCT_NAME, product: PRODUCT_NAME },
94-
},
95-
});
96-
9781
weightType(PAGE.DASHBOARD, 98, true);
9882
weightType(PAGE.IMAGES, 97, true);
9983
weightType(PAGE.VULNERABILITIES, 96, true);

pkg/sbombastic-image-vulnerability-scanner/formatters/CveNameLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ export default {
2525
</script>
2626

2727
<template>
28-
<RouterLink :to="`/c/${this.$route.params.cluster}/${ this.PRODUCT_NAME }/${this.PAGE.CVE_DETAIL}/${value}`">{{ value }}</RouterLink>
28+
<RouterLink :to="`/c/${this.$route.params.cluster}/${ this.PRODUCT_NAME }/${this.PAGE.VULNERABILITIES}/${value}`">{{ value }}</RouterLink>
2929
</template>

pkg/sbombastic-image-vulnerability-scanner/models/VexHub.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

pkg/sbombastic-image-vulnerability-scanner/models/sbombastic.rancher.io.vexhub.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import SteveModel from '@shell/plugins/steve/steve-class';
2+
import { PRODUCT_NAME, PAGE } from "@pkg/types";
23

34
export default class SbombasticRancherIoVexhub extends SteveModel {
45
get _availableActions() {
@@ -123,4 +124,18 @@ export default class SbombasticRancherIoVexhub extends SteveModel {
123124
}
124125
};
125126
}
127+
get listLocation() {
128+
// if (this.$rootState.targetRoute.params.resource === "sbombastic.rancher.io.vexhub") {
129+
// return this._listLocation;
130+
// }
131+
return { name: `c-cluster-${PRODUCT_NAME}-${PAGE.VEX_MANAGEMENT}` };
132+
}
133+
134+
get doneOverride() {
135+
return this.listLocation;
136+
}
137+
138+
get parentLocationOverride() {
139+
return this.listLocation;
140+
}
126141
}

pkg/sbombastic-image-vulnerability-scanner/pages/c/_cluster/sbombastic-image-vulnerability-scanner/Dashboard.vue

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@
8282
<span class="total-count">CVE ID, Score, Affected images</span>
8383
</div>
8484
</div>
85-
<div class="panel-content">
85+
<div>
8686
<TopSevereVulnerabilitiesChart
8787
:topSevereVulnerabilities="displayedVulnerabilities"
8888
/>
8989
<div v-if="shouldShowVulnerabilitiesViewAll" class="view-all-inline">
90-
<button class="btn-link view-all-left" @click="toggleVulnerabilitiesView()">
90+
<!-- <button class="btn-link view-all-left" @click="toggleVulnerabilitiesView()">
9191
{{ showAllVulnerabilities ? 'View less' : 'View all' }}
92-
</button>
92+
</button> -->
93+
<RouterLink style="margin-left: 32px;" class="view-all" :to="`/c/${this.$route.params.cluster}/${ this.PRODUCT_NAME }/${this.PAGE.VULNERABILITIES}`">View all</RouterLink>
9394
</div>
9495
</div>
9596
</div>
@@ -106,9 +107,10 @@
106107
<div class="panel-content">
107108
<TopRiskyImagesChart :topRiskyImages="displayedImages" />
108109
<div v-if="shouldShowImagesViewAll" class="view-all-inline">
109-
<button class="btn-link view-all-left" @click="toggleImagesView()">
110+
<!-- <button class="btn-link view-all-left" @click="toggleImagesView()">
110111
{{ showAllImages ? 'View less' : 'View all' }}
111-
</button>
112+
</button> -->
113+
<RouterLink style="margin-left: 16px;" class="view-all" :to="`/c/${this.$route.params.cluster}/${ this.PRODUCT_NAME }/${this.PAGE.IMAGES}`">View all</RouterLink>
112114
</div>
113115
</div>
114116
</div>
@@ -117,7 +119,7 @@
117119
</template>
118120

119121
<script>
120-
import { RESOURCE, PRODUCT_NAME } from "@pkg/types";
122+
import { RESOURCE, PRODUCT_NAME, PAGE } from "@pkg/types";
121123
import { severityDistribution, cves } from '@pkg/data/sbombastic.rancher.io.vulnerability';
122124
import SevereVulnerabilitiesItem from '@pkg/components/common/SevereVulnerabilitiesItem.vue';
123125
import TopSevereVulnerabilitiesChart from '@pkg/components/TopSevereVulnerabilitiesChart';
@@ -137,6 +139,7 @@ export default {
137139
data() {
138140
return {
139141
PRODUCT_NAME: PRODUCT_NAME,
142+
PAGE,
140143
disabled: false,
141144
lastUpdatedTime: '',
142145
selectedRegistry: 'all',
@@ -559,7 +562,7 @@ export default {
559562
display: flex;
560563
justify-content: space-between;
561564
align-items: flex-start;
562-
padding: 24px 24px 0 24px;
565+
padding: 16px 16px 0 16px;
563566
564567
.header-left {
565568
display: flex;
@@ -601,14 +604,14 @@ export default {
601604
602605
.panel-content {
603606
flex: 1;
604-
padding: 24px;
607+
padding: 16px;
605608
display: flex;
606609
flex-direction: column;
607610
}
608611
609612
.view-all-inline {
610-
padding: 12px 0 0 0;
611-
margin-top: 8px;
613+
margin-top: 9px;
614+
margin-bottom: 4px;
612615
text-align: left;
613616
614617
.btn-link {
@@ -868,6 +871,14 @@ export default {
868871
}
869872
}
870873
874+
.view-all {
875+
color: #141419;
876+
font-size: 14px;
877+
font-weight: 400;
878+
text-decoration: underline;
879+
cursor: pointer;
880+
}
881+
871882
// Override TopSevereVulnerabilitiesChart styling for Dashboard
872883
.summary-panel {
873884
:deep(.chart-section) {
@@ -884,7 +895,7 @@ export default {
884895
885896
:deep(.vulnerability-record) {
886897
padding: 8px 16px !important;
887-
margin-bottom: 4px !important;
898+
margin-bottom: 3px !important;
888899
}
889900
890901
:deep(.cve) {

0 commit comments

Comments
 (0)