From 6dbd9d753f9ecc24af9d8fd771f3c3bd64546418 Mon Sep 17 00:00:00 2001 From: Steven Zhang Date: Tue, 12 Aug 2025 20:25:02 -0700 Subject: [PATCH 1/2] Changed status setting for no-scanjob pattern, simplified the scanjob map, embeded scan button into resource table's table actions --- .../components/RegistryDetails.vue | 11 +- .../components/common/RegisterStatusBadge.vue | 7 +- .../common/RegistryStatusUpdate.vue | 12 +- .../sbombastic-image-vulnerability-scanner.ts | 4 +- .../config/table-headers.ts | 12 +- .../formatters/PreviousScanCell.vue | 36 +++--- .../formatters/ProgressCell.vue | 2 +- .../formatters/RegistryStatusCellBadge.vue | 2 +- .../l10n/en-us.yaml | 7 +- .../list/sbombastic.rancher.io.registry.vue | 117 +++++++++++++----- 10 files changed, 136 insertions(+), 74 deletions(-) diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue b/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue index e69745d..bcd9a68 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue @@ -5,7 +5,7 @@
- {{ t('imageScanner.registries.title') }}: + {{ t('imageScanner.registries.title') }}: {{ $route.params.id }} @@ -63,6 +63,15 @@ await this.$store.dispatch('cluster/find', { type: RESOURCE.REGISTRY, id: `${this.$route.params.ns}/${this.$route.params.id}` }); let registry = this.$store.getters['cluster/byId'](RESOURCE.REGISTRY, `${this.$route.params.ns}/${this.$route.params.id}`); + + await this.$store.dispatch('cluster/findAll', { type: RESOURCE.SCAN_JOB }); + let scanJobs = this.$store.getters['cluster/all'](RESOURCE.SCAN_JOB); + + // filter scan jobs for the current registry + scanJobs = scanJobs.filter((job) => { + return job.spec.registry === registry.metadata.name; + }); + this.registryStatus = this.getRegistryStatus(registry); this.registryMetadata = [ { diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue b/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue index e8cfc6a..0e12036 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue @@ -1,6 +1,6 @@ @@ -29,7 +29,7 @@ case REGISTRY_STATUS.FAILED: return "failed"; default: - return ""; + return "none"; } } } @@ -82,6 +82,9 @@ font-style: normal; font-weight: 400; line-height: 19px; + &.none { + color: var(--muted); + } } } \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/common/RegistryStatusUpdate.vue b/pkg/sbombastic-image-vulnerability-scanner/components/common/RegistryStatusUpdate.vue index cf19398..4aa5dbb 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/components/common/RegistryStatusUpdate.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/components/common/RegistryStatusUpdate.vue @@ -1,11 +1,11 @@