mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-19 06:50:07 +03:00
(cherry picked from commit 3bf4870a94617688d750041331ada101e0954bc5)
This commit is contained in:
parent
96b0925567
commit
f3843fa2d3
@ -36,15 +36,15 @@ define(function(require) {
|
||||
var allocatedCPU = parseInt(hostShare.CPU_USAGE,10);
|
||||
if (maxCPU > 0) {
|
||||
var ratioAllocatedCPU = Math.round((allocatedCPU / maxCPU) * 100);
|
||||
infoStr = allocatedCPU + ' / ' + maxCPU + ' (' + ratioAllocatedCPU + '%)';
|
||||
} else {
|
||||
infoStr = "";
|
||||
}
|
||||
allocatedCPUBar = ProgressBar.html(allocatedCPU, maxCPU, infoStr);
|
||||
infoStr = allocatedCPU + ' / ' + maxCPU + ' (' + ratioAllocatedCPU + '%)';
|
||||
} else {
|
||||
infoStr = "";
|
||||
}
|
||||
var realCPUBar
|
||||
allocatedCPUBar = ProgressBar.html(allocatedCPU, maxCPU, infoStr);
|
||||
}
|
||||
var realCPUBar;
|
||||
if (hostMonitoring && hostMonitoring.USED_CPU) {
|
||||
var totalCPU = parseInt(hostShare.TOTAL_CPU||0);
|
||||
var totalCPU = hostShareFlag ? parseInt(hostShare.MAX_CPU||0) : parseInt(hostShare.TOTAL_CPU||0);
|
||||
var realCPU = parseInt(hostMonitoring.USED_CPU,10);
|
||||
if (totalCPU > 0) {
|
||||
var ratioRealCPU = Math.round((realCPU / totalCPU) * 100);
|
||||
|
@ -43,9 +43,9 @@ define(function(require) {
|
||||
allocatedMemBar = ProgressBar.html(allocatedMem, maxMem, infoStr);
|
||||
}
|
||||
var realMemBar;
|
||||
if (hostMonitoring && hostMonitoring.USED_MEMORY) {
|
||||
var totalMem = parseInt(hostShare.TOTAL_MEM||0);
|
||||
var realMem = parseInt(hostMonitoring.USED_MEMORY,10);
|
||||
if (hostMonitoring && (hostMonitoring.USED_MEMORY || hostMonitoring.USED_MEM)) {
|
||||
var totalMem = hostShareFlag ? parseInt(hostShare.MAX_MEM||0) : parseInt(hostShare.TOTAL_MEM||0);
|
||||
var realMem = hostShareFlag ? parseInt(hostMonitoring.USED_MEM,10) : parseInt(hostMonitoring.USED_MEMORY,10);
|
||||
if (totalMem > 0) {
|
||||
var ratioRealMem = Math.round((realMem / totalMem) * 100);
|
||||
infoStr = Humanize.size(realMem) + ' / ' + Humanize.size(totalMem) + ' (' + ratioRealMem + '%)';
|
||||
|
Loading…
x
Reference in New Issue
Block a user