This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git
The following commit(s) were added to refs/heads/master by this push: new f8532ba autogen: Fix page navigation error when delete template. (#599) f8532ba is described below commit f8532ba3742bd78825408ade1b88376c736c591e Author: Hoang Nguyen <hoan...@unitech.vn> AuthorDate: Thu Aug 20 16:52:20 2020 +0700 autogen: Fix page navigation error when delete template. (#599) * Fix page navigation error when delete template. * removed double `!` syntax Fixes #598 --- src/views/AutogenView.vue | 4 ++++ src/views/image/TemplateZones.vue | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/AutogenView.vue b/src/views/AutogenView.vue index cba2607..4acf522 100644 --- a/src/views/AutogenView.vue +++ b/src/views/AutogenView.vue @@ -606,6 +606,10 @@ export default { if (this.items.length > 0) { this.resource = this.items[0] this.$emit('change-resource', this.resource) + } else { + if (this.dataView) { + this.$router.push({ path: '/exception/404' }) + } } }).catch(error => { if (Object.keys(this.searchParams).length > 0) { diff --git a/src/views/image/TemplateZones.vue b/src/views/image/TemplateZones.vue index 00e7af2..f4ea28a 100644 --- a/src/views/image/TemplateZones.vue +++ b/src/views/image/TemplateZones.vue @@ -266,7 +266,10 @@ export default { jobId, successMethod: result => { if (singleZone) { - this.$router.go(-1) + const isResourcePage = (this.$route.params && this.$route.params.id) + if (isResourcePage) { + this.$router.go(-1) + } } else { this.fetchData() }