This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git
The following commit(s) were added to refs/heads/master by this push:
new e30aacf compute: fix list host, cluster not filtered in VM deployment
form (#378)
e30aacf is described below
commit e30aacf311b419f5153ac15e6731e1a64cc3446c
Author: Hoang Nguyen <[email protected]>
AuthorDate: Thu Jun 4 09:38:57 2020 +0700
compute: fix list host, cluster not filtered in VM deployment form (#378)
Fixes #376
---
src/views/compute/DeployVM.vue | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/views/compute/DeployVM.vue b/src/views/compute/DeployVM.vue
index d7b234f..09d36a3 100644
--- a/src/views/compute/DeployVM.vue
+++ b/src/views/compute/DeployVM.vue
@@ -51,6 +51,7 @@
v-decorator="['podid']"
:options="podSelectOptions"
:loading="loading.pods"
+ @change="onSelectPodId"
></a-select>
</a-form-item>
<a-form-item
@@ -60,6 +61,7 @@
v-decorator="['clusterid']"
:options="clusterSelectOptions"
:loading="loading.clusters"
+ @change="onSelectClusterId"
></a-select>
</a-form-item>
<a-form-item
@@ -348,6 +350,8 @@ export default {
data () {
return {
zoneId: '',
+ podId: null,
+ clusterId: null,
zoneSelected: false,
vm: {},
options: {
@@ -529,7 +533,8 @@ export default {
list: 'listClusters',
isLoad: !this.isNormalAndDomainUser,
options: {
- zoneid: _.get(this.zone, 'id')
+ zoneid: _.get(this.zone, 'id'),
+ podid: this.podId
},
field: 'clusterid'
},
@@ -538,6 +543,8 @@ export default {
isLoad: !this.isNormalAndDomainUser,
options: {
zoneid: _.get(this.zone, 'id'),
+ podid: this.podId,
+ clusterid: this.clusterId,
state: 'Up',
type: 'Routing'
},
@@ -1092,6 +1099,8 @@ export default {
onSelectZoneId (value) {
this.dataPreFill = {}
this.zoneId = value
+ this.podId = null
+ this.clusterId = null
this.zone = _.find(this.options.zones, (option) => option.id === value)
this.zoneSelected = true
this.form.setFieldsValue({
@@ -1109,6 +1118,17 @@ export default {
})
this.fetchAllTemplates()
},
+ onSelectPodId (value) {
+ this.podId = value
+
+ this.fetchOptions(this.params.clusters, 'clusters')
+ this.fetchOptions(this.params.hosts, 'hosts')
+ },
+ onSelectClusterId (value) {
+ this.clusterId = value
+
+ this.fetchOptions(this.params.hosts, 'hosts')
+ },
handleSearchFilter (name, options) {
this.params[name].options = { ...this.params[name].options, ...options }
this.fetchOptions(this.params[name], name)