diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index 0c87502a44e..e7c479ae43d 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -123,6 +123,7 @@ :filterOption="filterOption" :options="hostSelectOptions" :loading="loading.hosts" + @change="onSelectHostId" > @@ -1185,7 +1186,7 @@ export default { }) options.unshift({ label: this.$t('label.default'), - value: undefined + value: null }) return options }, @@ -1198,7 +1199,7 @@ export default { }) options.unshift({ label: this.$t('label.default'), - value: undefined + value: null }) return options }, @@ -1211,7 +1212,7 @@ export default { }) options.unshift({ label: this.$t('label.default'), - value: undefined + value: null }) return options }, @@ -2411,15 +2412,27 @@ export default { }, onSelectPodId (value) { this.podId = value + if (this.podId === null) { + this.form.podid = undefined + } this.fetchOptions(this.params.clusters, 'clusters') this.fetchOptions(this.params.hosts, 'hosts') }, onSelectClusterId (value) { this.clusterId = value + if (this.clusterId === null) { + this.form.clusterid = undefined + } this.fetchOptions(this.params.hosts, 'hosts') }, + onSelectHostId (value) { + this.hostId = value + if (this.hostId === null) { + this.form.hostid = undefined + } + }, handleSearchFilter (name, options) { this.params[name].options = { ...this.params[name].options, ...options } this.fetchOptions(this.params[name], name)