From 877354a6af9644e727ae007390526b045d9c66ad Mon Sep 17 00:00:00 2001 From: Nick Chung Date: Wed, 27 Aug 2025 19:08:37 +0800 Subject: [PATCH] feat: image details with mockdata --- .../components/ImageDetails.vue | 842 ++++++++++++++++++ .../config/table-headers.ts | 64 ++ .../formatters/CveIdCell.vue | 25 + .../formatters/ExploitabilityCell.vue | 22 + .../formatters/FixAvailableCell.vue | 31 + .../formatters/ImageNameCell.vue | 2 +- .../formatters/ScoreCell.vue | 45 + .../formatters/SeverityBadgeCell.vue | 14 + .../l10n/en-us.yaml | 47 + ...stic-image-vulnerability-scanner-routes.ts | 7 +- 10 files changed, 1097 insertions(+), 2 deletions(-) create mode 100644 pkg/sbombastic-image-vulnerability-scanner/components/ImageDetails.vue create mode 100644 pkg/sbombastic-image-vulnerability-scanner/formatters/CveIdCell.vue create mode 100644 pkg/sbombastic-image-vulnerability-scanner/formatters/ExploitabilityCell.vue create mode 100644 pkg/sbombastic-image-vulnerability-scanner/formatters/FixAvailableCell.vue create mode 100644 pkg/sbombastic-image-vulnerability-scanner/formatters/ScoreCell.vue create mode 100644 pkg/sbombastic-image-vulnerability-scanner/formatters/SeverityBadgeCell.vue diff --git a/pkg/sbombastic-image-vulnerability-scanner/components/ImageDetails.vue b/pkg/sbombastic-image-vulnerability-scanner/components/ImageDetails.vue new file mode 100644 index 0000000..a0583a7 --- /dev/null +++ b/pkg/sbombastic-image-vulnerability-scanner/components/ImageDetails.vue @@ -0,0 +1,842 @@ + + + + + diff --git a/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts b/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts index d594999..2441f1f 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts +++ b/pkg/sbombastic-image-vulnerability-scanner/config/table-headers.ts @@ -271,3 +271,67 @@ export const VULNERABILITIES_TABLE = [ width: 300, }, ]; + +export const VULNERABILITY_DETAILS_TABLE = [ + { + name: "cveId", + labelKey: "imageScanner.imageDetails.table.headers.cveId", + value: "cveId", + formatter: "CveIdCell", + sort: "cveId", + width: 150, + }, + { + name: "score", + labelKey: "imageScanner.imageDetails.table.headers.score", + value: "score", + formatter: "ScoreCell", + sort: "score", + width: 100, + }, + { + name: "package", + labelKey: "imageScanner.imageDetails.table.headers.package", + value: "package", + sort: "package", + width: 200, + }, + { + name: "fixAvailable", + labelKey: "imageScanner.imageDetails.table.headers.fixAvailable", + value: "fixAvailable", + formatter: "FixAvailableCell", + sort: "fixAvailable", + width: 120, + }, + { + name: "severity", + labelKey: "imageScanner.imageDetails.table.headers.severity", + value: "severity", + formatter: "SeverityBadgeCell", + sort: "severity", + width: 100, + }, + { + name: "exploitability", + labelKey: "imageScanner.imageDetails.table.headers.exploitability", + value: "exploitability", + formatter: "ExploitabilityCell", + sort: "exploitability", + width: 120, + }, + { + name: "packageVersion", + labelKey: "imageScanner.imageDetails.table.headers.packageVersion", + value: "packageVersion", + sort: "packageVersion", + width: 150, + }, + { + name: "packagePath", + labelKey: "imageScanner.imageDetails.table.headers.packagePath", + value: "packagePath", + sort: "packagePath", + width: 200, + }, +]; diff --git a/pkg/sbombastic-image-vulnerability-scanner/formatters/CveIdCell.vue b/pkg/sbombastic-image-vulnerability-scanner/formatters/CveIdCell.vue new file mode 100644 index 0000000..4564288 --- /dev/null +++ b/pkg/sbombastic-image-vulnerability-scanner/formatters/CveIdCell.vue @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/formatters/ExploitabilityCell.vue b/pkg/sbombastic-image-vulnerability-scanner/formatters/ExploitabilityCell.vue new file mode 100644 index 0000000..34f58d2 --- /dev/null +++ b/pkg/sbombastic-image-vulnerability-scanner/formatters/ExploitabilityCell.vue @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/formatters/FixAvailableCell.vue b/pkg/sbombastic-image-vulnerability-scanner/formatters/FixAvailableCell.vue new file mode 100644 index 0000000..66c400d --- /dev/null +++ b/pkg/sbombastic-image-vulnerability-scanner/formatters/FixAvailableCell.vue @@ -0,0 +1,31 @@ + + + + + \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/formatters/ImageNameCell.vue b/pkg/sbombastic-image-vulnerability-scanner/formatters/ImageNameCell.vue index af029f0..da8621c 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/formatters/ImageNameCell.vue +++ b/pkg/sbombastic-image-vulnerability-scanner/formatters/ImageNameCell.vue @@ -1,5 +1,5 @@ diff --git a/pkg/sbombastic-image-vulnerability-scanner/formatters/ScoreCell.vue b/pkg/sbombastic-image-vulnerability-scanner/formatters/ScoreCell.vue new file mode 100644 index 0000000..9b33251 --- /dev/null +++ b/pkg/sbombastic-image-vulnerability-scanner/formatters/ScoreCell.vue @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/formatters/SeverityBadgeCell.vue b/pkg/sbombastic-image-vulnerability-scanner/formatters/SeverityBadgeCell.vue new file mode 100644 index 0000000..f13798a --- /dev/null +++ b/pkg/sbombastic-image-vulnerability-scanner/formatters/SeverityBadgeCell.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml b/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml index 8008825..e25ad67 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml +++ b/pkg/sbombastic-image-vulnerability-scanner/l10n/en-us.yaml @@ -97,6 +97,53 @@ imageScanner: repository: Repository registry: Registry vulnerabilities: vulnerabilities + imageDetails: + status: Status + vulnerabilities: Vulnerabilities + repository: Repository + registry: Registry + architecture: Architecture + operatingSystem: Operating system + size: Size + author: Author + dockerVersion: Docker version + created: Created + showAllProperties: Show all image properties + showLessProperties: Show less properties + imageId: Image ID + layers: Layers + mostSevereVulnerabilities: Most severe, affecting vulnerabilities + fixAvailable: Fix available + noFixAvailable: No fix available + severityDistribution: Severity distribution + vulnerabilitiesInTotal: Vulnerabilities in total + searchById: Search by ID + searchByIdPlaceholder: Search CVE ID + score: Score + searchByName: Search by name + searchByNamePlaceholder: Search package name + any: Any + available: Available + notAvailable: Not available + severity: Severity + exploitability: Exploitability + affected: Affected + not-affected: Not affected + investigating: Investigating + fixed: Fixed + no-vex-data: No VEX data + groupByLayer: Group by layer + selected: selected + table: + headers: + cveId: CVE ID + score: Score + package: Package + fixAvailable: Fix available + severity: Severity + exploitability: Exploitability + packageVersion: Package version + packagePath: Package path vulnerabilities: title: Vulnerabilities vulnerabilitiesBySeverityChart: diff --git a/pkg/sbombastic-image-vulnerability-scanner/routes/sbombastic-image-vulnerability-scanner-routes.ts b/pkg/sbombastic-image-vulnerability-scanner/routes/sbombastic-image-vulnerability-scanner-routes.ts index 8c4781d..df18528 100644 --- a/pkg/sbombastic-image-vulnerability-scanner/routes/sbombastic-image-vulnerability-scanner-routes.ts +++ b/pkg/sbombastic-image-vulnerability-scanner/routes/sbombastic-image-vulnerability-scanner-routes.ts @@ -1,9 +1,9 @@ import RegistryDetails from "@pkg/components/RegistryDetails.vue"; import ComponentDemo from "@pkg/pages/c/_cluster/sbombastic-image-vulnerability-scanner/ComponentDemo.vue"; import ImageOverview from "@pkg/pages/c/_cluster/sbombastic-image-vulnerability-scanner/ImageOverview.vue"; +import ImageDetails from "@sbombastic-image-vulnerability-scanner/components/ImageDetails.vue"; import RegistriesConfiguration from "@pkg/pages/c/_cluster/sbombastic-image-vulnerability-scanner/RegistriesConfiguration.vue"; import Vulnerabilities from "@pkg/pages/c/_cluster/sbombastic-image-vulnerability-scanner/Vulnerabilities.vue"; -import VexManagement from "@pkg/pages/c/_cluster/sbombastic-image-vulnerability-scanner/VexManagement.vue"; import CreateResource from "@pkg/pages/c/_cluster/sbombastic-image-vulnerability-scanner/_resource/create.vue"; import ListResource from "@pkg/pages/c/_cluster/sbombastic-image-vulnerability-scanner/_resource/index.vue"; import { @@ -17,6 +17,11 @@ const routes = [ path: `/c/:cluster/${PRODUCT_NAME}/${PAGE.IMAGE_OVERVIEW}`, component: ImageOverview, }, + { + name: `c-cluster-${PRODUCT_NAME}-${PAGE.IMAGE_DETAIL}-id`, + path: `/c/:cluster/${PRODUCT_NAME}/${PAGE.IMAGE_DETAIL}/:id`, + component: ImageDetails, + }, { name: `c-cluster-${PRODUCT_NAME}-${PAGE.VULNERABILITY_OVERVIEW}`, path: `/c/:cluster/${PRODUCT_NAME}/${PAGE.VULNERABILITY_OVERVIEW}`,