From 9ca2f2001efccc5984af6ef430594bf9f30929c1 Mon Sep 17 00:00:00 2001 From: davidjumani Date: Mon, 7 Jun 2021 14:48:07 +0530 Subject: [PATCH 1/2] ui: Show default nic/network in infocard --- ui/src/components/view/InfoCard.vue | 6 ++++++ ui/src/views/compute/DeployVM.vue | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index e25eb393983f..9d33c2c87e72 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -281,6 +281,9 @@ style="margin-left: -24px; margin-top: 5px;"> eth{{ index }} {{ eth.ipaddress }} ({{ eth.networkname }}) + + ({{ $t('label.default') }}) + @@ -294,6 +297,9 @@ :key="network.id" style="margin-top: 5px;"> {{ network.name }} + + ({{ $t('label.default') }}) + diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index c0965bfd593e..281bc6a11186 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -758,7 +758,7 @@ export default { 'sharedexecutable' ], initDataConfig: {}, - defaultNetwork: '', + defaultnetworkid: '', networkConfig: [], dataNetworkCreated: [], tabList: [ @@ -1038,6 +1038,7 @@ export default { if (this.networks) { this.vm.networks = this.networks + this.vm.defaultnetworkid = this.defaultnetworkid } if (this.template) { @@ -1110,6 +1111,7 @@ export default { this.form.getFieldDecorator('multidiskoffering', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('affinitygroupids', { initialValue: [], preserve: true }) this.form.getFieldDecorator('networkids', { initialValue: [], preserve: true }) + this.form.getFieldDecorator('defaultnetworkid', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('keypair', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('cpunumber', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('cpuSpeed', { initialValue: undefined, preserve: true }) @@ -1337,7 +1339,10 @@ export default { }) }, updateDefaultNetworks (id) { - this.defaultNetwork = id + this.defaultnetworkid = id + this.form.setFieldsValue({ + defaultnetworkid: id + }) }, updateNetworkConfig (networks) { this.networkConfig = networks @@ -1487,9 +1492,9 @@ export default { networkIds = values.networkids if (networkIds.length > 0) { for (let i = 0; i < networkIds.length; i++) { - if (networkIds[i] === this.defaultNetwork) { + if (networkIds[i] === this.defaultnetworkid) { const ipToNetwork = { - networkid: this.defaultNetwork + networkid: this.defaultnetworkid } arrNetwork.unshift(ipToNetwork) } else { From 10984fdcfbd96a5f6cb526d74bd58142b90676c6 Mon Sep 17 00:00:00 2001 From: davidjumani Date: Tue, 8 Jun 2021 10:05:54 +0530 Subject: [PATCH 2/2] using tags --- ui/src/components/view/InfoCard.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index 9d33c2c87e72..bfdac6a56947 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -281,9 +281,9 @@ style="margin-left: -24px; margin-top: 5px;"> eth{{ index }} {{ eth.ipaddress }} ({{ eth.networkname }}) - - ({{ $t('label.default') }}) - + + {{ $t('label.default') }} +