ui: avoid 404 after deleting template zones (#12681)

This commit is contained in:
Dheeraj Bansal 2026-03-09 18:59:12 +05:30 committed by GitHub
parent db83622956
commit 7aa0558c5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -91,7 +91,7 @@
:rowKey="record => record.datastoreId">
<template #bodyCell="{ text, record, column }">
<template v-if="column.dataIndex === 'datastore' && record.datastoreId">
<router-link :to="{ path: '/storagepool/' + encodeURIComponent(record.datastoreId) }">
<router-link :to="{ path: '/storagepool/' + encodeURIComponent(record.datastoreId) }">
{{ text }}
</router-link>
</template>
@ -107,7 +107,7 @@
:rowKey="record => record.datastoreId">
<template #bodyCell="{ text, record, column }">
<template v-if="column.dataIndex === 'datastore' && record.datastoreId">
<router-link :to="{ path: '/imagestore/' + record.datastoreId }">
<router-link :to="{ path: '/imagestore/' + record.datastoreId }">
{{ text }}
</router-link>
</template>
@ -217,7 +217,9 @@
<a-alert type="error">
<template #message>
<exclamation-circle-outlined style="color: red; fontSize: 30px; display: inline-flex" />
<span style="padding-left: 5px" v-html="`<b>${selectedRowKeys.length} ` + $t('label.items.selected') + `. </b>`" />
<span
style="padding-left: 5px"
v-html="`<b>${selectedRowKeys.length} ` + $t('label.items.selected') + `. </b>`" />
<span v-html="$t(message.confirmMessage)" />
</template>
</a-alert>
@ -391,10 +393,10 @@ export default {
},
computed: {
isActionsOnTemplatePermitted () {
return (['Admin'].includes(this.$store.getters.userInfo.roletype) || // If admin or owner or belongs to current project
return (['Admin'].includes(this.$store.getters.userInfo.roletype) ||
(this.resource.domainid === this.$store.getters.userInfo.domainid && this.resource.account === this.$store.getters.userInfo.account) ||
(this.resource.domainid === this.$store.getters.userInfo.domainid && this.resource.projectid && this.$store.getters.project && this.$store.getters.project.id && this.resource.projectid === this.$store.getters.project.id)) &&
(this.resource.isready || !this.resource.status || this.resource.status.indexOf('Downloaded') === -1) && // Template is ready or downloaded
(this.resource.isready || !this.resource.status || this.resource.status.indexOf('Downloaded') === -1) &&
this.resource.templatetype !== 'SYSTEM'
}
},
@ -476,7 +478,7 @@ export default {
this.showTable = false
this.fetchData()
if (this.dataSource.length === 0) {
this.$router.go(-1)
this.$router.push({ path: '/template' })
}
},
getOkProps () {