mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' of ssh://git.cloud.com/var/lib/git/cloudstack-oss
This commit is contained in:
commit
01db4f3fd7
|
|
@ -110,7 +110,7 @@ public class ListResourceLimitsCmd extends BaseListCmd {
|
|||
}
|
||||
}
|
||||
|
||||
resourceLimitResponse.setResourceType(limit.getType().ordinal());
|
||||
resourceLimitResponse.setResourceType(Integer.valueOf(limit.getType().ordinal()).toString());
|
||||
resourceLimitResponse.setMax(limit.getMax());
|
||||
|
||||
resourceLimitResponse.setResponseName("resourcelimit");
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class UpdateResourceLimitCmd extends BaseCmd {
|
|||
response.setDomainName(ApiDBUtils.findDomainById(accountTemp.getDomainId()).getName());
|
||||
}
|
||||
}
|
||||
response.setResourceType(limit.getType().ordinal());
|
||||
response.setResourceType(Integer.valueOf(limit.getType().ordinal()).toString());
|
||||
response.setMax(limit.getMax());
|
||||
|
||||
response.setResponseName(getName());
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class ResourceLimitResponse extends BaseResponse {
|
|||
private String domainName;
|
||||
|
||||
@SerializedName("resourcetype") @Param(description="resource type. Values include 0, 1, 2, 3, 4. See the resourceType parameter for more information on these values.")
|
||||
private Integer resourceType;
|
||||
private String resourceType;
|
||||
|
||||
@SerializedName("max") @Param(description="the maximum number of the resource. A -1 means the resource currently has no limit.")
|
||||
private Long max;
|
||||
|
|
@ -60,11 +60,11 @@ public class ResourceLimitResponse extends BaseResponse {
|
|||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
public Integer getResourceType() {
|
||||
public String getResourceType() {
|
||||
return resourceType;
|
||||
}
|
||||
|
||||
public void setResourceType(Integer resourceType) {
|
||||
public void setResourceType(String resourceType) {
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -410,6 +410,7 @@ public class AccountManagerImpl implements AccountManager {
|
|||
public ResourceLimitVO updateResourceLimit(UpdateResourceLimitCmd cmd) throws InvalidParameterValueException {
|
||||
|
||||
Account account = (Account)UserContext.current().getAccount();
|
||||
String accountName = cmd.getAccountName();
|
||||
Long domainId = cmd.getDomainId();
|
||||
Long max = cmd.getMax();
|
||||
Integer type = cmd.getResourceType();
|
||||
|
|
@ -447,9 +448,9 @@ public class AccountManagerImpl implements AccountManager {
|
|||
}
|
||||
|
||||
if (account.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) {
|
||||
if ((domainId != null) && (account.getAccountName() == null) && domainId.equals(account.getDomainId())) {
|
||||
if ((domainId != null) && (accountName == null) && domainId.equals(account.getDomainId())) {
|
||||
// if the admin is trying to update their own domain, disallow...
|
||||
throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, "Unable to update resource limit for " + ((account.getAccountName() == null) ? "" : "account " + account.getAccountName() + " in ") + "domain " + domainId + ", permission denied");
|
||||
throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, "Unable to update resource limit for domain " + domainId + ", permission denied");
|
||||
}
|
||||
|
||||
// If there is an existing ROOT domain limit, make sure its max isn't being exceeded
|
||||
|
|
@ -471,15 +472,12 @@ public class AccountManagerImpl implements AccountManager {
|
|||
|
||||
if (domainId == null) {
|
||||
throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to update resource limit, unable to determine domain in which to update limit.");
|
||||
} else if (account != null) {
|
||||
if (account.getAccountName() != null) {
|
||||
Account userAccount = _accountDao.findActiveAccount(account.getAccountName(), domainId);
|
||||
if (userAccount == null) {
|
||||
throw new ServerApiException(BaseCmd.PARAM_ERROR, "unable to find account by name " + account.getAccountName() + " in domain with id " + domainId);
|
||||
}
|
||||
accountId = userAccount.getId();
|
||||
domainId = userAccount.getDomainId();
|
||||
} else if (accountName != null) {
|
||||
Account userAccount = _accountDao.findActiveAccount(accountName, domainId);
|
||||
if (userAccount == null) {
|
||||
throw new ServerApiException(BaseCmd.PARAM_ERROR, "unable to find account by name " + account.getAccountName() + " in domain with id " + domainId);
|
||||
}
|
||||
accountId = userAccount.getId();
|
||||
}
|
||||
|
||||
if (accountId != null) domainId = null;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
html,body{
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
font-size:11px;
|
||||
color:#717171;
|
||||
color:#333;
|
||||
height:auto;
|
||||
font-weight:normal;
|
||||
background:#00374e url(../images/login_bg.gif) repeat-x top left;
|
||||
|
|
@ -2190,9 +2190,10 @@ a:hover.search_button {
|
|||
padding:0 0 4px 0;
|
||||
}
|
||||
|
||||
.midmenu_content.selected{
|
||||
background:#626262 url(../images/leftmenu_selected.gif) repeat-x top left;7497ae url(../images/mid_addingbg.gif) repeat-x top left;
|
||||
color:#FFF;
|
||||
.midmenu_content.selected {
|
||||
background:#626262 url(../images/leftmenu_selected.gif) repeat-x top left;
|
||||
color:#FFF !important;
|
||||
|
||||
}
|
||||
|
||||
.midmenu_content.inaction{
|
||||
|
|
@ -2228,6 +2229,17 @@ a:hover.search_button {
|
|||
}
|
||||
|
||||
.midmenu_textbox p {
|
||||
width:165px;
|
||||
height:auto;
|
||||
float:left;
|
||||
text-align:left;
|
||||
font-weight:normal;
|
||||
font-size:11px;
|
||||
margin:3px 0 0 0;
|
||||
padding:0;
|
||||
|
||||
}
|
||||
.midmenu_textbox span {
|
||||
width:165px;
|
||||
height:auto;
|
||||
float:left;
|
||||
|
|
@ -2236,6 +2248,7 @@ a:hover.search_button {
|
|||
font-size:10px;
|
||||
margin:3px 0 0 0;
|
||||
padding:0;
|
||||
color:#999;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -684,12 +684,12 @@ long milliseconds = new Date().getTime();
|
|||
<div class="midmenu_icons" id="icon_container" style="display: none">
|
||||
<img id="icon" /></div>
|
||||
<div class="midmenu_textbox">
|
||||
<p style="font-size: 11px;">
|
||||
<p>
|
||||
<strong id="first_row"> </strong>
|
||||
</p>
|
||||
<p id="second_row_container">
|
||||
<span id="second_row_container">
|
||||
<span id="second_row"> </span>
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
<div class="midmenu_inactionloader" id="spinning_wheel" style="display: none;">
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue