pb.config=$.extend(this.config,argconfig);config=pb.config;}else{var $this=$(this);var config=$.extend({},$.progressBar.defaults,argconfig);config.id=$this.attr('id')?$this.attr('id'):Math.ceil(Math.random()*100000);if(argvalue==null)
argvalue=$this.html().replace("%","")
config.value=argvalue;config.running_value=0;config.image=getBarImage(config);$this.html("");var bar=document.createElement('img');var text=document.createElement('span');var $bar=$(bar);var $text=$(text);pb.bar=$bar;$bar.attr('id',config.id+"_pbImage");$text.attr('id',config.id+"_pbText");$text.html(getText(config));$bar.attr('title',getText(config));$bar.attr('alt',getText(config));$bar.attr('src',config.boxImage);$bar.attr('width',config.width);$bar.css("width",config.width+"px");$bar.css("height",config.height+"px");$bar.css("background-image","url("+config.image+")");$bar.css("background-position",((config.width*-1))+'px 50%');$bar.css("padding","0");$bar.css("margin","0");$this.append($bar);$this.append($text);}
-function getPercentage(config){return config.running_value*100/config.max;}
+function getPercentage(config){return parseInt(config.running_value*100/config.max);}
function getBarImage(config){var image=config.barImage;if(typeof(config.barImage)=='object'){for(var i in config.barImage){if(config.running_value>=parseInt(i)){image=config.barImage[i];}else{break;}}}
return image;}
function getText(config){if(config.showText){if(config.textFormat=='percentage'){return" "+Math.round(config.running_value)+"%";}else if(config.textFormat=='fraction'){return" "+config.running_value+'/'+config.max;}}}
page.javascript.write("""<script type="text/javascript">
nodes = new Array();
id = 0;
+ busy = false;
update = function() {
$.getJSON("/rpc.py", { method: "cluster_get_info", id : id++ },
function(data) {
+ // If we are already busy then exit
+ if (busy == true) return;
+
var count = 0;
if (data.error != "null") return;
+
+ busy = true;
$.each(data.result.nodes, function(i, node) {
var nodeid = node.hostname.replace(/\./g, "");
}
}
$("#count").html(count);
+ busy = false;
});
}