Skip to content

Commit 7aa0558

Browse files
authored
ui: avoid 404 after deleting template zones (#12681)
1 parent db83622 commit 7aa0558

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ui/src/views/image/TemplateZones.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
:rowKey="record => record.datastoreId">
9292
<template #bodyCell="{ text, record, column }">
9393
<template v-if="column.dataIndex === 'datastore' && record.datastoreId">
94-
<router-link :to="{ path: '/storagepool/' + encodeURIComponent(record.datastoreId) }">
94+
<router-link :to="{ path: '/storagepool/' + encodeURIComponent(record.datastoreId) }">
9595
{{ text }}
9696
</router-link>
9797
</template>
@@ -107,7 +107,7 @@
107107
:rowKey="record => record.datastoreId">
108108
<template #bodyCell="{ text, record, column }">
109109
<template v-if="column.dataIndex === 'datastore' && record.datastoreId">
110-
<router-link :to="{ path: '/imagestore/' + record.datastoreId }">
110+
<router-link :to="{ path: '/imagestore/' + record.datastoreId }">
111111
{{ text }}
112112
</router-link>
113113
</template>
@@ -217,7 +217,9 @@
217217
<a-alert type="error">
218218
<template #message>
219219
<exclamation-circle-outlined style="color: red; fontSize: 30px; display: inline-flex" />
220-
<span style="padding-left: 5px" v-html="`<b>${selectedRowKeys.length} ` + $t('label.items.selected') + `. </b>`" />
220+
<span
221+
style="padding-left: 5px"
222+
v-html="`<b>${selectedRowKeys.length} ` + $t('label.items.selected') + `. </b>`" />
221223
<span v-html="$t(message.confirmMessage)" />
222224
</template>
223225
</a-alert>
@@ -391,10 +393,10 @@ export default {
391393
},
392394
computed: {
393395
isActionsOnTemplatePermitted () {
394-
return (['Admin'].includes(this.$store.getters.userInfo.roletype) || // If admin or owner or belongs to current project
396+
return (['Admin'].includes(this.$store.getters.userInfo.roletype) ||
395397
(this.resource.domainid === this.$store.getters.userInfo.domainid && this.resource.account === this.$store.getters.userInfo.account) ||
396398
(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)) &&
397-
(this.resource.isready || !this.resource.status || this.resource.status.indexOf('Downloaded') === -1) && // Template is ready or downloaded
399+
(this.resource.isready || !this.resource.status || this.resource.status.indexOf('Downloaded') === -1) &&
398400
this.resource.templatetype !== 'SYSTEM'
399401
}
400402
},
@@ -476,7 +478,7 @@ export default {
476478
this.showTable = false
477479
this.fetchData()
478480
if (this.dataSource.length === 0) {
479-
this.$router.go(-1)
481+
this.$router.push({ path: '/template' })
480482
}
481483
},
482484
getOkProps () {

0 commit comments

Comments
 (0)