Skip to content
Merged
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 @@ -270,9 +270,9 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co
@Param(description = "Vm details in key/value pairs.", since = "4.2.1")
private Map details;

@SerializedName("readonlyuidetails")
@Param(description = "List of UI read-only Vm details as comma separated string.", since = "4.13.0")
private String readOnlyUIDetails;
@SerializedName("readonlydetails")
@Param(description = "List of read-only Vm details as comma separated string.", since = "4.16.0")
private String readOnlyDetails;

@SerializedName(ApiConstants.SSH_KEYPAIR)
@Param(description = "ssh key-pair")
Expand Down Expand Up @@ -850,8 +850,8 @@ public void setDetails(Map details) {
this.details = details;
}

public void setReadOnlyUIDetails(String readOnlyUIDetails) {
this.readOnlyUIDetails = readOnlyUIDetails;
public void setReadOnlyDetails(String readOnlyDetails) {
this.readOnlyDetails = readOnlyDetails;
}

public void setOsTypeId(String osTypeId) {
Expand All @@ -874,8 +874,8 @@ public Map getDetails() {
return details;
}

public String getReadOnlyUIDetails() {
return readOnlyUIDetails;
public String getReadOnlyDetails() {
return readOnlyDetails;
}

public Boolean getDynamicallyScalable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public interface QueryService {
"user.vm.blacklisted.details", "rootdisksize, cpuOvercommitRatio, memoryOvercommitRatio, Message.ReservedCapacityFreed.Flag",
"Determines whether users can view certain VM settings. When set to empty, default value used is: rootdisksize, cpuOvercommitRatio, memoryOvercommitRatio, Message.ReservedCapacityFreed.Flag.", true);

static final ConfigKey<String> UserVMReadOnlyUIDetails = new ConfigKey<String>("Advanced", String.class,
"user.vm.readonly.ui.details", "dataDiskController, rootDiskController",
"List of UI read-only VM settings/details as comma separated string", true);
static final ConfigKey<String> UserVMReadOnlyDetails = new ConfigKey<String>("Advanced", String.class,
"user.vm.readonly.details", "dataDiskController, rootDiskController",
"List of read-only VM settings/details as comma separated string", true);

ConfigKey<Boolean> SortKeyAscending = new ConfigKey<>("Advanced", Boolean.class, "sortkey.algorithm", "true",
"Sort algorithm - ascending or descending - to use. For entities that use sort key(template, disk offering, service offering, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
-- Schema upgrade from 4.15.1.0 to 4.16.0.0
--;


--;
-- Stored procedure to do idempotent column add;
-- This is copied from schema-41000to41100.sql
Expand Down Expand Up @@ -301,3 +300,6 @@ from
left join
`cloud`.`resource_count` secondary_storage_count ON domain.id = secondary_storage_count.domain_id
and secondary_storage_count.type = 'secondary_storage';

-- Update name for global configuration user.vm.readonly.ui.details
Update configuration set name='user.vm.readonly.details' where name='user.vm.readonly.ui.details';
Original file line number Diff line number Diff line change
Expand Up @@ -4135,6 +4135,6 @@ public String getConfigComponentName() {

@Override
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {AllowUserViewDestroyedVM, UserVMBlacklistedDetails, UserVMReadOnlyUIDetails, SortKeyAscending, AllowUserViewAllDomainAccounts};
return new ConfigKey<?>[] {AllowUserViewDestroyedVM, UserVMBlacklistedDetails, UserVMReadOnlyDetails, SortKeyAscending, AllowUserViewAllDomainAccounts};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public UserVmResponse newUserVmResponse(ResponseView view, String objectName, Us
}
userVmResponse.setDetails(resourceDetails);
if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
userVmResponse.setReadOnlyUIDetails(QueryService.UserVMReadOnlyUIDetails.value());
userVmResponse.setReadOnlyDetails(QueryService.UserVMReadOnlyDetails.value());
}
}

Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@ public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableEx
final List<String> userBlacklistedSettings = Stream.of(QueryService.UserVMBlacklistedDetails.value().split(","))
.map(item -> (item).trim())
.collect(Collectors.toList());
final List<String> userReadOnlySettings = Stream.of(QueryService.UserVMReadOnlyUIDetails.value().split(","))
final List<String> userReadOnlySettings = Stream.of(QueryService.UserVMReadOnlyDetails.value().split(","))
.map(item -> (item).trim())
.collect(Collectors.toList());
if (cleanupDetails){
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/view/DetailSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ export default {
this.disableSettings = (this.$route.meta.name === 'vm' && this.resource.state !== 'Stopped')
},
allowEditOfDetail (name) {
if (this.resource.readonlyuidetails) {
if (this.resource.readonlyuidetails.split(',').map(item => item.trim()).includes(name)) {
if (this.resource.readonlydetails) {
if (this.resource.readonlydetails.split(',').map(item => item.trim()).includes(name)) {
return false
}
}
Expand Down