Fix build and ui build errors in main (#11332)

* fix build error in registeruserdatacmd

* remove unused imports

* fix ui build errors
This commit is contained in:
Abhisar Sinha 2025-07-30 01:32:16 +05:30 committed by GitHub
parent 2bffabba7b
commit da3ba17884
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 93 additions and 139 deletions

View File

@ -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;

View File

@ -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 (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)
}
}
})
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) {

View File

@ -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 (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)
}
}
})
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) {

View File

@ -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