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>{{ network.vlan }}</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__label">
|
||||
{{ $t('label.broadcastdomainrange') }}
|
||||
@ -101,9 +109,25 @@ export default {
|
||||
this.fetchLoading = true
|
||||
api('listPhysicalNetworks', { zoneid: this.resource.id }).then(json => {
|
||||
this.networks = json.listphysicalnetworksresponse.physicalnetwork || []
|
||||
this.fetchTrafficLabels()
|
||||
}).catch(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
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user