Skip to content

Commit 2244c01

Browse files
committed
ui: avoid 404 after deleting template zones
1 parent c79b33c commit 2244c01

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

ui/src/views/image/TemplateZones.vue

Lines changed: 14 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>
@@ -139,7 +139,13 @@
139139
:pageSize="pageSize"
140140
:total="itemCount"
141141
:showTotal="total => `${$t('label.total')} ${total} ${$t('label.items')}`"
142-
:pageSizeOptions="['10', '20', '40', '80', '100']"
142+
:pageSizeOptions="[
143+
'10',
144+
'20',
145+
'40',
146+
'80',
147+
'100'
148+
]"
143149
@change="handleChangePage"
144150
@showSizeChange="handleChangePageSize"
145151
showSizeChanger>
@@ -217,7 +223,9 @@
217223
<a-alert type="error">
218224
<template #message>
219225
<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>`" />
226+
<span
227+
style="padding-left: 5px"
228+
v-html="'<b>' + selectedRowKeys.length + ' ' + $t('label.items.selected') + '. </b>'" />
221229
<span v-html="$t(message.confirmMessage)" />
222230
</template>
223231
</a-alert>
@@ -391,10 +399,10 @@ export default {
391399
},
392400
computed: {
393401
isActionsOnTemplatePermitted () {
394-
return (['Admin'].includes(this.$store.getters.userInfo.roletype) || // If admin or owner or belongs to current project
402+
return (['Admin'].includes(this.$store.getters.userInfo.roletype) ||
395403
(this.resource.domainid === this.$store.getters.userInfo.domainid && this.resource.account === this.$store.getters.userInfo.account) ||
396404
(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
405+
(this.resource.isready || !this.resource.status || this.resource.status.indexOf('Downloaded') === -1) &&
398406
this.resource.templatetype !== 'SYSTEM'
399407
}
400408
},

0 commit comments

Comments
 (0)