diff --git a/ui/scripts/dashboard.js b/ui/scripts/dashboard.js
index bd628dbaf9f..a41966a6148 100644
--- a/ui/scripts/dashboard.js
+++ b/ui/scripts/dashboard.js
@@ -234,7 +234,7 @@
return {
zoneName: capacity.zoneName,
type: cloudStack.converters.toAlertType(capacity.type),
- percent: capacity.percentused,
+ percent: parseInt(capacity.percentused),
used: cloudStack.converters.convertByType(capacity.type, capacity.capacityused),
total: cloudStack.converters.convertByType(capacity.type, capacity.capacitytotal)
};
diff --git a/ui/scripts/ui-custom/dashboard.js b/ui/scripts/ui-custom/dashboard.js
index 908a1d8676e..10f792c20ce 100644
--- a/ui/scripts/ui-custom/dashboard.js
+++ b/ui/scripts/ui-custom/dashboard.js
@@ -26,20 +26,24 @@
$.each(item, function(arrayKey, arrayValue) {
var $arrayElem = $li.find('[data-list-item=' + arrayKey + ']');
- if ($arrayElem.hasClass('pie-chart')) {
- // Generate pie chart
- // -- values above 80 have a red color
- pieChart($arrayElem, [
- { data: [[1, 100 - arrayValue]], color: '#54697e' },
- { data: [[1, arrayValue]], color: arrayValue < 80 ? 'orange' : 'red' }
- ]);
- } else {
- if ($li.attr('concat-value') == 'true') {
- $arrayElem.html(arrayValue.substring(0, 50).concat('...'));
+ $arrayElem.each(function() {
+ var $arrayElem = $(this);
+
+ if ($arrayElem.hasClass('pie-chart')) {
+ // Generate pie chart
+ // -- values above 80 have a red color
+ pieChart($arrayElem, [
+ { data: [[1, 100 - arrayValue]], color: '#54697e' },
+ { data: [[1, arrayValue]], color: arrayValue < 80 ? 'orange' : 'red' }
+ ]);
} else {
- $arrayElem.html(arrayValue);
+ if ($li.attr('concat-value') == 'true') {
+ $arrayElem.html(arrayValue.substring(0, 50).concat('...'));
+ } else {
+ $arrayElem.html(arrayValue);
+ }
}
- }
+ });
});
$li.attr({ title: item.description });