ui: Show default nic/network in infocard (#5080)

This commit is contained in:
davidjumani 2021-06-17 12:55:31 +05:30 committed by GitHub
parent a3f39db62b
commit 85e4abf522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -281,6 +281,9 @@
style="margin-left: -24px; margin-top: 5px;">
<a-icon type="api" />eth{{ index }} {{ eth.ipaddress }}
<router-link v-if="eth.networkname && eth.networkid" :to="{ path: '/guestnetwork/' + eth.networkid }">({{ eth.networkname }})</router-link>
<a-tag v-if="eth.isdefault">
{{ $t('label.default') }}
</a-tag >
</div>
</div>
</div>
@ -294,6 +297,9 @@
:key="network.id"
style="margin-top: 5px;">
<a-icon type="api" />{{ network.name }}
<span v-if="resource.defaultnetworkid === network.id">
({{ $t('label.default') }})
</span>
</div>
</div>
</div>

View File

@ -775,7 +775,7 @@ export default {
'sharedexecutable'
],
initDataConfig: {},
defaultNetwork: '',
defaultnetworkid: '',
networkConfig: [],
dataNetworkCreated: [],
tabList: [
@ -1065,6 +1065,7 @@ export default {
if (this.networks) {
this.vm.networks = this.networks
this.vm.defaultnetworkid = this.defaultnetworkid
}
if (this.template) {
@ -1147,6 +1148,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 })
@ -1377,7 +1379,10 @@ export default {
})
},
updateDefaultNetworks (id) {
this.defaultNetwork = id
this.defaultnetworkid = id
this.form.setFieldsValue({
defaultnetworkid: id
})
},
updateNetworkConfig (networks) {
this.networkConfig = networks
@ -1528,9 +1533,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 {