1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Merge pull request #441 from abelCoronado93/bug-5330

B #5330: Solved bug in disk cost
This commit is contained in:
Jaime Melis 2017-09-04 10:20:50 +02:00 committed by GitHub
commit 5c858a6be6
2 changed files with 14 additions and 3 deletions

View File

@ -245,8 +245,12 @@ define(function(require) {
function _fill(context, templateJSON) {
var sunstone_template = templateJSON.SUNSTONE;
if(templateJSON["MEMORY_UNIT_COST"] =="GB")
if(templateJSON["MEMORY_UNIT_COST"] == "GB"){
templateJSON["MEMORY_COST"] = templateJSON["MEMORY_COST"] / 1024;
}
if(templateJSON["DISK_COST"]){
templateJSON["DISK_COST"] = templateJSON["DISK_COST"] / 1024;
}
if (sunstone_template) {
if (sunstone_template["NETWORK_SELECT"] &&
sunstone_template["NETWORK_SELECT"].toUpperCase() == "NO") {
@ -256,7 +260,6 @@ define(function(require) {
delete sunstone_template["NETWORK_SELECT"];
}
if (Config.isFeatureEnabled("vcenter_vm_folder")) {
if (templateJSON["HYPERVISOR"] == 'vcenter' &&
templateJSON["VCENTER_VM_FOLDER"]) {

View File

@ -123,6 +123,13 @@ define(function(require) {
var capacity_val = parseFloat( $(".capacity_cost_div .cost_value", $(this)).text() );
var disk_val = parseFloat( $(".provision_create_template_disk_cost_div .cost_value", $(this)).text() );
if(Number.isNaN(capacity_val)){
capacity_val = 0;
}
if(Number.isNaN(disk_val)){
disk_val = 0;
}
var total = capacity_val + disk_val;
if (total != 0 && Config.isFeatureEnabled("showback")) {
@ -379,7 +386,8 @@ define(function(require) {
CapacityInputs.fill(capacityContext, template_json.VMTEMPLATE);
var cpuCost = template_json.VMTEMPLATE.TEMPLATE.CPU_COST;
var memoryCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_COST;
var memoryCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_COST / 1024;
var memoryUnitCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_UNIT_COST;
if (cpuCost == undefined){
cpuCost = Config.onedConf.DEFAULT_COST.CPU_COST;