diff --git a/src/sunstone/public/app/tabs/hosts-tab/panels/info.js b/src/sunstone/public/app/tabs/hosts-tab/panels/info.js index 61b6dd5a38..75b089abde 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/hosts-tab/panels/info.js @@ -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, diff --git a/src/sunstone/public/app/tabs/hosts-tab/utils/cpu-bars.js b/src/sunstone/public/app/tabs/hosts-tab/utils/cpu-bars.js index 4c3f475a31..123ef7f0b2 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/utils/cpu-bars.js +++ b/src/sunstone/public/app/tabs/hosts-tab/utils/cpu-bars.js @@ -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 + '%)'; diff --git a/src/sunstone/public/app/tabs/hosts-tab/utils/memory-bars.js b/src/sunstone/public/app/tabs/hosts-tab/utils/memory-bars.js index 97dac5bd75..2f7b2452c4 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/utils/memory-bars.js +++ b/src/sunstone/public/app/tabs/hosts-tab/utils/memory-bars.js @@ -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 + '%)'; diff --git a/src/sunstone/public/app/tabs/hosts-tab/utils/reserved.js b/src/sunstone/public/app/tabs/hosts-tab/utils/reserved.js index dabab9fecf..ed1d301f75 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/utils/reserved.js +++ b/src/sunstone/public/app/tabs/hosts-tab/utils/reserved.js @@ -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; }