diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js index 65f905de5f..99c2675e01 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js @@ -22,6 +22,7 @@ define(function(require) { var CoresPerSocket = require("tabs/templates-tab/form-panels/create/wizard-tabs/utils/cores-per-socket"); var UserInputs = require("utils/user-inputs"); var WizardFields = require("utils/wizard-fields"); + var Config = require("sunstone-config"); /* TEMPLATES @@ -113,46 +114,50 @@ define(function(require) { } function _calculatedRealMemory(context){ - var memory_cost = $("#MEMORY_COST").val() || 0; - var type_cost = $("#MEMORY_UNIT_COST").val() || 0; - var memory = $("#MEMORY").val(); - - if (type_cost == "GB"){ - memory = (memory / 1024) * memory_cost * 24 * 30; - } else { - memory = memory * memory_cost * 24 * 30; + if (Config.isFeatureEnabled("showback")){ + var memory_cost = $("#MEMORY_COST").val() || 0; + var type_cost = $("#MEMORY_UNIT_COST").val() || 0; + var memory = $("#MEMORY").val(); + + if (type_cost == "GB"){ + memory = (memory / 1024) * memory_cost * 24 * 30; + } else { + memory = memory * memory_cost * 24 * 30; + } + + var realMemory = document.getElementById("real_memory_cost"); + var totalMemory = document.getElementById("total_value_memory"); + + if (realMemory && totalMemory) { + realMemory.value = memory; + totalMemory.textContent = convertCostNumber(memory); + } + + if (memory_cost != "") { + $(".total_memory_cost", context).show(); + } + _totalCost(); } - - var realMemory = document.getElementById("real_memory_cost"); - var totalMemory = document.getElementById("total_value_memory"); - - if (realMemory && totalMemory) { - realMemory.value = memory; - totalMemory.textContent = convertCostNumber(memory); - } - - if (memory_cost != "") { - $(".total_memory_cost", context).show(); - } - _totalCost(); } function _calculatedRealCpu(context){ - var cpu_cost = $("#CPU_COST").val() || 0; - var cpu = $("#CPU").val() || 0; - var totalValueCpu = document.getElementById("real_cpu_cost"); - var totalCPU = document.getElementById("total_value_cpu"); - cpu = cpu * cpu_cost * 24 * 30; - totalValueCpu.value = cpu; - if(totalValueCpu){ - var convValue = convertCostNumber(cpu); - totalCPU.textContent = convValue; - totalValueCpu.textContent = convValue; - } - if (cpu_cost != ""){ - $(".total_cpu_cost", context).show(); - } - _totalCost(); + if (Config.isFeatureEnabled("showback")){ + var cpu_cost = $("#CPU_COST").val() || 0; + var cpu = $("#CPU").val() || 0; + var totalValueCpu = document.getElementById("real_cpu_cost"); + var totalCPU = document.getElementById("total_value_cpu"); + cpu = cpu * cpu_cost * 24 * 30; + totalValueCpu.value = cpu; + if(totalValueCpu){ + var convValue = convertCostNumber(cpu); + totalCPU.textContent = convValue; + totalValueCpu.textContent = convValue; + } + if (cpu_cost != ""){ + $(".total_cpu_cost", context).show(); + } + _totalCost(); + } } function _setup(context) { diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs index 067fa42e8d..f616448839 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs @@ -195,6 +195,7 @@ +{{/isFeatureEnabled}}
@@ -216,7 +217,6 @@
-{{/isFeatureEnabled}}