@@ -482,37 +482,60 @@ export default {
}
this.listInstances()
this.listEvents()
- this.loading = true
- api('listKubernetesClusters', { listall: true, page: 1, pagesize: 1 }).then(json => {
- this.loading = false
- this.data.kubernetes = json?.listkubernetesclustersresponse?.count
- })
- api('listVolumes', { listall: true, page: 1, pagesize: 1 }).then(json => {
- this.loading = false
- this.data.volumes = json?.listvolumesresponse?.count
- })
- api('listSnapshots', { listall: true, page: 1, pagesize: 1 }).then(json => {
- this.loading = false
- this.data.snapshots = json?.listsnapshotsresponse?.count
- })
- api('listNetworks', { listall: true, page: 1, pagesize: 1 }).then(json => {
- this.loading = false
- this.data.networks = json?.listnetworksresponse?.count
- })
- api('listVPCs', { listall: true, page: 1, pagesize: 1 }).then(json => {
- this.loading = false
- this.data.vpcs = json?.listvpcsresponse?.count
- })
- api('listPublicIpAddresses', { listall: true, page: 1, pagesize: 1 }).then(json => {
- this.loading = false
- this.data.ips = json?.listpublicipaddressesresponse?.count
- })
- api('listTemplates', { templatefilter: 'self', listall: true, page: 1, pagesize: 1 }).then(json => {
- this.loading = false
- this.data.templates = json?.listtemplatesresponse?.count
- })
+ if ('listKubernetesClusters' in this.$store.getters.apis) {
+ this.loading = true
+ api('listKubernetesClusters', { listall: true, page: 1, pagesize: 1 }).then(json => {
+ this.loading = false
+ this.data.kubernetes = json?.listkubernetesclustersresponse?.count
+ })
+ }
+ if ('listVolumes' in this.$store.getters.apis) {
+ this.loading = true
+ api('listVolumes', { listall: true, page: 1, pagesize: 1 }).then(json => {
+ this.loading = false
+ this.data.volumes = json?.listvolumesresponse?.count
+ })
+ }
+ if ('listSnapshots' in this.$store.getters.apis) {
+ this.loading = true
+ api('listSnapshots', { listall: true, page: 1, pagesize: 1 }).then(json => {
+ this.loading = false
+ this.data.snapshots = json?.listsnapshotsresponse?.count
+ })
+ }
+ if ('listNetworks' in this.$store.getters.apis) {
+ this.loading = true
+ api('listNetworks', { listall: true, page: 1, pagesize: 1 }).then(json => {
+ this.loading = false
+ this.data.networks = json?.listnetworksresponse?.count
+ })
+ }
+ if ('listVPCs' in this.$store.getters.apis) {
+ this.loading = true
+ api('listVPCs', { listall: true, page: 1, pagesize: 1 }).then(json => {
+ this.loading = false
+ this.data.vpcs = json?.listvpcsresponse?.count
+ })
+ }
+ if ('listPublicIpAddresses' in this.$store.getters.apis) {
+ this.loading = true
+ api('listPublicIpAddresses', { listall: true, page: 1, pagesize: 1 }).then(json => {
+ this.loading = false
+ this.data.ips = json?.listpublicipaddressesresponse?.count
+ })
+ }
+ if ('listTemplates' in this.$store.getters.apis) {
+ this.loading = true
+ api('listTemplates', { templatefilter: 'self', listall: true, page: 1, pagesize: 1 }).then(json => {
+ this.loading = false
+ this.data.templates = json?.listtemplatesresponse?.count
+ })
+ }
},
- listInstances (zone) {
+ listInstances () {
+ if (!('listVirtualMachines' in this.$store.getters.apis)) {
+ return
+ }
this.loading = true
api('listVirtualMachines', { listall: true, details: 'min', page: 1, pagesize: 1 }).then(json => {
this.loading = false
@@ -528,6 +551,9 @@ export default {
})
},
listEvents () {
+ if (!('listEvents' in this.$store.getters.apis)) {
+ return
+ }
const params = {
page: 1,
pagesize: 8,