mirror of https://github.com/apache/cloudstack.git
UI: Add UI support for `forvpc` and `guestiptype` parameters of the `listNetworkOfferings` API (#9947)
* add guestiptype and forvpc filters for listNetworkOfferings on UI * fix duplicate option names on list filters
This commit is contained in:
parent
db2e89a3a2
commit
546ef31aed
|
|
@ -80,7 +80,7 @@
|
|||
</span>
|
||||
<global-outlined v-else style="margin-right: 5px" />
|
||||
</span>
|
||||
<span v-if="(field.name.startsWith('domain') || field.name === 'account')">
|
||||
<span v-if="(field.name.startsWith('domain') || field.name === 'account' || field.name.startsWith('associatednetwork'))">
|
||||
<span v-if="opt.icon">
|
||||
<resource-icon :image="opt.icon.base64image" size="1x" style="margin-right: 5px"/>
|
||||
</span>
|
||||
|
|
@ -90,13 +90,6 @@
|
|||
<status :text="opt.state" />
|
||||
</span>
|
||||
{{ $t((['storageid'].includes(field.name) || !opt.path) ? opt.name : opt.path) }}
|
||||
<span v-if="(field.name.startsWith('associatednetwork'))">
|
||||
<span v-if="opt.icon">
|
||||
<resource-icon :image="opt.icon.base64image" size="1x" style="margin-right: 5px"/>
|
||||
</span>
|
||||
<block-outlined v-else style="margin-right: 5px" />
|
||||
</span>
|
||||
{{ $t(opt.path || opt.name) }}
|
||||
</div>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
|
|
@ -313,7 +306,7 @@ export default {
|
|||
}
|
||||
if (['zoneid', 'domainid', 'imagestoreid', 'storageid', 'state', 'account', 'hypervisor', 'level',
|
||||
'clusterid', 'podid', 'groupid', 'entitytype', 'accounttype', 'systemvmtype', 'scope', 'provider',
|
||||
'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'networkid', 'usagetype', 'restartrequired'].includes(item)
|
||||
'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'networkid', 'usagetype', 'restartrequired', 'guestiptype'].includes(item)
|
||||
) {
|
||||
type = 'list'
|
||||
} else if (item === 'tags') {
|
||||
|
|
@ -335,9 +328,9 @@ export default {
|
|||
return arrayField
|
||||
},
|
||||
fetchStaticFieldData (arrayField) {
|
||||
if (arrayField.includes('type')) {
|
||||
if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) {
|
||||
const typeIndex = this.fields.findIndex(item => item.name === 'type')
|
||||
if (arrayField.includes('type') || arrayField.includes('guestiptype')) {
|
||||
if (this.$route.path.includes('/guestnetwork') || this.$route.path.includes('/networkoffering')) {
|
||||
const typeIndex = this.fields.findIndex(item => ['type', 'guestiptype'].includes(item.name))
|
||||
this.fields[typeIndex].loading = true
|
||||
this.fields[typeIndex].opts = this.fetchGuestNetworkTypes()
|
||||
this.fields[typeIndex].loading = false
|
||||
|
|
@ -982,7 +975,7 @@ export default {
|
|||
},
|
||||
fetchGuestNetworkTypes () {
|
||||
const types = []
|
||||
if (this.apiName.indexOf('listNetworks') > -1) {
|
||||
if (['listNetworks', 'listNetworkOfferings'].includes(this.apiName)) {
|
||||
types.push({
|
||||
id: 'Isolated',
|
||||
name: 'label.isolated'
|
||||
|
|
|
|||
|
|
@ -373,10 +373,22 @@ export default {
|
|||
icon: 'wifi-outlined',
|
||||
docHelp: 'adminguide/networking.html#network-offerings',
|
||||
permission: ['listNetworkOfferings'],
|
||||
searchFilters: ['name', 'zoneid', 'domainid', 'tags'],
|
||||
filters: ['all', 'forvpc', 'guestnetwork'],
|
||||
searchFilters: ['name', 'zoneid', 'domainid', 'guestiptype', 'tags'],
|
||||
columns: ['name', 'state', 'guestiptype', 'traffictype', 'networkrate', 'domain', 'zone', 'order'],
|
||||
details: ['name', 'id', 'displaytext', 'guestiptype', 'traffictype', 'internetprotocol', 'networkrate', 'ispersistent', 'egressdefaultpolicy', 'availability', 'conservemode', 'specifyvlan', 'routingmode', 'specifyasnumber', 'specifyipranges', 'supportspublicaccess', 'supportsstrechedl2subnet', 'forvpc', 'fornsx', 'networkmode', 'service', 'tags', 'domain', 'zone'],
|
||||
resourceType: 'NetworkOffering',
|
||||
customParamHandler: (params, query) => {
|
||||
const { filter } = query
|
||||
if (!filter) {
|
||||
return params
|
||||
}
|
||||
params.forvpc = filter === 'forvpc'
|
||||
if (filter === 'all') {
|
||||
delete params.forvpc
|
||||
}
|
||||
return params
|
||||
},
|
||||
tabs: [
|
||||
{
|
||||
name: 'details',
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ export default {
|
|||
return this.$route.query.filter
|
||||
}
|
||||
const routeName = this.$route.name
|
||||
if ((this.projectView && routeName === 'vm') || (['Admin', 'DomainAdmin'].includes(this.$store.getters.userInfo.roletype) && ['vm', 'iso', 'template', 'pod', 'cluster', 'host', 'systemvm', 'router', 'storagepool'].includes(routeName)) || ['account', 'guestnetwork', 'guestvlans', 'oauthsetting', 'guestos', 'guestoshypervisormapping', 'kubernetes', 'asnumbers'].includes(routeName)) {
|
||||
if ((this.projectView && routeName === 'vm') || (['Admin', 'DomainAdmin'].includes(this.$store.getters.userInfo.roletype) && ['vm', 'iso', 'template', 'pod', 'cluster', 'host', 'systemvm', 'router', 'storagepool'].includes(routeName)) || ['account', 'guestnetwork', 'guestvlans', 'oauthsetting', 'guestos', 'guestoshypervisormapping', 'kubernetes', 'asnumbers', 'networkoffering'].includes(routeName)) {
|
||||
return 'all'
|
||||
}
|
||||
if (['publicip'].includes(routeName)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue