mirror of https://github.com/apache/cloudstack.git
new UI - VM statistics - fix a bug that bar chart didn't show correctly.
This commit is contained in:
parent
111b0a1df1
commit
f901e16da6
|
|
@ -318,7 +318,7 @@ function capacityBarChart($capacity, percentused) { // e.g. percentused == "51.2
|
|||
var percentused2 = (percentused + "%");
|
||||
$capacity.find("#percentused").text(percentused2);
|
||||
|
||||
var percentusedFloat = parseFloat(percentused);
|
||||
var percentusedFloat = parseFloat(percentused); // e.g. percentusedFloat == 51.27
|
||||
if (percentusedFloat <= 60)
|
||||
$capacity.find("#bar_chart").removeClass().addClass("db_barbox low").css("width", percentused2);
|
||||
else if (percentusedFloat > 60 && percentusedFloat <= 80 )
|
||||
|
|
|
|||
|
|
@ -1564,17 +1564,17 @@ function drawBarChart($capacity, percentused) { //percentused == "0.01%" (having
|
|||
if(percentused.indexOf("%") != -1) {
|
||||
percentused = percentused.replace("%", "");
|
||||
percentusedFloat = parseFloat(percentused);
|
||||
percentusedFloat = percentusedFloat * 0.01; //because % is removed
|
||||
percentusedFloat = percentusedFloat * 0.01; //because % is removed. percentusedFloat == 0.0001
|
||||
}
|
||||
else {
|
||||
percentusedFloat = parseFloat(percentused);
|
||||
}
|
||||
|
||||
if (percentusedFloat <= 60)
|
||||
if (percentusedFloat <= 0.6)
|
||||
$capacity.find("#bar_chart").removeClass().addClass("db_barbox low").css("width", percentused);
|
||||
else if (percentusedFloat > 60 && percentusedFloat <= 80 )
|
||||
else if (percentusedFloat > 0.6 && percentusedFloat <= 0.8 )
|
||||
$capacity.find("#bar_chart").removeClass().addClass("db_barbox mid").css("width", percentused);
|
||||
else if (percentusedFloat > 80 )
|
||||
else if (percentusedFloat > 0.8 )
|
||||
$capacity.find("#bar_chart").removeClass().addClass("db_barbox high").css("width", percentused);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue