This is an automated email from the ASF dual-hosted git repository. nvazquez pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push: new da3ba17884e Fix build and ui build errors in main (#11332) da3ba17884e is described below commit da3ba17884eeb09ac11c83ec7cfbf8e8072e552f Author: Abhisar Sinha <63767682+abh1...@users.noreply.github.com> AuthorDate: Wed Jul 30 01:32:16 2025 +0530 Fix build and ui build errors in main (#11332) * fix build error in registeruserdatacmd * remove unused imports * fix ui build errors --- .../command/user/userdata/RegisterUserDataCmd.java | 50 +----------- ui/src/views/compute/DeployVM.vue | 90 +++++++++++----------- ui/src/views/compute/DeployVnfAppliance.vue | 90 +++++++++++----------- .../views/infra/zone/ZoneWizardZoneDetailsStep.vue | 2 +- 4 files changed, 93 insertions(+), 139 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/userdata/RegisterUserDataCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/userdata/RegisterUserDataCmd.java index 4bfaeea05fd..185c9c05b1c 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/userdata/RegisterUserDataCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/userdata/RegisterUserDataCmd.java @@ -21,8 +21,6 @@ import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; -import org.apache.cloudstack.api.response.DomainResponse; -import org.apache.cloudstack.api.response.ProjectResponse; import org.apache.cloudstack.api.response.SuccessResponse; import org.apache.cloudstack.api.response.UserDataResponse; import org.apache.cloudstack.context.CallContext; @@ -48,52 +46,8 @@ public class RegisterUserDataCmd extends BaseRegisterUserDataCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "Name of the User Data") - private String name; - - //Owner information - @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "an optional account for the User Data. Must be used with domainId.") - private String accountName; - - @Parameter(name = ApiConstants.DOMAIN_ID, - type = CommandType.UUID, - entityType = DomainResponse.class, - description = "an optional domainId for the User Data. If the account parameter is used, domainId must also be used.") - private Long domainId; - - @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "an optional project for the User Data") - private Long projectId; - - @Parameter(name = ApiConstants.USER_DATA, - type = CommandType.STRING, - required = true, - description = "Base64 encoded User Data content. " + - "Using HTTP GET (via querystring), you can send up to 4KB of data after base64 encoding. " + - "Using HTTP POST (via POST body), you can send up to 32KB of data after base64 encoding, " + - "which can be increased upto 1MB using the vm.userdata.max.length setting", - length = 1048576) - private String userData; - - - ///////////////////////////////////////////////////// - /////////////////// Accessors /////////////////////// - ///////////////////////////////////////////////////// - - public String getName() { - return name; - } - - public String getAccountName() { - return accountName; - } - - public Long getDomainId() { - return domainId; - } - - public Long getProjectId() { - return projectId; - } + @Parameter(name = ApiConstants.USER_DATA, type = CommandType.STRING, required = true, description = "User data content", length = 1048576) + protected String userData; public String getUserData() { return userData; diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index 674fe89f7fa..cd248f123f1 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -2528,64 +2528,64 @@ export default { if (exclude && exclude.length > 0 && exclude.includes(name)) { return resolve(null) } - } - this.loading[name] = true - param.loading = true - param.opts = [] - const options = param.options || {} - if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) { - options.listall = true - } - postApi(param.list, options).then((response) => { - param.loading = false - _.map(response, (responseItem, responseKey) => { - if (Object.keys(responseItem).length === 0) { - this.rowCount[name] = 0 - this.options[name] = [] - return - } - if (!responseKey.includes('response')) { - return - } - _.map(responseItem, (response, key) => { - if (key === 'count') { - this.rowCount[name] = response + this.loading[name] = true + param.loading = true + param.opts = [] + const options = param.options || {} + if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) { + options.listall = true + } + postAPI(param.list, options).then((response) => { + param.loading = false + _.map(response, (responseItem, responseKey) => { + if (Object.keys(responseItem).length === 0) { + this.rowCount[name] = 0 + this.options[name] = [] return } if (!responseKey.includes('response')) { - return resolve(null) + return } _.map(responseItem, (response, key) => { if (key === 'count') { this.rowCount[name] = response return } - param.opts = response - this.options[name] = response - - if (name === 'hypervisors') { - const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null - this.dataPreFill.hypervisor = hypervisorFromResponse - this.form.hypervisor = hypervisorFromResponse + if (!responseKey.includes('response')) { + return resolve(null) } + _.map(responseItem, (response, key) => { + if (key === 'count') { + this.rowCount[name] = response + return + } + param.opts = response + this.options[name] = response - if (param.field) { - this.fillValue(param.field) - } - }) + if (name === 'hypervisors') { + const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null + this.dataPreFill.hypervisor = hypervisorFromResponse + this.form.hypervisor = hypervisorFromResponse + } - if (name === 'zones') { - let zoneid = '' - if (this.$route.query.zoneid) { - zoneid = this.$route.query.zoneid - } else if (this.options.zones.length === 1) { - zoneid = this.options.zones[0].id - } - if (zoneid) { - this.form.zoneid = zoneid - this.onSelectZoneId(zoneid) + if (param.field) { + this.fillValue(param.field) + } + }) + + if (name === 'zones') { + let zoneid = '' + if (this.$route.query.zoneid) { + zoneid = this.$route.query.zoneid + } else if (this.options.zones.length === 1) { + zoneid = this.options.zones[0].id + } + if (zoneid) { + this.form.zoneid = zoneid + this.onSelectZoneId(zoneid) + } } - } + }) }) resolve(response) }).catch(function (error) { diff --git a/ui/src/views/compute/DeployVnfAppliance.vue b/ui/src/views/compute/DeployVnfAppliance.vue index fd5a04d9b70..cf8677a2c61 100644 --- a/ui/src/views/compute/DeployVnfAppliance.vue +++ b/ui/src/views/compute/DeployVnfAppliance.vue @@ -2472,64 +2472,64 @@ export default { if (exclude && exclude.length > 0 && exclude.includes(name)) { return resolve(null) } - } - this.loading[name] = true - param.loading = true - param.opts = [] - const options = param.options || {} - if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) { - options.listall = true - } - postApi(param.list, options).then((response) => { - param.loading = false - _.map(response, (responseItem, responseKey) => { - if (Object.keys(responseItem).length === 0) { - this.rowCount[name] = 0 - this.options[name] = [] - return - } - if (!responseKey.includes('response')) { - return - } - _.map(responseItem, (response, key) => { - if (key === 'count') { - this.rowCount[name] = response + this.loading[name] = true + param.loading = true + param.opts = [] + const options = param.options || {} + if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) { + options.listall = true + } + postAPI(param.list, options).then((response) => { + param.loading = false + _.map(response, (responseItem, responseKey) => { + if (Object.keys(responseItem).length === 0) { + this.rowCount[name] = 0 + this.options[name] = [] return } if (!responseKey.includes('response')) { - return resolve(null) + return } _.map(responseItem, (response, key) => { if (key === 'count') { this.rowCount[name] = response return } - param.opts = response - this.options[name] = response - - if (name === 'hypervisors') { - const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null - this.dataPreFill.hypervisor = hypervisorFromResponse - this.form.hypervisor = hypervisorFromResponse + if (!responseKey.includes('response')) { + return resolve(null) } + _.map(responseItem, (response, key) => { + if (key === 'count') { + this.rowCount[name] = response + return + } + param.opts = response + this.options[name] = response - if (param.field) { - this.fillValue(param.field) - } - }) + if (name === 'hypervisors') { + const hypervisorFromResponse = response[0] && response[0].name ? response[0].name : null + this.dataPreFill.hypervisor = hypervisorFromResponse + this.form.hypervisor = hypervisorFromResponse + } - if (name === 'zones') { - let zoneid = '' - if (this.$route.query.zoneid) { - zoneid = this.$route.query.zoneid - } else if (this.options.zones.length === 1) { - zoneid = this.options.zones[0].id - } - if (zoneid) { - this.form.zoneid = zoneid - this.onSelectZoneId(zoneid) + if (param.field) { + this.fillValue(param.field) + } + }) + + if (name === 'zones') { + let zoneid = '' + if (this.$route.query.zoneid) { + zoneid = this.$route.query.zoneid + } else if (this.options.zones.length === 1) { + zoneid = this.options.zones[0].id + } + if (zoneid) { + this.form.zoneid = zoneid + this.onSelectZoneId(zoneid) + } } - } + }) }) resolve(response) }).catch(function (error) { diff --git a/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue b/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue index 5e5b635733b..f007142fca3 100644 --- a/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue @@ -470,7 +470,7 @@ export default { }) }, fetchDomainAccounts (domainid) { - api('listAccounts', { + getAPI('listAccounts', { domainid: domainid }).then(response => { // Clean up the selected account from a previous domain