diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index cba26077941..4acf5227c1b 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/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/ui/src/views/image/TemplateZones.vue b/ui/src/views/image/TemplateZones.vue index 00e7af2ed4f..f4ea28a21bd 100644 --- a/ui/src/views/image/TemplateZones.vue +++ b/ui/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() }