Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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 @@ -46,6 +46,14 @@ public class UserDataResponse extends BaseResponseWithAnnotations {
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the userdata owner")
private String domain;

@SerializedName(ApiConstants.PROJECT_ID)
@Param(description = "the project id of the userdata owner")
private String projectId;

@SerializedName(ApiConstants.PROJECT)
@Param(description = "the project name of the userdata owner")
private String projectName;

@SerializedName(ApiConstants.USER_DATA) @Param(description="base64 encoded userdata content")
private String userData;

Expand Down Expand Up @@ -125,4 +133,12 @@ public String getDomainName() {
public void setDomainName(String domain) {
this.domain = domain;
}

public void setProjectId(String projectId) {
this.projectId = projectId;
}

public void setProjectName(String projectName) {
this.projectName = projectName;
}
}
10 changes: 8 additions & 2 deletions server/src/main/java/com/cloud/api/ApiResponseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -4690,8 +4690,14 @@ public SSHKeyPairResponse createSSHKeyPairResponse(SSHKeyPair sshkeyPair, boolea
public UserDataResponse createUserDataResponse(UserData userData) {
UserDataResponse response = new UserDataResponse(userData.getUuid(), userData.getName(), userData.getUserData(), userData.getParams());
Account account = ApiDBUtils.findAccountById(userData.getAccountId());
response.setAccountId(account.getUuid());
response.setAccountName(account.getAccountName());
if (account.getType() == Account.Type.PROJECT) {
Project project = ApiDBUtils.findProjectByProjectAccountIdIncludingRemoved(account.getAccountId());
response.setProjectId(project.getUuid());
response.setProjectName(project.getName());
} else {
response.setAccountName(account.getAccountName());
response.setAccountId(account.getUuid());
}
Domain domain = ApiDBUtils.findDomainById(userData.getDomainId());
response.setDomainId(domain.getUuid());
response.setDomainName(domain.getName());
Expand Down
10 changes: 8 additions & 2 deletions ui/src/config/section/compute.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,14 @@ export default {
label: 'label.remove.user.data',
message: 'message.please.confirm.remove.user.data',
dataView: true,
args: ['id', 'account', 'domainid'],
args: ['id', 'account', 'domainid', 'projectid'],
mapping: {
id: {
value: (record, params) => { return record.id }
},
projectid: {
value: (record, params) => { return record.projectid }
},
account: {
value: (record, params) => { return record.account }
},
Expand All @@ -838,7 +841,10 @@ export default {
return selection.map(x => {
const data = record.filter(y => { return y.id === x })
return {
id: x, account: data[0].account, domainid: data[0].domainid
id: x,
account: data[0].account,
domainid: data[0].domainid,
projectid: data[0].projectid
}
})
}
Expand Down