mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Honour listall param for list templates api (#9300)
* Honour listall param for list templates api * Don't show templates from another project inside a project view
This commit is contained in:
parent
dc74d5ba88
commit
4f85c3fd23
@ -4348,7 +4348,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
|
|||||||
Account caller = CallContext.current().getCallingAccount();
|
Account caller = CallContext.current().getCallingAccount();
|
||||||
Long parentTemplateId = cmd.getParentTemplateId();
|
Long parentTemplateId = cmd.getParentTemplateId();
|
||||||
|
|
||||||
boolean listAll = false;
|
boolean listAll = cmd.listAll();
|
||||||
if (templateFilter != null && templateFilter == TemplateFilter.all) {
|
if (templateFilter != null && templateFilter == TemplateFilter.all) {
|
||||||
if (caller.getType() == Account.Type.NORMAL) {
|
if (caller.getType() == Account.Type.NORMAL) {
|
||||||
throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only");
|
throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only");
|
||||||
|
|||||||
@ -2276,11 +2276,16 @@ export default {
|
|||||||
}
|
}
|
||||||
args.zoneid = _.get(this.zone, 'id')
|
args.zoneid = _.get(this.zone, 'id')
|
||||||
args.templatefilter = templateFilter
|
args.templatefilter = templateFilter
|
||||||
args.projectid = -1
|
if (this.$store.getters.project?.id) {
|
||||||
|
args.projectid = this.$store.getters.project.id
|
||||||
|
} else {
|
||||||
|
args.projectid = -1
|
||||||
|
}
|
||||||
args.details = 'all'
|
args.details = 'all'
|
||||||
args.showicon = 'true'
|
args.showicon = 'true'
|
||||||
args.id = this.templateId
|
args.id = this.templateId
|
||||||
args.isvnf = false
|
args.isvnf = false
|
||||||
|
args.listall = true
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
api('listTemplates', args).then((response) => {
|
api('listTemplates', args).then((response) => {
|
||||||
@ -2299,10 +2304,15 @@ export default {
|
|||||||
}
|
}
|
||||||
args.zoneid = _.get(this.zone, 'id')
|
args.zoneid = _.get(this.zone, 'id')
|
||||||
args.isoFilter = isoFilter
|
args.isoFilter = isoFilter
|
||||||
args.projectid = -1
|
if (this.$store.getters.project?.id) {
|
||||||
|
args.projectid = this.$store.getters.project.id
|
||||||
|
} else {
|
||||||
|
args.projectid = -1
|
||||||
|
}
|
||||||
args.bootable = true
|
args.bootable = true
|
||||||
args.showicon = 'true'
|
args.showicon = 'true'
|
||||||
args.id = this.isoId
|
args.id = this.isoId
|
||||||
|
args.listall = true
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
api('listIsos', args).then((response) => {
|
api('listIsos', args).then((response) => {
|
||||||
|
|||||||
@ -46,6 +46,9 @@
|
|||||||
:os-name="item.osName" />
|
:os-name="item.osName" />
|
||||||
|
|
||||||
{{ item.displaytext }}
|
{{ item.displaytext }}
|
||||||
|
<span v-if="item?.projectid">
|
||||||
|
| <project-outlined /> {{ item.project }}
|
||||||
|
</span>
|
||||||
</a-radio>
|
</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user