Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd implements UserCmd {
@Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "true if the ISO is publicly available to all users, false otherwise.")
private Boolean publicIso;

@Parameter(name = ApiConstants.IS_READY, type = CommandType.BOOLEAN, description = "true if this ISO is ready to be deployed")
@Parameter(name = ApiConstants.IS_READY, type = CommandType.BOOLEAN, description = "list ISOs that are ready to be deployed")
private Boolean ready;

@Parameter(name = ApiConstants.ISO_FILTER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public class ListTemplatesCmd extends BaseListTaggedResourcesCmd implements User
since = "4.21.0")
private Long extensionId;

@Parameter(name = ApiConstants.IS_READY, type = CommandType.BOOLEAN, description = "list templates that are ready to be deployed", since = "4.21.0")
private Boolean ready;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -195,6 +198,13 @@ public boolean listInReadyState() {
boolean onlyReady =
(templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable) ||
(templateFilter == TemplateFilter.executable && isAccountSpecific) || (templateFilter == TemplateFilter.community);

if (!onlyReady) {
if (isReady() != null && isReady().booleanValue() != onlyReady) {
onlyReady = isReady().booleanValue();
}
}

return onlyReady;
}

Expand Down Expand Up @@ -230,6 +240,10 @@ public Long getExtensionId() {
return extensionId;
}

public Boolean isReady() {
return ready;
}

@Override
public String getCommandName() {
return s_name;
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/compute/AttachIso.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default {
const params = {
listall: true,
zoneid: this.resource.zoneid,
isready: true,
isofilter: isoFilter
isofilter: isoFilter,
isready: true
}
return new Promise((resolve, reject) => {
getAPI('listIsos', params).then((response) => {
Expand Down
2 changes: 2 additions & 0 deletions ui/src/views/compute/AutoScaleVmProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,11 @@ export default {
}
if (isAdmin()) {
params.templatefilter = 'all'
params.isready = true
} else {
params.templatefilter = 'executable'
}
params.isready = true
getAPI('listTemplates', params).then(json => {
this.templatesList = json.listtemplatesresponse?.template || []
})
Expand Down
2 changes: 2 additions & 0 deletions ui/src/views/compute/CreateAutoScaleVmGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,7 @@ export default {
apiName = 'listTemplates'
params.listall = true
params.templatefilter = this.isNormalAndDomainUser ? 'executable' : 'all'
params.isready = true
params.id = this.queryTemplateId
this.dataPreFill.templateid = this.queryTemplateId
} else if (this.queryNetworkId) {
Expand Down Expand Up @@ -2989,6 +2990,7 @@ export default {
args.arch = this.selectedArchitecture
}
args.templatefilter = templateFilter
args.isready = true
args.details = 'all'
args.showicon = 'true'
args.id = this.queryTemplateId
Expand Down
3 changes: 2 additions & 1 deletion ui/src/views/compute/CreateKubernetesCluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@ export default {
for (const filtername of filters) {
const params = {
templatefilter: filtername,
forcks: true
forcks: true,
isready: true
}
this.templateLoading = true
getAPI('listTemplates', params).then(json => {
Expand Down
4 changes: 4 additions & 0 deletions ui/src/views/compute/DeployVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1797,12 +1797,14 @@ export default {
apiName = 'listTemplates'
params.listall = true
params.templatefilter = this.isNormalAndDomainUser ? 'executable' : 'all'
params.isready = true
params.id = this.queryTemplateId
this.dataPreFill.templateid = this.queryTemplateId
} else if (this.queryIsoId) {
apiName = 'listIsos'
params.listall = true
params.isofilter = this.isNormalAndDomainUser ? 'executable' : 'all'
params.isready = true
params.id = this.queryIsoId
this.dataPreFill.isoid = this.queryIsoId
} else if (this.queryNetworkId) {
Expand Down Expand Up @@ -2609,6 +2611,7 @@ export default {
args.domainid = store.getters.project?.id ? null : this.owner.domainid
args.projectid = store.getters.project?.id || this.owner.projectid
args.templatefilter = templateFilter
args.isready = true
args.details = 'all'
args.showicon = 'true'
args.id = this.queryTemplateId
Expand Down Expand Up @@ -2644,6 +2647,7 @@ export default {
args.domainid = store.getters.project?.id ? null : this.owner.domainid
args.projectid = store.getters.project?.id || this.owner.projectid
args.isoFilter = isoFilter
args.isready = true
args.bootable = true
args.showicon = 'true'
args.id = this.queryIsoId
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/compute/DeployVnfAppliance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2546,6 +2546,7 @@ export default {
args.arch = this.selectedArchitecture
}
args.templatefilter = templateFilter
args.isready = true
args.details = 'all'
args.showicon = 'true'
args.id = this.queryTemplateId
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/compute/EditVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export default {
params.id = this.resource.templateid
params.isrecursive = true
params.templatefilter = 'all'
params.isready = true
var apiName = 'listTemplates'
getAPI(apiName, params).then(json => {
const templateResponses = json.listtemplatesresponse.template
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/compute/ReinstallVm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ export default {
}
args.zoneid = this.resource.zoneid
args.templatefilter = templateFilter
args.isready = true
if (this.resource.arch) {
args.arch = this.resource.arch
}
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/compute/ResetUserData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export default {
params.id = this.resource.templateid
params.isrecursive = true
params.templatefilter = 'all'
params.isready = true
var apiName = 'listTemplates'
getAPI(apiName, params).then(json => {
const templateResponses = json.listtemplatesresponse.template
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/compute/ScaleVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export default {
return new Promise((resolve, reject) => {
getAPI('listTemplates', {
templatefilter: 'all',
isready: true,
id: this.resource.templateid
}).then(response => {
var template = response?.listtemplatesresponse?.template?.[0] || null
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/tools/ImportUnmanagedInstance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ export default {
isLoad: true,
options: {
templatefilter: 'all',
isready: true,
hypervisor: this.cluster.hypervisortype,
showicon: true
},
Expand Down
Loading