mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-05 05:36:05 +08: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:
@@ -296,9 +296,20 @@ export default {
|
|||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
await this.$store.dispatch(`${ this.inStore }/findAll`, { type: SECRET });
|
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' }) : [''];
|
|
||||||
|
|
||||||
this.machineTypes = 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 });
|
this.getInitConfig({ value: this.value, init: this.isCreate });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user