mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
parent
e8be19ff53
commit
890b5636d4
@ -164,6 +164,12 @@ define(function(require) {
|
||||
delete roleTemplate.APPEND;
|
||||
$.extend(true, that.vm_template_json.VMTEMPLATE.TEMPLATE, roleTemplate);
|
||||
}
|
||||
if (vm_template_json.VMTEMPLATE.TEMPLATE['MEMORY_COST'] && vm_template_json.VMTEMPLATE.TEMPLATE['MEMORY_UNIT_COST'] && vm_template_json.VMTEMPLATE.TEMPLATE['MEMORY_UNIT_COST'] == "GB") {
|
||||
vm_template_json.VMTEMPLATE.TEMPLATE['MEMORY_COST'] = vm_template_json.VMTEMPLATE.TEMPLATE['MEMORY_COST']*1024;
|
||||
}
|
||||
if (vm_template_json.VMTEMPLATE.TEMPLATE['DISK_COST']) {
|
||||
vm_template_json.VMTEMPLATE.TEMPLATE['DISK_COST'] = vm_template_json.VMTEMPLATE.TEMPLATE['DISK_COST']*1024;
|
||||
}
|
||||
|
||||
var cost = OpenNebulaTemplate.cost(that.vm_template_json);
|
||||
|
||||
|
@ -267,10 +267,24 @@ define(function(require) {
|
||||
|
||||
$.extend(true, templateJSON, CapacityCreate.retrieve($("div.capacityCreate", context)));
|
||||
|
||||
if (templateJSON['MEMORY_COST'] && templateJSON['MEMORY_UNIT_COST'] && templateJSON['MEMORY_UNIT_COST'] == "GB") {
|
||||
templateJSON['MEMORY_COST'] = templateJSON['MEMORY_COST']/1024;
|
||||
}
|
||||
if (templateJSON['DISK_COST']) {
|
||||
templateJSON['DISK_COST'] = templateJSON['DISK_COST']/1024;
|
||||
}
|
||||
return templateJSON;
|
||||
}
|
||||
|
||||
function _fill(context, templateJSON) {
|
||||
|
||||
if (templateJSON['MEMORY_COST'] && templateJSON['MEMORY_UNIT_COST'] && templateJSON['MEMORY_UNIT_COST'] == "GB") {
|
||||
templateJSON['MEMORY_COST'] = templateJSON['MEMORY_COST']*1024;
|
||||
}
|
||||
if (templateJSON['DISK_COST']) {
|
||||
templateJSON['DISK_COST'] = templateJSON['DISK_COST']*1024;
|
||||
}
|
||||
|
||||
that.templateDISKS = $.extend(true, {}, templateJSON.DISK);
|
||||
localStorage.setItem("disksJSON", JSON.stringify(that.templateDISKS));
|
||||
var sunstone_template = templateJSON.SUNSTONE;
|
||||
|
@ -501,6 +501,10 @@ define(function(require) {
|
||||
var memoryCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_COST;
|
||||
var memoryUnitCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_UNIT_COST;
|
||||
|
||||
if (memoryCost && memoryUnitCost && memoryUnitCost == "GB") {
|
||||
memoryCost = (memoryCost*1024).toString();
|
||||
}
|
||||
|
||||
if (cpuCost == undefined){
|
||||
cpuCost = Config.onedConf.DEFAULT_COST.CPU_COST;
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ define(function(require){
|
||||
|
||||
function _calculateCost(context, disk_cost, callback){
|
||||
var cost = 0;
|
||||
disk_cost = disk_cost / 1024;
|
||||
|
||||
$(".diskContainer", context).each(function(){
|
||||
var size = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user