Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ui/src/views/image/TemplateZones.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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'
}
},
Comment on lines 393 to 402
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR description claims to fix a 404 issue after bulk deleting template zones by redirecting to the Templates list view when all zones are deleted. However, the diff only contains formatting changes with no actual logic modifications to address this issue. The actual bug fix for the 404 navigation issue is missing from this PR. The handleCancel method (around line 486) still uses this.$router.go(-1) which goes back in browser history and could lead to a 404 page. It should be changed to this.$router.push({ path: '/template' }) to explicitly redirect to the Templates list.

Copilot uses AI. Check for mistakes.
Expand Down Expand Up @@ -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 () {
Expand Down
Loading