Skip to content

Commit e05defc

Browse files
committed
CLOUDSTACK-1984:Wrong mapping of resource names to the capacity function on the dashboard
1 parent 0abfe24 commit e05defc

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

ui/scripts/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
return {
239239
zoneID: capacity.zoneid, // Temporary fix for dashboard
240240
zoneName: capacity.zonename,
241-
type: cloudStack.converters.toAlertType(capacity.type),
241+
type: cloudStack.converters.toCapacityCountType(capacity.type),
242242
percent: parseInt(capacity.percentused),
243243
used: cloudStack.converters.convertByType(capacity.type, capacity.capacityused),
244244
total: cloudStack.converters.convertByType(capacity.type, capacity.capacitytotal)

ui/scripts/sharedFunctions.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,31 @@ cloudStack.converters = {
425425
case 26 : return "Resource Limit Exceeded";
426426
}
427427
},
428+
429+
toCapacityCountType:function(capacityCode){
430+
switch(capacityCode){
431+
case 0 : return _l('label.memory');
432+
case 1 : return _l('label.cpu');
433+
case 2 : return _l('label.storage');
434+
case 3 : return _l('label.primary.storage');
435+
case 4 : return _l('label.public.ips');
436+
case 5 : return _l('label.management.ips');
437+
case 6 : return _l('label.secondary.storage');
438+
case 7 : return _l('label.vlan');
439+
case 8 : return _l('label.direct.ips');
440+
case 9 : return _l('label.local.storage');
441+
case 10 : return "Routing Host";
442+
case 11 : return "Storage";
443+
case 12 : return "Usage Server";
444+
case 13 : return "Management Server";
445+
case 14 : return "Domain Router";
446+
case 15 : return "Console Proxy";
447+
case 16 : return "User VM";
448+
case 17 : return "VLAN";
449+
case 18 : return "Secondary Storage VM";
450+
}
451+
},
452+
428453
convertByType: function(alertCode, value) {
429454
switch(alertCode) {
430455
case 0: return cloudStack.converters.convertBytes(value);

0 commit comments

Comments
 (0)