don't crash js if a backend service is not running

This commit is contained in:
Martin Konecny 2012-08-20 17:09:59 -04:00
parent 4f7c8bf0db
commit 4d8dc01638
1 changed files with 16 additions and 14 deletions

View File

@ -46,6 +46,7 @@ function success(data, textStatus, jqXHR){
for (var key in services) {
var s = services[key];
if (s) {
var children = $("#"+s.name).children();
$(children[0]).text(s.name);
@ -61,6 +62,7 @@ function success(data, textStatus, jqXHR){
$(children[3]).text(s.cpu_perc);
$(children[4]).text(sprintf('%01.1fMB (%s)', parseInt(s.memory_kb)/1000, s.memory_perc));
}
}
if (data.status.partitions){
generatePartitions(data.status.partitions);
}