mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
UI: fix templates/offerings are not listed in autoscale vm profile when login as user (#7343)
This commit is contained in:
parent
16694d8bec
commit
11ff2d20e8
@ -243,6 +243,7 @@
|
||||
|
||||
<script>
|
||||
import { api } from '@/api'
|
||||
import { isAdmin, isAdminOrDomainAdmin } from '@/role'
|
||||
import Status from '@/components/widgets/Status'
|
||||
import TooltipButton from '@/components/widgets/TooltipButton'
|
||||
import TooltipLabel from '@/components/widgets/TooltipLabel'
|
||||
@ -344,21 +345,29 @@ export default {
|
||||
})
|
||||
},
|
||||
fetchTemplateData () {
|
||||
api('listTemplates', {
|
||||
templatefilter: 'all',
|
||||
const params = {
|
||||
listall: 'true',
|
||||
domainid: this.resource.domainid,
|
||||
account: this.resource.account
|
||||
}).then(json => {
|
||||
}
|
||||
if (isAdmin()) {
|
||||
params.templatefilter = 'all'
|
||||
} else {
|
||||
params.templatefilter = 'executable'
|
||||
}
|
||||
api('listTemplates', params).then(json => {
|
||||
this.templatesList = json.listtemplatesresponse?.template || []
|
||||
})
|
||||
},
|
||||
fetchServiceOfferingData () {
|
||||
api('listServiceOfferings', {
|
||||
const params = {
|
||||
listall: 'true',
|
||||
isrecursive: 'true',
|
||||
issystem: 'false'
|
||||
}).then(json => {
|
||||
}
|
||||
if (isAdminOrDomainAdmin()) {
|
||||
params.isrecursive = 'true'
|
||||
}
|
||||
api('listServiceOfferings', params).then(json => {
|
||||
this.serviceOfferingsList = json.listserviceofferingsresponse?.serviceoffering || []
|
||||
this.serviceOfferingsList = this.serviceOfferingsList.filter(offering => !offering.iscustomized)
|
||||
})
|
||||
|
||||
@ -1652,7 +1652,7 @@ export default {
|
||||
if (this.templateId) {
|
||||
apiName = 'listTemplates'
|
||||
params.listall = true
|
||||
params.templatefilter = 'all'
|
||||
params.templatefilter = this.isNormalAndDomainUser ? 'executable' : 'all'
|
||||
params.id = this.templateId
|
||||
} else if (this.networkId) {
|
||||
params.listall = true
|
||||
|
||||
@ -1619,11 +1619,11 @@ export default {
|
||||
if (this.templateId) {
|
||||
apiName = 'listTemplates'
|
||||
params.listall = true
|
||||
params.templatefilter = 'all'
|
||||
params.templatefilter = this.isNormalAndDomainUser ? 'executable' : 'all'
|
||||
params.id = this.templateId
|
||||
} else if (this.isoId) {
|
||||
params.listall = true
|
||||
params.isofilter = 'all'
|
||||
params.isofilter = this.isNormalAndDomainUser ? 'executable' : 'all'
|
||||
params.id = this.isoId
|
||||
apiName = 'listIsos'
|
||||
} else if (this.networkId) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user