|
167 | 167 | <router-link :to="{ path: getVmRouteUsingType(record) + record.virtualmachineid }">{{ text }}</router-link> |
168 | 168 | </template> |
169 | 169 | <template v-if="column.key === 'volumename'"> |
170 | | - <router-link :to="{ path: '/volume/' + record.volumeid }">{{ text }}</router-link> |
| 170 | + <router-link v-if="resourceIdToValidLinksMap[record.id]?.volume" :to="{ path: '/volume/' + record.volumeid }">{{ text }}</router-link> |
| 171 | + <span v-else>{{ text }}</span> |
171 | 172 | </template> |
172 | 173 | <template v-if="column.key === 'size'"> |
173 | 174 | <span v-if="text && $route.path === '/kubernetes'"> |
@@ -488,6 +489,7 @@ import TooltipButton from '@/components/widgets/TooltipButton' |
488 | 489 | import ResourceIcon from '@/components/view/ResourceIcon' |
489 | 490 | import ResourceLabel from '@/components/widgets/ResourceLabel' |
490 | 491 | import { createPathBasedOnVmType } from '@/utils/plugins' |
| 492 | +import { validateLinks } from '@/utils/links' |
491 | 493 | import cronstrue from 'cronstrue/i18n' |
492 | 494 | import moment from 'moment-timezone' |
493 | 495 |
|
@@ -576,6 +578,18 @@ export default { |
576 | 578 | notification: 'storageallocatedthreshold', |
577 | 579 | disable: 'storageallocateddisablethreshold' |
578 | 580 | } |
| 581 | + }, |
| 582 | + resourceIdToValidLinksMap: {} |
| 583 | + } |
| 584 | + }, |
| 585 | + watch: { |
| 586 | + items: { |
| 587 | + deep: true, |
| 588 | + handler (newData, oldData) { |
| 589 | + if (newData === oldData) return |
| 590 | + this.items.forEach(record => { |
| 591 | + this.resourceIdToValidLinksMap[record.id] = validateLinks(this.$router, false, record) |
| 592 | + }) |
579 | 593 | } |
580 | 594 | } |
581 | 595 | }, |
|
0 commit comments