From 4d5a7300955b804cf3db6b692a43b30c10a99206 Mon Sep 17 00:00:00 2001 From: Rush Kapoor Date: Thu, 31 Jul 2025 13:33:09 -0700 Subject: [PATCH 1/3] Refactor Registry metadata as common component --- .../components/RegistryDetails.vue | 74 ++++++----- .../components/common/RancherMeta.vue | 33 +++++ .../components/common/RancherMetaProperty.vue | 121 +++++++++++++----- .../components/common/RancherMetaTags.vue | 57 --------- .../components/common/RegisterStatusBadge.vue | 1 + .../sbombastic-image-vulnerability-scanner.ts | 26 ++-- 6 files changed, 178 insertions(+), 134 deletions(-) create mode 100644 pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMeta.vue delete mode 100644 pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaTags.vue diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue b/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue index 2ac2893..1e977f0 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue @@ -8,7 +8,7 @@ {{ t('imageScanner.registries.title') }}: {{ $route.params.id }} - + Registry configuration description @@ -25,34 +25,29 @@ -
-
- - -
-
- - -
-
-
+ Recent scans + + + \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaProperty.vue b/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaProperty.vue index c580699..f5e35da 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaProperty.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaProperty.vue @@ -1,59 +1,110 @@ - \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaTags.vue b/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaTags.vue deleted file mode 100644 index b6b3f8b..0000000 --- a/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMetaTags.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue b/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue index 0cdcc0e..e8cfc6a 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/components/common/RegisterStatusBadge.vue @@ -74,6 +74,7 @@ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; + line-clamp: 1; overflow: hidden; text-overflow: ellipsis; font-family: Lato; diff --git a/pkg/sbombastic-image-vulnerability-scanner/types/sbombastic-image-vulnerability-scanner.ts b/pkg/sbombastic-image-vulnerability-scanner/types/sbombastic-image-vulnerability-scanner.ts index c223118..35abba8 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/types/sbombastic-image-vulnerability-scanner.ts +++ b/pkg/sbombastic-image-vulnerability-scanner/types/sbombastic-image-vulnerability-scanner.ts @@ -1,13 +1,19 @@ -export const PRODUCT_NAME = 'imageScanner'; +export const PRODUCT_NAME = "imageScanner"; export const RESOURCE = { - REGISTRY: "sbombastic.rancher.io.registry", - SCAN_JOB: "sbombastic.rancher.io.scanjob", + REGISTRY: "sbombastic.rancher.io.registry", + SCAN_JOB: "sbombastic.rancher.io.scanjob", }; export const PAGE = { - DASHBOARD: "dashboard", - REGISTRIES: "registries", - IMAGE_OVERVIEW: "image_overview", - IMAGE_DETAIL: "image_detail", - VULNERABILITY_OVERVIEW: "vulnerability_overview", - CVE_DETAIL: "cve_detail", -}; \ No newline at end of file + DASHBOARD: "dashboard", + REGISTRIES: "registries", + IMAGE_OVERVIEW: "image_overview", + IMAGE_DETAIL: "image_detail", + VULNERABILITY_OVERVIEW: "vulnerability_overview", + CVE_DETAIL: "cve_detail", +}; +export interface MetadataProperty { + type: "text" | "tags"; + label?: string; + value?: string; + tags?: string[]; +} From cd458ad6ec2e1eaac6cd7b286735f6f938849ac4 Mon Sep 17 00:00:00 2001 From: Rush Kapoor Date: Mon, 4 Aug 2025 14:41:33 -0700 Subject: [PATCH 2/3] Add Registry details scan history table using mock data --- .../components/RegistryDetails.vue | 41 ++++- .../config/table-headers.ts | 158 +++++++++++------- .../l10n/en-us.yaml | 8 + 3 files changed, 149 insertions(+), 58 deletions(-) diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue b/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue index 1e977f0..f3bbc1d 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue @@ -28,25 +28,58 @@ Recent scans - + diff --git a/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts b/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts index ace6e2c..3d6eaf0 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts +++ b/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts @@ -62,7 +62,7 @@ export const REGISTRY_SCAN_HISTORY_TABLE = [ name: "status", labelKey: "imageScanner.registries.configuration.scanTable.header.status", value: "status", - formatter: "RegisterStatusCellBadge", + formatter: "RegistryStatusCellBadge", sort: "status", }, { @@ -77,7 +77,7 @@ export const REGISTRY_SCAN_HISTORY_TABLE = [ labelKey: "imageScanner.registries.configuration.scanTable.header.progress", value: "progress", getValue: (row: any) => row.progress.toString(), - formatter: "Percentage", + formatter: "ProgressCell", sort: "progress", }, {