Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide register template, create/upload volume and create vpc buttons when zone is not created. #10243

Open
wants to merge 1 commit into
base: 4.19
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 12 additions & 1 deletion ui/src/config/section/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')))
},
{
Expand Down
6 changes: 6 additions & 0 deletions ui/src/config/section/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')))
Expand Down
19 changes: 18 additions & 1 deletion ui/src/config/section/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')))
Expand All @@ -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')))
Expand All @@ -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')))
Expand Down
Loading