mirror of https://github.com/apache/cloudstack.git
UI: Make CKS public templates visible to non-admins on CKS cluster creation
This commit is contained in:
parent
e904b1b60c
commit
fe3e914a85
|
|
@ -661,16 +661,27 @@ export default {
|
|||
return ['Admin', 'DomainAdmin'].includes(this.$store.getters.userInfo.roletype)
|
||||
},
|
||||
fetchCksTemplates () {
|
||||
const params = {
|
||||
templatefilter: this.isAdminOrDomainAdmin() ? 'all' : 'self',
|
||||
forcks: true
|
||||
var filters = []
|
||||
if (this.isAdminOrDomainAdmin()) {
|
||||
filters = ['all']
|
||||
} else {
|
||||
filters = ['self', 'featured', 'community']
|
||||
}
|
||||
this.templateLoading = true
|
||||
api('listTemplates', params).then(json => {
|
||||
this.templates = json?.listtemplatesresponse?.template || []
|
||||
}).finally(() => {
|
||||
this.templateLoading = false
|
||||
})
|
||||
var ckstemplates = []
|
||||
for (const filtername of filters) {
|
||||
const params = {
|
||||
templatefilter: filtername,
|
||||
forcks: true
|
||||
}
|
||||
this.templateLoading = true
|
||||
api('listTemplates', params).then(json => {
|
||||
var templates = json?.listtemplatesresponse?.template || []
|
||||
ckstemplates.push(...templates)
|
||||
}).finally(() => {
|
||||
this.templateLoading = false
|
||||
})
|
||||
}
|
||||
this.templates = ckstemplates
|
||||
},
|
||||
fetchNetworkData () {
|
||||
const params = {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue