diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue b/pkg/sbombastic-image-vulnerability-scanner/components/RegistryDetails.vue index 2ac2893..631435d 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,43 +25,93 @@ -
-
- - -
-
- - -
-
-
+ Recent scans + @@ -79,6 +129,10 @@ gap: 24px; flex: 1 0 0; align-self: stretch; + + .table { + width: 100%; + } } .about { @@ -92,22 +146,6 @@ /* style */ border-bottom: 1px dashed #DCDEE7; - .rancher-meta { - display: flex; - align-items: flex-start; - gap: 24px; - align-self: stretch; - - .meta-widget { - display: flex; - padding-right: 16px; - flex-direction: column; - align-items: flex-start; - gap: 4px; - flex: 1 0 0; - } - } - .header { /* layout */ display: flex; diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMeta.vue b/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMeta.vue new file mode 100644 index 0000000..5e26373 --- /dev/null +++ b/pkg/sbombastic-image-vulnerability-scanner/components/common/RancherMeta.vue @@ -0,0 +1,33 @@ + + + + + \ 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/config/table-headers.ts b/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts index 0bd9940..3d6eaf0 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts +++ b/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts @@ -1,57 +1,103 @@ import { elapsedTime } from "@shell/utils/time"; -export const REGISTRY_SCAN_TABLE =[ - { - name: "scan", - labelKey: "imageScanner.registries.registrytable.header.scan", - value: 'metadata.name', - formatter: "ScanNameCell", - sort: "scan", - }, - { - name: "registry", - labelKey: "imageScanner.registries.registrytable.header.registry", - value: "registry.id", - sort: "id", - }, - { - name: "namespace", - labelKey: "imageScanner.registries.registrytable.header.namespace", - value: "metadata.namespace", - sort: "metadata.namespace", - }, - { - name: "repositories", - labelKey: "imageScanner.registries.registrytable.header.repos", - value: "registry.spec.repositories", - sort: "registry.spec.repositories", - }, - { - name: "schedule", - labelKey: "imageScanner.registries.registrytable.header.schedule", - value: "schedule", - getValue: (row: any) => elapsedTime(row.schedule * 3600 * 1000).label, - sort: "schedule", - }, - { - name: "status", - labelKey: "imageScanner.registries.registrytable.header.status", - value: "registry.status.conditions.0.type", - formatter: "RegistryStatusCellBadge", - sort: "registry.status.conditions.0.type", - }, - { - name: "_progress", - labelKey: "imageScanner.registries.registrytable.header.progress", - value: "progress", - getValue: (row: any) => row.progress.toString(), - formatter: "ProgressCell", - sort: "progress", - }, - { - name: "previousScan", - labelKey: "imageScanner.registries.registrytable.header.prevScan", - value: "status.conditions.1.type", - formatter: "PreviousScanCell", - sort: "status.conditions.1.type", - }, -]; \ No newline at end of file + +export const REGISTRY_SCAN_TABLE = [ + { + name: "scan", + labelKey: "imageScanner.registries.registrytable.header.scan", + value: "metadata.name", + formatter: "ScanNameCell", + sort: "scan", + }, + { + name: "registry", + labelKey: "imageScanner.registries.registrytable.header.registry", + value: "registry.id", + sort: "id", + }, + { + name: "namespace", + labelKey: "imageScanner.registries.registrytable.header.namespace", + value: "metadata.namespace", + sort: "metadata.namespace", + }, + { + name: "repositories", + labelKey: "imageScanner.registries.registrytable.header.repos", + value: "registry.spec.repositories", + sort: "registry.spec.repositories", + }, + { + name: "schedule", + labelKey: "imageScanner.registries.registrytable.header.schedule", + value: "schedule", + getValue: (row: any) => elapsedTime(row.schedule * 3600 * 1000).label, + sort: "schedule", + }, + { + name: "status", + labelKey: "imageScanner.registries.registrytable.header.status", + value: "registry.status.conditions.0.type", + formatter: "RegistryStatusCellBadge", + sort: "registry.status.conditions.0.type", + }, + { + name: "_progress", + labelKey: "imageScanner.registries.registrytable.header.progress", + value: "progress", + getValue: (row: any) => row.progress.toString(), + formatter: "ProgressCell", + sort: "progress", + }, + { + name: "previousScan", + labelKey: "imageScanner.registries.registrytable.header.prevScan", + value: "status.conditions.1.type", + formatter: "PreviousScanCell", + sort: "status.conditions.1.type", + }, +]; + +export const REGISTRY_SCAN_HISTORY_TABLE = [ + { + name: "status", + labelKey: "imageScanner.registries.configuration.scanTable.header.status", + value: "status", + formatter: "RegistryStatusCellBadge", + sort: "status", + }, + { + name: "since", + labelKey: "imageScanner.registries.configuration.scanTable.header.since", + value: "timestamp", + formatter: "Date", + sort: "timestamp", + }, + { + name: "progress", + labelKey: "imageScanner.registries.configuration.scanTable.header.progress", + value: "progress", + getValue: (row: any) => row.progress.toString(), + formatter: "ProgressCell", + sort: "progress", + }, + { + name: "imagesScanned", + labelKey: + "imageScanner.registries.configuration.scanTable.header.imagesScanned", + value: "imagesScanned", + sort: "imagesScanned", + }, + { + name: "imagesFound", + labelKey: + "imageScanner.registries.configuration.scanTable.header.imagesFound", + value: "imagesFound", + sort: "imagesFound", + }, + { + name: "errors", + labelKey: "imageScanner.registries.configuration.scanTable.header.errors", + value: "errors", + sort: "errors", + }, +]; diff --git a/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml b/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml index d98504c..b981937 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml +++ b/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml @@ -26,6 +26,14 @@ imageScanner: namespace: Namespace repositories: Repositories schedule: Schedule + scanTable: + header: + status: Status + since: Since + progress: Progress + imagesScanned: Images scan + imagesFound: Images found + errors: Error(s) images: title: Images downloadReport: Download full report 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[]; +}