mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
parent
3b5311ec7b
commit
7e6091f6c5
@ -119,8 +119,8 @@ define(function(require) {
|
||||
var cpuBars = CPUBars.html(elementAux);
|
||||
var memoryBars = MemoryBars.html(elementAux);
|
||||
var datastoresCapacityTableHTML = DatastoresCapacityTable.html(this.element);
|
||||
var realCPU = parseInt(this.element.HOST_SHARE.TOTAL_CPU);
|
||||
var realMEM = parseInt(this.element.HOST_SHARE.TOTAL_MEM);
|
||||
var realCPU = parseInt(this.element.HOST_SHARE.TOTAL_CPU,10);
|
||||
var realMEM = parseInt(this.element.HOST_SHARE.TOTAL_MEM,10);
|
||||
|
||||
return TemplateInfo({
|
||||
"element": this.element,
|
||||
|
@ -29,11 +29,11 @@ define(function(require) {
|
||||
var _html = function(host, hostShareFlag) {
|
||||
var hostShare = hostShareFlag ? host : host && host.HOST_SHARE;
|
||||
var hostMonitoring = hostShareFlag ? host : host.MONITORING && host.MONITORING.CAPACITY
|
||||
var maxCPU = parseInt(hostShare.MAX_CPU||0);
|
||||
var maxCPU = parseInt(hostShare.TOTAL_CPU||0);
|
||||
var infoStr;
|
||||
var allocatedCPUBar
|
||||
if (hostShare.CPU_USAGE) {
|
||||
var allocatedCPU = parseInt(hostShare.CPU_USAGE);
|
||||
var allocatedCPU = parseInt(hostShare.CPU_USAGE,10);
|
||||
if (maxCPU > 0) {
|
||||
var ratioAllocatedCPU = Math.round((allocatedCPU / maxCPU) * 100);
|
||||
infoStr = allocatedCPU + ' / ' + maxCPU + ' (' + ratioAllocatedCPU + '%)';
|
||||
@ -44,7 +44,7 @@ define(function(require) {
|
||||
}
|
||||
var realCPUBar
|
||||
if (hostMonitoring && hostMonitoring.USED_CPU) {
|
||||
var realCPU = parseInt(hostMonitoring.USED_CPU);
|
||||
var realCPU = parseInt(hostMonitoring.USED_CPU,10);
|
||||
if (maxCPU > 0) {
|
||||
var ratioRealCPU = Math.round((realCPU / maxCPU) * 100);
|
||||
infoStr = realCPU + ' / ' + maxCPU + ' (' + ratioRealCPU + '%)';
|
||||
|
@ -43,8 +43,8 @@ define(function(require) {
|
||||
allocatedMemBar = ProgressBar.html(allocatedMem, maxMem, infoStr);
|
||||
}
|
||||
var realMemBar;
|
||||
if (hostMonitoring && hostMonitoring.USED_MEM) {
|
||||
var realMem = parseInt(hostMonitoring.USED_MEM);
|
||||
if (hostMonitoring && hostMonitoring.USED_MEMORY) {
|
||||
var realMem = parseInt(hostMonitoring.USED_MEMORY,10);
|
||||
if (maxMem > 0) {
|
||||
var ratioRealMem = Math.round((realMem / maxMem) * 100);
|
||||
infoStr = Humanize.size(realMem) + ' / ' + Humanize.size(maxMem) + ' (' + ratioRealMem + '%)';
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
define(function(require) {
|
||||
|
||||
function _updateHostTemplate(cache, element) {
|
||||
function _updateHostTemplate(cache, element) {
|
||||
var elementAux = $.extend(true, {}, element);
|
||||
if (cache && (elementAux.TEMPLATE.RESERVED_CPU === "" || elementAux.TEMPLATE.RESERVED_MEM === "")) {
|
||||
if (cache && (elementAux.TEMPLATE.RESERVED_CPU === "" || elementAux.TEMPLATE.RESERVED_MEM === "")) {
|
||||
$.each(cache.data, function(key, value){
|
||||
if (value.CLUSTER.ID === elementAux.CLUSTER_ID){
|
||||
if (elementAux.TEMPLATE.RESERVED_CPU === ""){
|
||||
@ -33,7 +33,7 @@ define(function(require) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return elementAux;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user