mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-1984:Wrong mapping of resource names to the capacity function on the dashboard
This commit is contained in:
parent
0abfe240c3
commit
e05defc073
@ -238,7 +238,7 @@
|
||||
return {
|
||||
zoneID: capacity.zoneid, // Temporary fix for dashboard
|
||||
zoneName: capacity.zonename,
|
||||
type: cloudStack.converters.toAlertType(capacity.type),
|
||||
type: cloudStack.converters.toCapacityCountType(capacity.type),
|
||||
percent: parseInt(capacity.percentused),
|
||||
used: cloudStack.converters.convertByType(capacity.type, capacity.capacityused),
|
||||
total: cloudStack.converters.convertByType(capacity.type, capacity.capacitytotal)
|
||||
|
||||
@ -425,6 +425,31 @@ cloudStack.converters = {
|
||||
case 26 : return "Resource Limit Exceeded";
|
||||
}
|
||||
},
|
||||
|
||||
toCapacityCountType:function(capacityCode){
|
||||
switch(capacityCode){
|
||||
case 0 : return _l('label.memory');
|
||||
case 1 : return _l('label.cpu');
|
||||
case 2 : return _l('label.storage');
|
||||
case 3 : return _l('label.primary.storage');
|
||||
case 4 : return _l('label.public.ips');
|
||||
case 5 : return _l('label.management.ips');
|
||||
case 6 : return _l('label.secondary.storage');
|
||||
case 7 : return _l('label.vlan');
|
||||
case 8 : return _l('label.direct.ips');
|
||||
case 9 : return _l('label.local.storage');
|
||||
case 10 : return "Routing Host";
|
||||
case 11 : return "Storage";
|
||||
case 12 : return "Usage Server";
|
||||
case 13 : return "Management Server";
|
||||
case 14 : return "Domain Router";
|
||||
case 15 : return "Console Proxy";
|
||||
case 16 : return "User VM";
|
||||
case 17 : return "VLAN";
|
||||
case 18 : return "Secondary Storage VM";
|
||||
}
|
||||
},
|
||||
|
||||
convertByType: function(alertCode, value) {
|
||||
switch(alertCode) {
|
||||
case 0: return cloudStack.converters.convertBytes(value);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user