mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8592: defined quota labels
This commit is contained in:
parent
d4415f1d87
commit
9b2cf8a2f7
|
|
@ -1398,6 +1398,15 @@ label.quota.description=Quota Description
|
|||
label.quota.configuration=Quota Configuration
|
||||
label.quota.configure=Configure Quota
|
||||
label.quota.remove=Remove Quota
|
||||
label.quota.totalusage=Total Usage
|
||||
label.quota.balance=Balance
|
||||
label.quota.summary=Summary
|
||||
label.quota.tariff=Tariff
|
||||
label.quota.state=State
|
||||
label.quota.email.template=Email Template
|
||||
label.quota.statement=Statement
|
||||
label.quota.statement.balance=Balance
|
||||
label.quota.statement.tariff=Quota Tariff
|
||||
label.destroy.vm.graceperiod=Destroy VM Grace Period
|
||||
label.SNMP.community=SNMP Community
|
||||
label.SNMP.port=SNMP Port
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import com.cloud.domain.DomainVO;
|
|||
import com.cloud.domain.dao.DomainDao;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.Account.State;
|
||||
import com.cloud.user.AccountVO;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.dao.AccountDao;
|
||||
|
|
@ -130,7 +129,7 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
|
|||
qr.setDomainName(domain.getName());
|
||||
qr.setBalance(curBalance);
|
||||
qr.setQuotaUsage(quotaUsage);
|
||||
qr.setState(account.getState().compareTo(State.enabled) == 0);
|
||||
qr.setState(account.getState());
|
||||
qr.setCurrency(QuotaConfig.QuotaCurrencySymbol.value());
|
||||
qr.setObjectName("summary");
|
||||
result.add(qr);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.google.gson.annotations.SerializedName;
|
|||
import org.apache.cloudstack.api.BaseResponse;
|
||||
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.user.Account.State;
|
||||
|
||||
public class QuotaSummaryResponse extends BaseResponse {
|
||||
|
||||
|
|
@ -50,7 +51,7 @@ public class QuotaSummaryResponse extends BaseResponse {
|
|||
|
||||
@SerializedName("state")
|
||||
@Param(description = "account state")
|
||||
private Boolean state;
|
||||
private State state;
|
||||
|
||||
@SerializedName("quota")
|
||||
@Param(description = "quota usage of this period")
|
||||
|
|
@ -108,11 +109,11 @@ public class QuotaSummaryResponse extends BaseResponse {
|
|||
return quotaUsage;
|
||||
}
|
||||
|
||||
public Boolean getState() {
|
||||
public State getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Boolean state) {
|
||||
public void setState(State state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1024,6 +1024,15 @@ dictionary = {
|
|||
'label.quota.configuration': '<fmt:message key="label.quota.configuration" />',
|
||||
'label.quota.configure': '<fmt:message key="label.quota.configure" />',
|
||||
'label.quota.remove': '<fmt:message key="label.quota.remove" />',
|
||||
'label.quota.totalusage': '<fmt:message key="label.quota.totalusage" />',
|
||||
'label.quota.balance': '<fmt:message key="label.quota.balance" />',
|
||||
'label.quota.summary': '<fmt:message key="label.quota.summary" />',
|
||||
'label.quota.tariff': '<fmt:message key="label.quota.tariff" />',
|
||||
'label.quota.state': '<fmt:message key="label.quota.state" />',
|
||||
'label.quota.email.template': '<fmt:message key="label.quota.email.template" />',
|
||||
'label.quota.statement': '<fmt:message key="label.quota.statement" />',
|
||||
'label.quota.statement.balance': '<fmt:message key="label.quota.statement.balance" />',
|
||||
'label.quota.statement.tariff': '<fmt:message key="label.quota.statement.tariff" />',
|
||||
'label.rbd': '<fmt:message key="label.rbd" />',
|
||||
'label.rbd.monitor': '<fmt:message key="label.rbd.monitor" />',
|
||||
'label.rbd.pool': '<fmt:message key="label.rbd.pool" />',
|
||||
|
|
|
|||
|
|
@ -52,8 +52,9 @@
|
|||
state: {
|
||||
label: 'label.quota.state',
|
||||
indicator: {
|
||||
'Enabled': 'on',
|
||||
'Disabled': 'off',
|
||||
'enabled': 'on',
|
||||
'disabled': 'off',
|
||||
'locked': 'off',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -78,12 +79,6 @@
|
|||
$.each(items, function(idx, item) {
|
||||
items[idx].quota = items[idx].currency + ' ' + items[idx].quota;
|
||||
items[idx].balance = items[idx].currency + ' ' + items[idx].balance;
|
||||
// FIXME: state is boolean, this needs to be string?
|
||||
if (items[idx].state) {
|
||||
items[idx].state = 'Enabled';
|
||||
} else {
|
||||
items[idx].state = 'Disabled';
|
||||
}
|
||||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
|
|
|
|||
Loading…
Reference in New Issue