mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
UI: add filter user/all to list user/all volumes (#7075)
This commit is contained in:
parent
0fd416d074
commit
dc1a452913
@ -30,6 +30,13 @@ export default {
|
||||
docHelp: 'adminguide/storage.html#working-with-volumes',
|
||||
permission: ['listVolumesMetrics'],
|
||||
resourceType: 'Volume',
|
||||
filters: () => {
|
||||
if (store.getters.userInfo.roletype === 'Admin') {
|
||||
return ['user', 'all']
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
},
|
||||
columns: () => {
|
||||
const fields = ['name', 'state', 'type', 'vmname', 'sizegb']
|
||||
const metricsFields = ['diskkbsread', 'diskkbswrite', 'diskiopstotal']
|
||||
|
||||
@ -55,8 +55,10 @@
|
||||
:placeholder="$t('label.filterby')"
|
||||
:value="$route.query.filter || (projectView && $route.name === 'vm' ||
|
||||
['Admin', 'DomainAdmin'].includes($store.getters.userInfo.roletype) && ['vm', 'iso', 'template'].includes($route.name)
|
||||
? 'all' : ['publicip'].includes($route.name)
|
||||
? 'allocated' : ['guestnetwork', 'guestvlans'].includes($route.name) ? 'all' : 'self')"
|
||||
? 'all' : ['publicip'].includes($route.name)
|
||||
? 'allocated' : ['guestnetwork', 'guestvlans'].includes($route.name)
|
||||
? 'all' : ['volume'].includes($route.name)
|
||||
? 'user' : 'self')"
|
||||
style="min-width: 120px; margin-left: 10px"
|
||||
@change="changeFilter"
|
||||
showSearch
|
||||
@ -847,10 +849,6 @@ export default {
|
||||
delete params.showunique
|
||||
}
|
||||
|
||||
if (['Admin'].includes(this.$store.getters.userInfo.roletype) && ['listVolumesMetrics', 'listVolumes'].includes(this.apiName)) {
|
||||
params.listsystemvms = true
|
||||
}
|
||||
|
||||
this.loading = true
|
||||
if (this.$route.params && this.$route.params.id) {
|
||||
params.id = this.$route.params.id
|
||||
@ -1542,6 +1540,12 @@ export default {
|
||||
query.templatefilter = filter
|
||||
} else if (this.$route.name === 'iso') {
|
||||
query.isofilter = filter
|
||||
} else if (this.$route.name === 'volume') {
|
||||
if (filter === 'all') {
|
||||
query.listsystemvms = true
|
||||
} else {
|
||||
delete query.listsystemvms
|
||||
}
|
||||
} else if (this.$route.name === 'guestnetwork') {
|
||||
if (filter === 'all') {
|
||||
delete query.networkfilter
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user