This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch 4.22
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.22 by this push:
new 7aa0558c5b9 ui: avoid 404 after deleting template zones (#12681)
7aa0558c5b9 is described below
commit 7aa0558c5b9127ef1633e151baf60ce7172ceaff
Author: Dheeraj Bansal <[email protected]>
AuthorDate: Mon Mar 9 18:59:12 2026 +0530
ui: avoid 404 after deleting template zones (#12681)
---
ui/src/views/image/TemplateZones.vue | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ui/src/views/image/TemplateZones.vue
b/ui/src/views/image/TemplateZones.vue
index e517aad5167..31b65e556a4 100644
--- a/ui/src/views/image/TemplateZones.vue
+++ b/ui/src/views/image/TemplateZones.vue
@@ -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 () {