|
1 | 1 | <template>
|
2 | 2 | <div class="page">
|
3 | 3 | <div class="header-section">
|
4 |
| - <h1>Vulnerabilities</h1> |
| 4 | + <div class="title"> |
| 5 | + {{ t("imageScanner.vulnerabilities.title") }} |
| 6 | + </div> |
| 7 | + <div class="filter-dropdown"> |
| 8 | + <LabeledSelect |
| 9 | + v-model:value="selectedImageFilter" |
| 10 | + :options="filterImageOptions" |
| 11 | + :close-on-select="true" |
| 12 | + :multiple="false" |
| 13 | + /> |
| 14 | + </div> |
| 15 | + <div> |
| 16 | + <button class="btn role-primary"> |
| 17 | + <i class="icon icon-download"></i> |
| 18 | + {{ t('imageScanner.images.downloadReport') }} |
| 19 | + </button> |
| 20 | + </div> |
5 | 21 | </div>
|
6 | 22 | <div class="summary-section">
|
7 | 23 | <TopSevereVulnerabilitiesChart
|
|
21 | 37 | :headers="VULNERABILITIES_TABLE"
|
22 | 38 | :key-field="'id'"
|
23 | 39 | @selection="onSelectionChange"
|
24 |
| - /> |
| 40 | + > |
| 41 | + <template #header-left> |
| 42 | + <div class="table-top-left"> |
| 43 | + <DownloadCustomReport |
| 44 | + class="table-btn" |
| 45 | + :selectedRows="selectedRows" |
| 46 | + :buttonName="t('imageScanner.images.buttons.downloadCustomReport')" |
| 47 | + /> |
| 48 | + </div> |
| 49 | + </template> |
| 50 | + </SortableTable> |
25 | 51 | </div>
|
26 | 52 | </div>
|
27 | 53 | </template>
|
28 | 54 |
|
29 | 55 | <script>
|
30 | 56 | import SortableTable from '@shell/components/SortableTable';
|
31 |
| - import SeverityDistribution from '@sbombastic-image-vulnerability-scanner/components/SeverityDistribution.vue'; |
32 |
| - import TopSevereVulnerabilitiesChart from '@sbombastic-image-vulnerability-scanner/components/TopSevereVulnerabilitiesChart.vue'; |
| 57 | + import LabeledSelect from "@shell/components/form/LabeledSelect"; |
| 58 | + import SeverityDistribution from '@sbombastic-image-vulnerability-scanner/components/SeverityDistribution'; |
| 59 | + import TopSevereVulnerabilitiesChart from '@sbombastic-image-vulnerability-scanner/components/TopSevereVulnerabilitiesChart'; |
| 60 | + import DownloadCustomReport from '@sbombastic-image-vulnerability-scanner/components/common/DownloadCustomReport'; |
33 | 61 | import { VULNERABILITIES_TABLE } from '@sbombastic-image-vulnerability-scanner/config/table-headers';
|
34 | 62 | import { severityDistribution, cves } from '@sbombastic-image-vulnerability-scanner/data/sbombastic.rancher.io.vulnerability';
|
35 | 63 |
|
|
38 | 66 | components: {
|
39 | 67 | SeverityDistribution,
|
40 | 68 | TopSevereVulnerabilitiesChart,
|
| 69 | + DownloadCustomReport, |
41 | 70 | SortableTable,
|
| 71 | + LabeledSelect, |
42 | 72 | },
|
43 | 73 | data() {
|
| 74 | + const filterImageOptions = [ |
| 75 | + this.t('imageScanner.images.filters.image.allImages'), |
| 76 | + this.t('imageScanner.images.filters.image.excludeBaseImages'), |
| 77 | + this.t('imageScanner.images.filters.image.includeBaseImages') |
| 78 | + ]; |
44 | 79 | return {
|
45 | 80 | VULNERABILITIES_TABLE,
|
46 | 81 | severityDistribution: null,
|
47 | 82 | topSevereVulnerabilities: [],
|
48 | 83 | vulnerabilities: [],
|
49 | 84 | selectedRows: [],
|
| 85 | + filterImageOptions, |
| 86 | + selectedImageFilter: filterImageOptions[0], |
50 | 87 | };
|
51 | 88 | },
|
52 | 89 | async fetch() {
|
|
87 | 124 | align-items: flex-start;
|
88 | 125 | gap: 24px;
|
89 | 126 | align-self: stretch;
|
| 127 | +
|
| 128 | + .title { |
| 129 | + display: flex; |
| 130 | + flex-direction: column; |
| 131 | + justify-content: center; |
| 132 | + align-items: flex-start; |
| 133 | + gap: 4px; |
| 134 | + flex: 1 0 0; |
| 135 | + color: #141419; |
| 136 | + font-family: Lato; |
| 137 | + font-size: 24px; |
| 138 | + font-style: normal; |
| 139 | + font-weight: 600; |
| 140 | + line-height: 32px; /* 133.333% */ |
| 141 | + } |
| 142 | +
|
| 143 | + .filter-dropdown { |
| 144 | + display: flex; |
| 145 | + width: 225px; |
| 146 | + height: 40px; |
| 147 | + } |
90 | 148 | }
|
91 | 149 |
|
92 | 150 | .summary-section {
|
|
0 commit comments