Skip to content

Commit 9c41762

Browse files
add guestiptype and forvpc filters for listNetworkOfferings on UI
1 parent 8a2c0f3 commit 9c41762

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

ui/src/components/view/SearchView.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
</span>
9797
<block-outlined v-else style="margin-right: 5px" />
9898
</span>
99-
{{ $t(opt.path || opt.name) }}
10099
</div>
101100
</a-select-option>
102101
</a-select>
@@ -313,7 +312,7 @@ export default {
313312
}
314313
if (['zoneid', 'domainid', 'imagestoreid', 'storageid', 'state', 'account', 'hypervisor', 'level',
315314
'clusterid', 'podid', 'groupid', 'entitytype', 'accounttype', 'systemvmtype', 'scope', 'provider',
316-
'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'networkid', 'usagetype', 'restartrequired'].includes(item)
315+
'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'networkid', 'usagetype', 'restartrequired', 'guestiptype'].includes(item)
317316
) {
318317
type = 'list'
319318
} else if (item === 'tags') {
@@ -335,9 +334,9 @@ export default {
335334
return arrayField
336335
},
337336
fetchStaticFieldData (arrayField) {
338-
if (arrayField.includes('type')) {
339-
if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) {
340-
const typeIndex = this.fields.findIndex(item => item.name === 'type')
337+
if (arrayField.includes('type') || arrayField.includes('guestiptype')) {
338+
if (this.$route.path.includes('/guestnetwork') || this.$route.path.includes('/networkoffering')) {
339+
const typeIndex = this.fields.findIndex(item => ['type', 'guestiptype'].includes(item.name))
341340
this.fields[typeIndex].loading = true
342341
this.fields[typeIndex].opts = this.fetchGuestNetworkTypes()
343342
this.fields[typeIndex].loading = false
@@ -982,7 +981,7 @@ export default {
982981
},
983982
fetchGuestNetworkTypes () {
984983
const types = []
985-
if (this.apiName.indexOf('listNetworks') > -1) {
984+
if (['listNetworks', 'listNetworkOfferings'].includes(this.apiName)) {
986985
types.push({
987986
id: 'Isolated',
988987
name: 'label.isolated'

ui/src/config/section/offering.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,22 @@ export default {
373373
icon: 'wifi-outlined',
374374
docHelp: 'adminguide/networking.html#network-offerings',
375375
permission: ['listNetworkOfferings'],
376-
searchFilters: ['name', 'zoneid', 'domainid', 'tags'],
376+
filters: ['all', 'forvpc', 'guestnetwork'],
377+
searchFilters: ['name', 'zoneid', 'domainid', 'guestiptype', 'tags'],
377378
columns: ['name', 'state', 'guestiptype', 'traffictype', 'networkrate', 'domain', 'zone', 'order'],
378379
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'],
379380
resourceType: 'NetworkOffering',
381+
customParamHandler: (params, query) => {
382+
const { filter } = query
383+
if (!filter) {
384+
return params
385+
}
386+
params.forvpc = filter === 'forvpc'
387+
if (filter === 'all') {
388+
delete params.forvpc
389+
}
390+
return params
391+
},
380392
tabs: [
381393
{
382394
name: 'details',

ui/src/views/AutogenView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ export default {
692692
return this.$route.query.filter
693693
}
694694
const routeName = this.$route.name
695-
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)) {
695+
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)) {
696696
return 'all'
697697
}
698698
if (['publicip'].includes(routeName)) {

0 commit comments

Comments
 (0)