Date: Tue, 14 Apr 2020 15:33:32 +0700
Subject: [PATCH 19/24] fix: auto fill value input and select option
---
src/views/compute/DeployVM.vue | 100 ++++++++++--------
.../compute/wizard/AffinityGroupSelection.vue | 12 +--
.../wizard/ComputeOfferingSelection.vue | 12 +--
.../compute/wizard/DiskOfferingSelection.vue | 12 +--
src/views/compute/wizard/NetworkSelection.vue | 12 +--
.../compute/wizard/SshKeyPairSelection.vue | 12 +--
6 files changed, 86 insertions(+), 74 deletions(-)
diff --git a/src/views/compute/DeployVM.vue b/src/views/compute/DeployVM.vue
index 600704ef8..dd90923a9 100644
--- a/src/views/compute/DeployVM.vue
+++ b/src/views/compute/DeployVM.vue
@@ -107,12 +107,12 @@
:items="options.templates"
:selected="tabKey"
:loading="loading.templates"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
@update-template-iso="updateFieldValue"
>
@@ -121,7 +121,7 @@
:items="options.isos"
:selected="tabKey"
:loading="loading.isos"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
@update-template-iso="updateFieldValue"
>
@@ -160,7 +160,7 @@
:compute-items="options.serviceOfferings"
:value="serviceOffering ? serviceOffering.id : ''"
:loading="loading.serviceOfferings"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
@select-compute-item="($event) => updateComputeOffering($event)"
@handle-search-filter="($event) => handleSearchFilter('serviceOfferings', $event)"
>
@@ -169,7 +169,7 @@
cpunumber-input-decorator="cpunumber"
cpuspeed-input-decorator="cpuspeed"
memory-input-decorator="memory"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
:computeOfferingId="instanceConfig.computeofferingid"
:isConstrained="'serviceofferingdetails' in serviceOffering"
:minCpu="'serviceofferingdetails' in serviceOffering ? serviceOffering.serviceofferingdetails.mincpunumber*1 : 1"
@@ -204,14 +204,14 @@
:items="options.diskOfferings"
:value="diskOffering ? diskOffering.id : ''"
:loading="loading.diskOfferings"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
@select-disk-offering-item="($event) => updateDiskOffering($event)"
@handle-search-filter="($event) => handleSearchFilter('diskOfferings', $event)"
>
@@ -228,7 +228,7 @@
:items="options.affinityGroups"
:value="affinityGroupIds"
:loading="loading.affinityGroups"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
@select-affinity-group-item="($event) => updateAffinityGroups($event)"
@handle-search-filter="($event) => handleSearchFilter('affinityGroups', $event)"
>
@@ -245,14 +245,14 @@
:value="networkOfferingIds"
:loading="loading.networks"
:zoneId="zoneId"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
@select-network-item="($event) => updateNetworks($event)"
@handle-search-filter="($event) => handleSearchFilter('networks', $event)"
>
updateNetworkConfig($event)"
@select-default-network-item="($event) => updateDefaultNetworks($event)"
>
@@ -268,7 +268,7 @@
:items="options.sshKeyPairs"
:value="sshKeyPair ? sshKeyPair.name : ''"
:loading="loading.sshKeyPairs"
- :preFillContent="instanceConfig"
+ :preFillContent="dataPreFill"
@select-ssh-key-pair-item="($event) => updateSshKeyPairs($event)"
@handle-search-filter="($event) => handleSearchFilter('sshKeyPairs', $event)"
/>
@@ -345,6 +345,10 @@ export default {
props: {
visible: {
type: Boolean
+ },
+ preFillContent: {
+ type: Object,
+ default: () => {}
}
},
mixins: [mixin, mixinDevice],
@@ -430,7 +434,8 @@ export default {
tab: this.$t('ISOs')
}
],
- tabKey: 'templateid'
+ tabKey: 'templateid',
+ dataPreFill: {}
}
},
computed: {
@@ -477,13 +482,15 @@ export default {
},
zones: {
list: 'listZones',
- isLoad: true
+ isLoad: true,
+ field: 'zoneid'
},
hypervisors: {
list: 'listHypervisors',
options: {
zoneid: _.get(this.zone, 'id')
- }
+ },
+ field: 'hypervisor'
},
affinityGroups: {
list: 'listAffinityGroups',
@@ -520,14 +527,16 @@ export default {
isLoad: !this.isNormalAndDomainUser,
options: {
zoneid: _.get(this.zone, 'id')
- }
+ },
+ field: 'podid'
},
clusters: {
list: 'listClusters',
isLoad: !this.isNormalAndDomainUser,
options: {
zoneid: _.get(this.zone, 'id')
- }
+ },
+ field: 'clusterid'
},
hosts: {
list: 'listHosts',
@@ -536,11 +545,13 @@ export default {
zoneid: _.get(this.zone, 'id'),
state: 'Up',
type: 'Routing'
- }
+ },
+ field: 'hostid'
},
groups: {
list: 'listInstanceGroups',
- isLoad: true
+ isLoad: true,
+ field: 'group'
}
}
},
@@ -663,7 +674,7 @@ export default {
}
}
},
- beforeCreate () {
+ created () {
this.form = this.$form.createForm(this, {
onValuesChange: (props, fields) => {
if (fields.isoid) {
@@ -686,14 +697,9 @@ export default {
this.form.getFieldDecorator('cpunumber', { initialValue: undefined, preserve: true })
this.form.getFieldDecorator('cpuSpeed', { initialValue: undefined, preserve: true })
this.form.getFieldDecorator('memory', { initialValue: undefined, preserve: true })
- this.apiParams = {}
- this.apiDeployVirtualMachine = this.$store.getters.apis.deployVirtualMachine || {}
- this.apiDeployVirtualMachine.params.forEach(param => {
- this.apiParams[param.name] = param
- })
},
mounted () {
- this.fillValue()
+ this.dataPreFill = this.preFillContent && Object.keys(this.preFillContent).length > 0 ? this.preFillContent : {}
this.fetchData()
},
provide () {
@@ -704,37 +710,39 @@ export default {
}
},
methods: {
- fillValue () {
- this.form.getFieldDecorator('name', { initialValue: this.instanceConfig.name })
- this.form.getFieldDecorator('zoneid', { initialValue: this.instanceConfig.zoneid })
- this.form.getFieldDecorator('podid', { initialValue: this.instanceConfig.podid })
- this.form.getFieldDecorator('clusterid', { initialValue: this.instanceConfig.clusterid })
- this.form.getFieldDecorator('hostid', { initialValue: this.instanceConfig.hostid })
- this.form.getFieldDecorator('group', { initialValue: this.instanceConfig.group })
- this.form.getFieldDecorator('keyboard', { initialValue: this.instanceConfig.keyboard })
- this.form.getFieldDecorator('userdata', { initialValue: this.instanceConfig.userdata })
- this.form.getFieldDecorator('hypervisor', { initialValue: this.instanceConfig.hypervisor })
+ fillValue (field) {
+ this.form.getFieldDecorator([field], { initialValue: this.dataPreFill[field] })
},
- async fetchData () {
- const exclude = []
- if (this.instanceConfig.zoneid) {
- exclude.push('zones')
- this.options.zones = await this.fetchZones()
- await this.fetchOptions(this.params.groups, 'groups')
- await this.onSelectZoneId(this.instanceConfig.zoneid)
+ fetchData () {
+ if (this.dataPreFill.zoneid) {
+ this.fetchDataByZone(this.dataPreFill.zoneid)
} else {
- await _.each(this.params, (param, name) => {
+ _.each(this.params, (param, name) => {
if (param.isLoad) {
this.fetchOptions(param, name)
}
})
}
- await this.fetchKeyboard()
+ this.fetchKeyboard()
Vue.nextTick().then(() => {
+ ['name', 'keyboard', 'userdata'].forEach(this.fillValue)
this.instanceConfig = this.form.getFieldsValue() // ToDo: maybe initialize with some other defaults
})
},
+ async fetchDataByZone (zoneId) {
+ this.fillValue('zoneid')
+ this.options.zones = await this.fetchZones()
+ this.zoneId = zoneId
+ this.zoneSelected = true
+ this.tabKey = 'templateid'
+ await _.each(this.params, (param, name) => {
+ if (!('isLoad' in param) || param.isLoad) {
+ this.fetchOptions(param, name, ['zones'])
+ }
+ })
+ await this.fetchAllTemplates()
+ },
fetchKeyboard () {
const keyboardType = []
keyboardType.push({
@@ -986,6 +994,9 @@ export default {
param.opts = response
this.options[name] = response
this.$forceUpdate()
+ if (param.field) {
+ this.fillValue(param.field)
+ }
})
})
}).catch(function (error) {
@@ -1067,6 +1078,7 @@ export default {
})
},
onSelectZoneId (value) {
+ this.dataPreFill = {}
this.zoneId = value
this.zone = _.find(this.options.zones, (option) => option.id === value)
this.zoneSelected = true
diff --git a/src/views/compute/wizard/AffinityGroupSelection.vue b/src/views/compute/wizard/AffinityGroupSelection.vue
index 5d84dd0e4..a1733574b 100644
--- a/src/views/compute/wizard/AffinityGroupSelection.vue
+++ b/src/views/compute/wizard/AffinityGroupSelection.vue
@@ -95,17 +95,17 @@ export default {
}
}
},
- mounted () {
- if (this.preFillContent.affinitygroupids) {
- this.selectedRowKeys = this.preFillContent.affinitygroupids
- this.$emit('select-affinity-group-item', this.preFillContent.affinitygroupids)
- }
- },
watch: {
value (newValue, oldValue) {
if (newValue && !_.isEqual(newValue, oldValue)) {
this.selectedRowKeys = newValue
}
+ },
+ loading () {
+ if (!this.loading && this.preFillContent.affinitygroupids) {
+ this.selectedRowKeys = this.preFillContent.affinitygroupids
+ this.$emit('select-affinity-group-item', this.preFillContent.affinitygroupids)
+ }
}
},
methods: {
diff --git a/src/views/compute/wizard/ComputeOfferingSelection.vue b/src/views/compute/wizard/ComputeOfferingSelection.vue
index c8f8d00ea..b2b345e11 100644
--- a/src/views/compute/wizard/ComputeOfferingSelection.vue
+++ b/src/views/compute/wizard/ComputeOfferingSelection.vue
@@ -125,17 +125,17 @@ export default {
}
}
},
- mounted () {
- if (this.preFillContent.computeofferingid) {
- this.selectedRowKeys = [this.preFillContent.computeofferingid]
- this.$emit('select-compute-item', this.preFillContent.computeofferingid)
- }
- },
watch: {
value (newValue, oldValue) {
if (newValue && newValue !== oldValue) {
this.selectedRowKeys = [newValue]
}
+ },
+ loading () {
+ if (!this.loading && this.preFillContent.computeofferingid) {
+ this.selectedRowKeys = [this.preFillContent.computeofferingid]
+ this.$emit('select-compute-item', this.preFillContent.computeofferingid)
+ }
}
},
methods: {
diff --git a/src/views/compute/wizard/DiskOfferingSelection.vue b/src/views/compute/wizard/DiskOfferingSelection.vue
index 8ff3158f8..6ca13ee53 100644
--- a/src/views/compute/wizard/DiskOfferingSelection.vue
+++ b/src/views/compute/wizard/DiskOfferingSelection.vue
@@ -127,12 +127,6 @@ export default {
}
}
},
- mounted () {
- if (this.preFillContent.diskofferingid) {
- this.selectedRowKeys = [this.preFillContent.diskofferingid]
- this.$emit('select-disk-offering-item', this.preFillContent.diskofferingid)
- }
- },
watch: {
value (newValue, oldValue) {
if (newValue && newValue !== oldValue) {
@@ -144,6 +138,12 @@ export default {
this.initDataItem()
this.dataItems = this.dataItems.concat(newData)
}
+ },
+ loading () {
+ if (!this.loading && this.preFillContent.diskofferingid) {
+ this.selectedRowKeys = [this.preFillContent.diskofferingid]
+ this.$emit('select-disk-offering-item', this.preFillContent.diskofferingid)
+ }
}
},
methods: {
diff --git a/src/views/compute/wizard/NetworkSelection.vue b/src/views/compute/wizard/NetworkSelection.vue
index 988f2167d..67c5d468c 100644
--- a/src/views/compute/wizard/NetworkSelection.vue
+++ b/src/views/compute/wizard/NetworkSelection.vue
@@ -141,12 +141,6 @@ export default {
}
}
},
- mounted () {
- if (this.preFillContent.networkids) {
- this.selectedRowKeys = this.preFillContent.networkids
- this.$emit('select-network-item', this.preFillContent.networkids)
- }
- },
computed: {
options () {
return {
@@ -214,6 +208,12 @@ export default {
if (newValue && !_.isEqual(newValue, oldValue)) {
this.selectedRowKeys = newValue
}
+ },
+ loading () {
+ if (!this.loading && this.preFillContent.networkids) {
+ this.selectedRowKeys = this.preFillContent.networkids
+ this.$emit('select-network-item', this.preFillContent.networkids)
+ }
}
},
beforeCreate () {
diff --git a/src/views/compute/wizard/SshKeyPairSelection.vue b/src/views/compute/wizard/SshKeyPairSelection.vue
index 5bdcda729..3fa5065c6 100644
--- a/src/views/compute/wizard/SshKeyPairSelection.vue
+++ b/src/views/compute/wizard/SshKeyPairSelection.vue
@@ -86,12 +86,6 @@ export default {
created () {
this.initDataItem()
},
- mounted () {
- if (this.preFillContent.keypair) {
- this.selectedRowKeys = [this.preFillContent.keypair]
- this.$emit('select-ssh-key-pair-item', this.preFillContent.keypair)
- }
- },
computed: {
options () {
return {
@@ -129,6 +123,12 @@ export default {
this.initDataItem()
this.dataItems = this.dataItems.concat(newData)
}
+ },
+ loading () {
+ if (!this.loading && this.preFillContent.keypair) {
+ this.selectedRowKeys = [this.preFillContent.keypair]
+ this.$emit('select-ssh-key-pair-item', this.preFillContent.keypair)
+ }
}
},
methods: {
From 2055b04679718f666532030fa162cd6449583028 Mon Sep 17 00:00:00 2001
From: utchoang
Date: Tue, 21 Apr 2020 10:30:23 +0700
Subject: [PATCH 20/24] Fixes issues for multi-zone setup
---
src/locales/en.json | 5 ++---
src/views/compute/wizard/AffinityGroupSelection.vue | 11 ++++++++---
src/views/compute/wizard/ComputeOfferingSelection.vue | 11 ++++++++---
src/views/compute/wizard/DiskOfferingSelection.vue | 11 ++++++++---
src/views/compute/wizard/NetworkSelection.vue | 11 ++++++++---
src/views/compute/wizard/SshKeyPairSelection.vue | 11 ++++++++---
6 files changed, 42 insertions(+), 18 deletions(-)
diff --git a/src/locales/en.json b/src/locales/en.json
index a33984697..df976e55f 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -1268,7 +1268,6 @@
"featured": "Featured",
"community": "Community",
"selfexecutable": "Self",
-"sharedexecutable": "Shared"
-"label.zone": "Zone",
-"error.something.went.wrong.please.correct.the.following": "Something went wrong; please correct the following"
+"sharedexecutable": "Shared",
+"label.zone": "Zone"
}
diff --git a/src/views/compute/wizard/AffinityGroupSelection.vue b/src/views/compute/wizard/AffinityGroupSelection.vue
index a1733574b..9c2535500 100644
--- a/src/views/compute/wizard/AffinityGroupSelection.vue
+++ b/src/views/compute/wizard/AffinityGroupSelection.vue
@@ -102,9 +102,14 @@ export default {
}
},
loading () {
- if (!this.loading && this.preFillContent.affinitygroupids) {
- this.selectedRowKeys = this.preFillContent.affinitygroupids
- this.$emit('select-affinity-group-item', this.preFillContent.affinitygroupids)
+ if (!this.loading) {
+ if (this.preFillContent.affinitygroupids) {
+ this.selectedRowKeys = this.preFillContent.affinitygroupids
+ this.$emit('select-affinity-group-item', this.preFillContent.affinitygroupids)
+ } else {
+ this.selectedRowKeys = []
+ this.$emit('select-affinity-group-item', null)
+ }
}
}
},
diff --git a/src/views/compute/wizard/ComputeOfferingSelection.vue b/src/views/compute/wizard/ComputeOfferingSelection.vue
index b2b345e11..4403ee494 100644
--- a/src/views/compute/wizard/ComputeOfferingSelection.vue
+++ b/src/views/compute/wizard/ComputeOfferingSelection.vue
@@ -132,9 +132,14 @@ export default {
}
},
loading () {
- if (!this.loading && this.preFillContent.computeofferingid) {
- this.selectedRowKeys = [this.preFillContent.computeofferingid]
- this.$emit('select-compute-item', this.preFillContent.computeofferingid)
+ if (!this.loading) {
+ if (this.preFillContent.computeofferingid) {
+ this.selectedRowKeys = [this.preFillContent.computeofferingid]
+ this.$emit('select-compute-item', this.preFillContent.computeofferingid)
+ } else {
+ this.selectedRowKeys = []
+ this.$emit('select-compute-item', null)
+ }
}
}
},
diff --git a/src/views/compute/wizard/DiskOfferingSelection.vue b/src/views/compute/wizard/DiskOfferingSelection.vue
index 6ca13ee53..78b06efac 100644
--- a/src/views/compute/wizard/DiskOfferingSelection.vue
+++ b/src/views/compute/wizard/DiskOfferingSelection.vue
@@ -140,9 +140,14 @@ export default {
}
},
loading () {
- if (!this.loading && this.preFillContent.diskofferingid) {
- this.selectedRowKeys = [this.preFillContent.diskofferingid]
- this.$emit('select-disk-offering-item', this.preFillContent.diskofferingid)
+ if (!this.loading) {
+ if (this.preFillContent.diskofferingid) {
+ this.selectedRowKeys = [this.preFillContent.diskofferingid]
+ this.$emit('select-disk-offering-item', this.preFillContent.diskofferingid)
+ } else {
+ this.selectedRowKeys = ['0']
+ this.$emit('select-disk-offering-item', '0')
+ }
}
}
},
diff --git a/src/views/compute/wizard/NetworkSelection.vue b/src/views/compute/wizard/NetworkSelection.vue
index 67c5d468c..3cf3c383c 100644
--- a/src/views/compute/wizard/NetworkSelection.vue
+++ b/src/views/compute/wizard/NetworkSelection.vue
@@ -210,9 +210,14 @@ export default {
}
},
loading () {
- if (!this.loading && this.preFillContent.networkids) {
- this.selectedRowKeys = this.preFillContent.networkids
- this.$emit('select-network-item', this.preFillContent.networkids)
+ if (!this.loading) {
+ if (this.preFillContent.networkids) {
+ this.selectedRowKeys = this.preFillContent.networkids
+ this.$emit('select-network-item', this.preFillContent.networkids)
+ } else {
+ this.selectedRowKeys = []
+ this.$emit('select-network-item', null)
+ }
}
}
},
diff --git a/src/views/compute/wizard/SshKeyPairSelection.vue b/src/views/compute/wizard/SshKeyPairSelection.vue
index 3fa5065c6..f443cfcc9 100644
--- a/src/views/compute/wizard/SshKeyPairSelection.vue
+++ b/src/views/compute/wizard/SshKeyPairSelection.vue
@@ -125,9 +125,14 @@ export default {
}
},
loading () {
- if (!this.loading && this.preFillContent.keypair) {
- this.selectedRowKeys = [this.preFillContent.keypair]
- this.$emit('select-ssh-key-pair-item', this.preFillContent.keypair)
+ if (!this.loading) {
+ if (this.preFillContent.keypair) {
+ this.selectedRowKeys = [this.preFillContent.keypair]
+ this.$emit('select-ssh-key-pair-item', this.preFillContent.keypair)
+ } else {
+ this.selectedRowKeys = [this.$t('noselect')]
+ this.$emit('select-ssh-key-pair-item', this.$t('noselect'))
+ }
}
}
},
From 3325e3155980b057cd6f13dcbde730556747cce5 Mon Sep 17 00:00:00 2001
From: utchoang
Date: Tue, 21 Apr 2020 14:13:41 +0700
Subject: [PATCH 21/24] Fix error when do not select affinity groups
---
src/views/compute/DeployVM.vue | 2 +-
src/views/compute/wizard/ComputeOfferingSelection.vue | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/views/compute/DeployVM.vue b/src/views/compute/DeployVM.vue
index dd90923a9..a3429379c 100644
--- a/src/views/compute/DeployVM.vue
+++ b/src/views/compute/DeployVM.vue
@@ -896,7 +896,7 @@ export default {
deployVmData.size = values.size
}
// step 5: select an affinity group
- deployVmData.affinitygroupids = values.affinitygroupids.join(',')
+ deployVmData.affinitygroupids = values.affinitygroupids.length > 0 ? values.affinitygroupids.join(',') : null
// step 6: select network
if (values.networkids && values.networkids.length > 0) {
for (let i = 0; i < values.networkids.length; i++) {
diff --git a/src/views/compute/wizard/ComputeOfferingSelection.vue b/src/views/compute/wizard/ComputeOfferingSelection.vue
index 4403ee494..4e9c2ac1a 100644
--- a/src/views/compute/wizard/ComputeOfferingSelection.vue
+++ b/src/views/compute/wizard/ComputeOfferingSelection.vue
@@ -137,8 +137,8 @@ export default {
this.selectedRowKeys = [this.preFillContent.computeofferingid]
this.$emit('select-compute-item', this.preFillContent.computeofferingid)
} else {
- this.selectedRowKeys = []
- this.$emit('select-compute-item', null)
+ this.selectedRowKeys = [this.computeItems[0].id]
+ this.$emit('select-compute-item', this.computeItems[0].id)
}
}
}
From d08fc960ff87c682e9208f8aff51a183e7b96e6a Mon Sep 17 00:00:00 2001
From: utchoang
Date: Tue, 21 Apr 2020 14:26:34 +0700
Subject: [PATCH 22/24] Fix Quota Email template: Search is not working
---
src/views/AutogenView.vue | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/views/AutogenView.vue b/src/views/AutogenView.vue
index 47b10af04..07f471fcc 100644
--- a/src/views/AutogenView.vue
+++ b/src/views/AutogenView.vue
@@ -396,6 +396,8 @@ export default {
if (this.searchQuery !== '') {
if (this.apiName === 'listRoles') {
params.name = this.searchQuery
+ } else if (this.apiName === 'quotaEmailTemplateList') {
+ params.templatetype = this.searchQuery
} else {
params.keyword = this.searchQuery
}
From b65455cd1d92e2c11eb06b67b994333d087f35f4 Mon Sep 17 00:00:00 2001
From: utchoang
Date: Tue, 21 Apr 2020 14:26:51 +0700
Subject: [PATCH 23/24] Revert "Fix error when do not select affinity groups"
This reverts commit 3325e3155980b057cd6f13dcbde730556747cce5.
---
src/views/compute/DeployVM.vue | 2 +-
src/views/compute/wizard/ComputeOfferingSelection.vue | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/views/compute/DeployVM.vue b/src/views/compute/DeployVM.vue
index a3429379c..dd90923a9 100644
--- a/src/views/compute/DeployVM.vue
+++ b/src/views/compute/DeployVM.vue
@@ -896,7 +896,7 @@ export default {
deployVmData.size = values.size
}
// step 5: select an affinity group
- deployVmData.affinitygroupids = values.affinitygroupids.length > 0 ? values.affinitygroupids.join(',') : null
+ deployVmData.affinitygroupids = values.affinitygroupids.join(',')
// step 6: select network
if (values.networkids && values.networkids.length > 0) {
for (let i = 0; i < values.networkids.length; i++) {
diff --git a/src/views/compute/wizard/ComputeOfferingSelection.vue b/src/views/compute/wizard/ComputeOfferingSelection.vue
index 4e9c2ac1a..4403ee494 100644
--- a/src/views/compute/wizard/ComputeOfferingSelection.vue
+++ b/src/views/compute/wizard/ComputeOfferingSelection.vue
@@ -137,8 +137,8 @@ export default {
this.selectedRowKeys = [this.preFillContent.computeofferingid]
this.$emit('select-compute-item', this.preFillContent.computeofferingid)
} else {
- this.selectedRowKeys = [this.computeItems[0].id]
- this.$emit('select-compute-item', this.computeItems[0].id)
+ this.selectedRowKeys = []
+ this.$emit('select-compute-item', null)
}
}
}
From d16485b515d2ec815c27889fd745b16d5da5e802 Mon Sep 17 00:00:00 2001
From: Rohit Yadav
Date: Wed, 22 Apr 2020 14:39:17 +0530
Subject: [PATCH 24/24] fixes
Signed-off-by: Rohit Yadav
---
src/components/header/ProjectMenu.vue | 4 +-
src/views/compute/DeployVM.vue | 16 ++--
.../compute/wizard/DiskSizeSelection.vue | 17 ++--
.../compute/wizard/NetworkConfiguration.vue | 4 +-
src/views/compute/wizard/NetworkSelection.vue | 90 -------------------
5 files changed, 24 insertions(+), 107 deletions(-)
diff --git a/src/components/header/ProjectMenu.vue b/src/components/header/ProjectMenu.vue
index 2c922d18a..f3ea38bb9 100644
--- a/src/components/header/ProjectMenu.vue
+++ b/src/components/header/ProjectMenu.vue
@@ -67,9 +67,9 @@ export default {
if (json && json.listprojectsresponse && json.listprojectsresponse.project) {
this.projects.push(...json.listprojectsresponse.project)
}
- const currentProject = Vue.ls.get(CURRENT_PROJECT)
+ const currentProject = Vue.ls.get(CURRENT_PROJECT) || {}
for (var project of this.projects) {
- if (project.id === currentProject.id) {
+ if (project && currentProject && project.id === currentProject.id) {
this.setSelectedProject(project)
break
}
diff --git a/src/views/compute/DeployVM.vue b/src/views/compute/DeployVM.vue
index dd90923a9..d7b7eee90 100644
--- a/src/views/compute/DeployVM.vue
+++ b/src/views/compute/DeployVM.vue
@@ -497,16 +497,17 @@ export default {
options: {
page: 1,
pageSize: 10,
- keyword: undefined
+ keyword: undefined,
+ listall: false
}
},
sshKeyPairs: {
list: 'listSSHKeyPairs',
options: {
- zoneid: _.get(this.zone, 'id'),
page: 1,
pageSize: 10,
- keyword: undefined
+ keyword: undefined,
+ listall: false
}
},
networks: {
@@ -550,6 +551,9 @@ export default {
},
groups: {
list: 'listInstanceGroups',
+ options: {
+ listall: false
+ },
isLoad: true,
field: 'group'
}
@@ -896,7 +900,7 @@ export default {
deployVmData.size = values.size
}
// step 5: select an affinity group
- deployVmData.affinitygroupids = values.affinitygroupids.join(',')
+ deployVmData.affinitygroupids = (values.affinitygroupids || []).join(',')
// step 6: select network
if (values.networkids && values.networkids.length > 0) {
for (let i = 0; i < values.networkids.length; i++) {
@@ -975,7 +979,9 @@ export default {
param.loading = true
param.opts = []
const options = param.options || {}
- options.listall = true
+ if (!('listall' in options)) {
+ options.listall = true
+ }
api(param.list, options).then((response) => {
param.loading = false
_.map(response, (responseItem, responseKey) => {
diff --git a/src/views/compute/wizard/DiskSizeSelection.vue b/src/views/compute/wizard/DiskSizeSelection.vue
index 540943fc6..684cb18d4 100644
--- a/src/views/compute/wizard/DiskSizeSelection.vue
+++ b/src/views/compute/wizard/DiskSizeSelection.vue
@@ -25,16 +25,17 @@
:min="0"
:max="1024"
v-model="inputValue"
- @change="($event) => updateDickSize($event)"
+ @change="($event) => updateDiskSize($event)"
/>