|
170 | 170 | <router-link :to="{ path: getVmRouteUsingType(record) + record.virtualmachineid }">{{ text }}</router-link> |
171 | 171 | </template> |
172 | 172 | <template v-if="column.key === 'volumename'"> |
173 | | - <router-link :to="{ path: '/volume/' + record.volumeid }">{{ text }}</router-link> |
| 173 | + <router-link v-if="resourceIdToValidLinksMap[record.id]?.volume" :to="{ path: '/volume/' + record.volumeid }">{{ text }}</router-link> |
| 174 | + <span v-else>{{ text }}</span> |
174 | 175 | </template> |
175 | 176 | <template v-if="column.key === 'size'"> |
176 | 177 | <span v-if="text && $route.path === '/kubernetes'"> |
@@ -530,6 +531,7 @@ import ResourceLabel from '@/components/widgets/ResourceLabel' |
530 | 531 | import Status from '@/components/widgets/Status' |
531 | 532 | import TooltipButton from '@/components/widgets/TooltipButton' |
532 | 533 | import { createPathBasedOnVmType } from '@/utils/plugins' |
| 534 | +import { validateLinks } from '@/utils/links' |
533 | 535 | import cronstrue from 'cronstrue/i18n' |
534 | 536 | import moment from 'moment-timezone' |
535 | 537 |
|
@@ -622,6 +624,18 @@ export default { |
622 | 624 | notification: 'storageallocatedthreshold', |
623 | 625 | disable: 'storageallocateddisablethreshold' |
624 | 626 | } |
| 627 | + }, |
| 628 | + resourceIdToValidLinksMap: {} |
| 629 | + } |
| 630 | + }, |
| 631 | + watch: { |
| 632 | + items: { |
| 633 | + deep: true, |
| 634 | + handler (newData, oldData) { |
| 635 | + if (newData === oldData) return |
| 636 | + this.items.forEach(record => { |
| 637 | + this.resourceIdToValidLinksMap[record.id] = validateLinks(this.$router, false, record) |
| 638 | + }) |
625 | 639 | } |
626 | 640 | } |
627 | 641 | }, |
|
0 commit comments