Skip to content

Commit dc1a452

Browse files
UI: add filter user/all to list user/all volumes (#7075)
1 parent 0fd416d commit dc1a452

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

ui/src/config/section/storage.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ export default {
3030
docHelp: 'adminguide/storage.html#working-with-volumes',
3131
permission: ['listVolumesMetrics'],
3232
resourceType: 'Volume',
33+
filters: () => {
34+
if (store.getters.userInfo.roletype === 'Admin') {
35+
return ['user', 'all']
36+
} else {
37+
return []
38+
}
39+
},
3340
columns: () => {
3441
const fields = ['name', 'state', 'type', 'vmname', 'sizegb']
3542
const metricsFields = ['diskkbsread', 'diskkbswrite', 'diskiopstotal']

ui/src/views/AutogenView.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
:placeholder="$t('label.filterby')"
5656
:value="$route.query.filter || (projectView && $route.name === 'vm' ||
5757
['Admin', 'DomainAdmin'].includes($store.getters.userInfo.roletype) && ['vm', 'iso', 'template'].includes($route.name)
58-
? 'all' : ['publicip'].includes($route.name)
59-
? 'allocated' : ['guestnetwork', 'guestvlans'].includes($route.name) ? 'all' : 'self')"
58+
? 'all' : ['publicip'].includes($route.name)
59+
? 'allocated' : ['guestnetwork', 'guestvlans'].includes($route.name)
60+
? 'all' : ['volume'].includes($route.name)
61+
? 'user' : 'self')"
6062
style="min-width: 120px; margin-left: 10px"
6163
@change="changeFilter"
6264
showSearch
@@ -847,10 +849,6 @@ export default {
847849
delete params.showunique
848850
}
849851
850-
if (['Admin'].includes(this.$store.getters.userInfo.roletype) && ['listVolumesMetrics', 'listVolumes'].includes(this.apiName)) {
851-
params.listsystemvms = true
852-
}
853-
854852
this.loading = true
855853
if (this.$route.params && this.$route.params.id) {
856854
params.id = this.$route.params.id
@@ -1542,6 +1540,12 @@ export default {
15421540
query.templatefilter = filter
15431541
} else if (this.$route.name === 'iso') {
15441542
query.isofilter = filter
1543+
} else if (this.$route.name === 'volume') {
1544+
if (filter === 'all') {
1545+
query.listsystemvms = true
1546+
} else {
1547+
delete query.listsystemvms
1548+
}
15451549
} else if (this.$route.name === 'guestnetwork') {
15461550
if (filter === 'all') {
15471551
delete query.networkfilter

0 commit comments

Comments
 (0)