diff --git a/ui/src/config/section/image.js b/ui/src/config/section/image.js index aeeec2c3758d..b5739b1df665 100644 --- a/ui/src/config/section/image.js +++ b/ui/src/config/section/image.js @@ -110,16 +110,27 @@ export default { docHelp: 'adminguide/templates.html#uploading-templates-from-a-remote-http-server', listView: true, popup: true, + show: () => { + if (!store.getters.zones || store.getters.zones.length === 0) { + return false + } + return true + }, component: shallowRef(defineAsyncComponent(() => import('@/views/image/RegisterOrUploadTemplate.vue'))) }, { api: 'registerTemplate', icon: 'cloud-upload-outlined', label: 'label.upload.template.from.local', - show: () => { return 'getUploadParamsForTemplate' in store.getters.apis }, docHelp: 'adminguide/templates.html#uploading-templates-and-isos-from-a-local-computer', listView: true, popup: true, + show: () => { + if (!store.getters.zones || store.getters.zones.length === 0) { + return false + } + return 'getUploadParamsForTemplate' in store.getters.apis + }, component: shallowRef(defineAsyncComponent(() => import('@/views/image/RegisterOrUploadTemplate.vue'))) }, { diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index 72eb17e0ae97..990d29817fcd 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -242,6 +242,12 @@ export default { icon: 'plus-outlined', label: 'label.add.vpc', docHelp: 'adminguide/networking_and_traffic.html#adding-a-virtual-private-cloud', + show: () => { + if (!store.getters.zones || store.getters.zones.length === 0) { + return false + } + return true + }, listView: true, popup: true, component: shallowRef(defineAsyncComponent(() => import('@/views/network/CreateVpc.vue'))) diff --git a/ui/src/config/section/storage.js b/ui/src/config/section/storage.js index 28c451105a11..5af740714556 100644 --- a/ui/src/config/section/storage.js +++ b/ui/src/config/section/storage.js @@ -103,6 +103,12 @@ export default { icon: 'plus-outlined', docHelp: 'adminguide/storage.html#creating-a-new-volume', label: 'label.action.create.volume', + show: () => { + if (!store.getters.zones || store.getters.zones.length === 0) { + return false + } + return true + }, listView: true, popup: true, component: shallowRef(defineAsyncComponent(() => import('@/views/storage/CreateVolume.vue'))) @@ -112,7 +118,12 @@ export default { icon: 'cloud-upload-outlined', docHelp: 'adminguide/storage.html#uploading-an-existing-volume-to-a-virtual-machine', label: 'label.upload.volume.from.local', - show: () => { return 'getUploadParamsForVolume' in store.getters.apis }, + show: () => { + if (!store.getters.zones || store.getters.zones.length === 0) { + return false + } + return 'getUploadParamsForVolume' in store.getters.apis + }, listView: true, popup: true, component: shallowRef(defineAsyncComponent(() => import('@/views/storage/UploadLocalVolume.vue'))) @@ -122,6 +133,12 @@ export default { icon: 'link-outlined', docHelp: 'adminguide/storage.html#uploading-an-existing-volume-to-a-virtual-machine', label: 'label.upload.volume.from.url', + show: () => { + if (!store.getters.zones || store.getters.zones.length === 0) { + return false + } + return true + }, listView: true, popup: true, component: shallowRef(defineAsyncComponent(() => import('@/views/storage/UploadVolume.vue')))