@@ -20,6 +20,7 @@ onMounted(() => fetchVulnTree())
2020
2121const isExpanded = shallowRef (false )
2222const showAllPackages = shallowRef (false )
23+ const showAllVulnerabilities = shallowRef (false )
2324
2425const hasVulnerabilities = computed (
2526 () => vulnTree .value && vulnTree .value .vulnerablePackages .length > 0 ,
@@ -142,7 +143,7 @@ function getDepthStyle(depth: string | undefined) {
142143 <!-- Show first 2 vulnerabilities -->
143144 <ul class =" space-y-1 list-none m-0 p-0" >
144145 <li
145- v-for =" vuln in pkg.vulnerabilities.slice(0, 2)"
146+ v-for =" vuln in pkg.vulnerabilities.slice(0, showAllVulnerabilities ? undefined : 2)"
146147 :key =" vuln.id"
147148 class =" flex items-center gap-2 text-xs text-fg-muted"
148149 >
@@ -156,8 +157,15 @@ function getDepthStyle(depth: string | undefined) {
156157 </a >
157158 <span class =" truncate w-0 flex-1" >{{ vuln.summary }}</span >
158159 </li >
159- <li v-if =" pkg.vulnerabilities.length > 2" class =" text-xs text-fg-subtle" >
160- {{ $t('package.vulnerabilities.more', { count: pkg.vulnerabilities.length - 2 }) }}
160+ <li
161+ v-if =" pkg.vulnerabilities.length > 2 && !showAllVulnerabilities"
162+ class =" text-xs text-fg-subtle"
163+ >
164+ <button type =" button" @click =" showAllVulnerabilities = true" >
165+ {{
166+ $t('package.vulnerabilities.more', { count: pkg.vulnerabilities.length - 2 })
167+ }}
168+ </button >
161169 </li >
162170 </ul >
163171 </li >
0 commit comments