Skip to content

Commit 7594ee5

Browse files
committed
Fix progress cell on Registry details page
1 parent fff3856 commit 7594ee5

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,21 @@
106106
value: registry.metadata.schedule || '',
107107
}
108108
];
109-
110-
this.scanHistory = scanJobs.map((rec) => {
111-
rec.status.statusResult = rec.status.conditions.filter(condition => {
112-
return condition.status === "True";
113-
})[0] || {
114-
type: "Pending",
115-
lastTransitionTime: null,
116-
};
117-
return rec;
109+
110+
scanJobs.forEach((rec) => {
111+
this.scanHistory.push({
112+
...rec,
113+
progress: rec.status.scannedImagesCount && rec.status.imagesCount ? Math.ceil(rec.status.scannedImagesCount / rec.status.imagesCount * 100) : 0,
114+
status: {
115+
...rec.status,
116+
statusResult: rec.status.conditions.filter(condition => {
117+
return condition.status === "True";
118+
})[0] || {
119+
type: "Pending",
120+
lastTransitionTime: null,
121+
}
122+
}
123+
})
118124
});
119125
},
120126
getRegistryStatus(registry) {

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const REGISTRY_SCAN_TABLE = [
4444
{
4545
name: "progress",
4646
labelKey: "imageScanner.registries.registrytable.header.progress",
47-
getValue: (row: any) => row,
47+
getValue: (row: any) => row,
4848
formatter: "ProgressCell",
4949
sort: "progress",
5050
width: 120,
@@ -78,12 +78,7 @@ export const REGISTRY_SCAN_HISTORY_TABLE = [
7878
{
7979
name: "progress",
8080
labelKey: "imageScanner.registries.configuration.scanTable.header.progress",
81-
getValue: (row: any) => {
82-
let progress = Math.round(
83-
(row.status.scannedImagesCount / row.status.imagesCount) * 100
84-
);
85-
return { progress };
86-
},
81+
getValue: (row: any) => row,
8782
formatter: "ProgressCell",
8883
sort: "progress",
8984
},

0 commit comments

Comments
 (0)