mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: Show traffic type in physical networks tab (#4952)
This commit is contained in:
parent
f8ba33d570
commit
96ccd6d3e3
@ -47,6 +47,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>{{ network.vlan }}</div>
|
<div>{{ network.vlan }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="list__col">
|
||||||
|
<div class="list__label">
|
||||||
|
{{ $t('label.traffictype') }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ network.traffictype }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="list__col">
|
<div class="list__col">
|
||||||
<div class="list__label">
|
<div class="list__label">
|
||||||
{{ $t('label.broadcastdomainrange') }}
|
{{ $t('label.broadcastdomainrange') }}
|
||||||
@ -101,9 +109,25 @@ export default {
|
|||||||
this.fetchLoading = true
|
this.fetchLoading = true
|
||||||
api('listPhysicalNetworks', { zoneid: this.resource.id }).then(json => {
|
api('listPhysicalNetworks', { zoneid: this.resource.id }).then(json => {
|
||||||
this.networks = json.listphysicalnetworksresponse.physicalnetwork || []
|
this.networks = json.listphysicalnetworksresponse.physicalnetwork || []
|
||||||
|
this.fetchTrafficLabels()
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$notifyError(error)
|
this.$notifyError(error)
|
||||||
}).finally(() => {
|
})
|
||||||
|
},
|
||||||
|
fetchTrafficLabels () {
|
||||||
|
const promises = []
|
||||||
|
for (const network of this.networks) {
|
||||||
|
promises.push(new Promise((resolve, reject) => {
|
||||||
|
api('listTrafficTypes', { physicalnetworkid: network.id }).then(json => {
|
||||||
|
network.traffictype = json.listtraffictypesresponse.traffictype.filter(e => { return e.traffictype }).map(e => { return e.traffictype }).join(', ')
|
||||||
|
resolve()
|
||||||
|
}).catch(error => {
|
||||||
|
this.$notifyError(error)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
Promise.all(promises).finally(() => {
|
||||||
this.fetchLoading = false
|
this.fetchLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user