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 @@ -21,6 +21,7 @@
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.response.CapabilitiesResponse;
import org.apache.cloudstack.config.ApiServiceConfiguration;
import org.apache.log4j.Logger;

import com.cloud.user.Account;
Expand Down Expand Up @@ -69,6 +70,7 @@ public void execute() {
if (capabilities.containsKey("apiLimitMax")) {
response.setApiLimitMax((Integer)capabilities.get("apiLimitMax"));
}
response.setDefaultUiPageSize((Long)capabilities.get(ApiServiceConfiguration.DefaultUIPageSize.key()));
response.setObjectName("capability");
response.setResponseName(getCommandName());
this.setResponseObject(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public class CapabilitiesResponse extends BaseResponse {
@Param(description = "true if experimental features for Kubernetes cluster such as Docker private registry are enabled, false otherwise")
private boolean kubernetesClusterExperimentalFeaturesEnabled;

@SerializedName("defaultuipagesize")
@Param(description = "default page size in the UI for various views, value set in the configurations", since = "4.15.2")
private Long defaultUiPageSize;

public void setSecurityGroupsEnabled(boolean securityGroupsEnabled) {
this.securityGroupsEnabled = securityGroupsEnabled;
}
Expand Down Expand Up @@ -175,4 +179,8 @@ public void setKubernetesServiceEnabled(boolean kubernetesServiceEnabled) {
public void setKubernetesClusterExperimentalFeaturesEnabled(boolean kubernetesClusterExperimentalFeaturesEnabled) {
this.kubernetesClusterExperimentalFeaturesEnabled = kubernetesClusterExperimentalFeaturesEnabled;
}

public void setDefaultUiPageSize(Long defaultUiPageSize) {
this.defaultUiPageSize = defaultUiPageSize;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@
import org.apache.cloudstack.api.command.user.vpn.UpdateVpnCustomerGatewayCmd;
import org.apache.cloudstack.api.command.user.vpn.UpdateVpnGatewayCmd;
import org.apache.cloudstack.api.command.user.zone.ListZonesCmd;
import org.apache.cloudstack.config.ApiServiceConfiguration;
import org.apache.cloudstack.config.Configuration;
import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
Expand Down Expand Up @@ -3858,6 +3859,7 @@ public Map<String, Object> listCapabilities(final ListCapabilitiesCmd cmd) {
capabilities.put("allowUserViewAllDomainAccounts", allowUserViewAllDomainAccounts);
capabilities.put("kubernetesServiceEnabled", kubernetesServiceEnabled);
capabilities.put("kubernetesClusterExperimentalFeaturesEnabled", kubernetesClusterExperimentalFeaturesEnabled);
capabilities.put(ApiServiceConfiguration.DefaultUIPageSize.key(), ApiServiceConfiguration.DefaultUIPageSize.value());
if (apiLimitEnabled) {
capabilities.put("apiLimitInterval", apiLimitInterval);
capabilities.put("apiLimitMax", apiLimitMax);
Expand Down
10 changes: 3 additions & 7 deletions ui/src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,9 @@ const user = {
api('listCapabilities').then(response => {
const result = response.listcapabilitiesresponse.capability
commit('SET_FEATURES', result)
}).catch(error => {
reject(error)
})

api('listConfigurations', { name: 'default.ui.page.size' }).then(response => {
const defaultListViewPageSize = parseInt(response.listconfigurationsresponse.configuration[0].value)
commit('SET_DEFAULT_LISTVIEW_PAGE_SIZE', defaultListViewPageSize)
if (result && result.defaultuipagesize) {
commit('SET_DEFAULT_LISTVIEW_PAGE_SIZE', result.defaultuipagesize)
}
}).catch(error => {
reject(error)
})
Expand Down