mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
fix: dynamic get VM's machine type API endpoint (#349)
* fix: update API endpoint * fix: remove redudant slash --------- Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
parent
717258defd
commit
3694b316ab
@ -296,9 +296,20 @@ export default {
|
||||
|
||||
async created() {
|
||||
await this.$store.dispatch(`${ this.inStore }/findAll`, { type: SECRET });
|
||||
const machineTypes = this.value.vmMachineTypesFeatureEnabled ? await this.$store.dispatch('harvester/request', { url: '/v1/harvester/clusters/local?link=machineTypes' }) : [''];
|
||||
|
||||
if (this.value.vmMachineTypesFeatureEnabled) {
|
||||
try {
|
||||
const url = this.$store.getters['harvester-common/getHarvesterClusterUrl']('v1/harvester/clusters/local?link=machineTypes');
|
||||
const machineTypes = await this.$store.dispatch('harvester/request', { url });
|
||||
|
||||
this.machineTypes = machineTypes;
|
||||
} catch (err) {
|
||||
this.machineTypes = [''];
|
||||
}
|
||||
} else {
|
||||
this.machineTypes = [''];
|
||||
}
|
||||
|
||||
this.getInitConfig({ value: this.value, init: this.isCreate });
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user