Skip to content

Commit e812657

Browse files
harikrishna-patnaladhslove
authored andcommitted
Added displaynetwork option in filters for listnetwork only for admin (apache#10209)
1 parent 74a476e commit e812657

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

ui/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,8 @@
23762376
"label.traffictype": "Traffic type",
23772377
"label.transportzoneuuid": "Transport zone UUID",
23782378
"label.trigger.shutdown": "Trigger Safe Shutdown",
2379+
"label.true": "True",
2380+
"label.false": "False",
23792381
"label.try.again": "Try again",
23802382
"label.tuesday": "Tuesday",
23812383
"label.two.factor.authentication.secret.key": "Your Two factor authentication secret key",

ui/src/components/view/ListView.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@
9090
<router-link :to="{ path: $route.path + '/' + record.uuid, query: { zoneid: $route.query.zoneid } }" v-else-if="record.uuid && $route.query.zoneid">{{ $t(text.toLowerCase()) }}</router-link>
9191
<router-link :to="{ path: $route.path }" v-else>{{ $t(text.toLowerCase()) }}</router-link>
9292
</span>
93+
<span v-else-if="$route.path.startsWith('/guestnetwork') && record.id && record.displaynetwork === false">
94+
<router-link :to="{ path: $route.path + '/' + record.id, query: { displaynetwork: false } }" v-if="record.id">{{ $t(text.toLowerCase()) }}</router-link>
95+
</span>
9396
<span v-else>
9497
<router-link :to="{ path: $route.path + '/' + record.id }" v-if="record.id">{{ text }}</router-link>
9598
<router-link :to="{ path: $route.path + '/' + record.name }" v-else>{{ text }}</router-link>

ui/src/components/view/SearchView.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export default {
306306
if (['zoneid', 'domainid', 'imagestoreid', 'storageid', 'state', 'account', 'hypervisor', 'level',
307307
'clusterid', 'podid', 'groupid', 'entitytype', 'accounttype', 'systemvmtype', 'scope', 'provider',
308308
'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'networkid',
309-
'usagetype', 'restartrequired', 'guestiptype', 'usersource'].includes(item)
309+
'usagetype', 'restartrequired', 'displaynetwork', 'guestiptype', 'usersource'].includes(item)
310310
) {
311311
type = 'list'
312312
} else if (item === 'tags') {
@@ -328,6 +328,12 @@ export default {
328328
return arrayField
329329
},
330330
fetchStaticFieldData (arrayField) {
331+
if (arrayField.includes('displaynetwork')) {
332+
const typeIndex = this.fields.findIndex(item => item.name === 'displaynetwork')
333+
this.fields[typeIndex].loading = true
334+
this.fields[typeIndex].opts = this.fetchBoolean()
335+
this.fields[typeIndex].loading = false
336+
}
331337
if (arrayField.includes('type') || arrayField.includes('guestiptype')) {
332338
if (this.$route.path.includes('/guestnetwork') || this.$route.path.includes('/networkoffering')) {
333339
const typeIndex = this.fields.findIndex(item => ['type', 'guestiptype'].includes(item.name))
@@ -1010,6 +1016,18 @@ export default {
10101016
}
10111017
return types
10121018
},
1019+
fetchBoolean () {
1020+
const types = []
1021+
types.push({
1022+
id: 'true',
1023+
name: 'label.true'
1024+
})
1025+
types.push({
1026+
id: 'false',
1027+
name: 'label.false'
1028+
})
1029+
return types
1030+
},
10131031
fetchAccountTypes () {
10141032
const types = []
10151033
if (this.apiName.indexOf('listAccounts') > -1) {

ui/src/config/section/network.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export default {
5353
}
5454
return fields
5555
},
56-
filters: ['all', 'account', 'domain', 'shared'],
57-
searchFilters: ['keyword', 'zoneid', 'domainid', 'account', 'type', 'restartrequired', 'tags'],
56+
filters: ['all', 'account', 'domainpath', 'shared'],
57+
searchFilters: ['keyword', 'zoneid', 'domainid', 'account', 'type', 'restartrequired', 'displaynetwork', 'tags'],
5858
related: [{
5959
name: 'vm',
6060
title: 'label.instances',

ui/src/views/AutogenView.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,9 @@ export default {
12221222
this.loading = true
12231223
if (this.$route.params && this.$route.params.id) {
12241224
params.id = this.$route.params.id
1225+
if (['listNetworks'].includes(this.apiName) && 'displaynetwork' in this.$route.query) {
1226+
params.displaynetwork = this.$route.query.displaynetwork
1227+
}
12251228
if (['listSSHKeyPairs'].includes(this.apiName)) {
12261229
if (!this.$isValidUuid(params.id)) {
12271230
delete params.id

0 commit comments

Comments
 (0)