Revision 22f85b80

View differences:

src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/instantiate.js
164 164
                delete roleTemplate.APPEND;
165 165
                $.extend(true, that.vm_template_json.VMTEMPLATE.TEMPLATE, roleTemplate);
166 166
              }
167
              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") {
168
                vm_template_json.VMTEMPLATE.TEMPLATE['MEMORY_COST'] = vm_template_json.VMTEMPLATE.TEMPLATE['MEMORY_COST']*1024;
169
              }
170
              if (vm_template_json.VMTEMPLATE.TEMPLATE['DISK_COST']) {
171
                vm_template_json.VMTEMPLATE.TEMPLATE['DISK_COST'] = vm_template_json.VMTEMPLATE.TEMPLATE['DISK_COST']*1024;
172
              }
167 173

  
168 174
              var cost = OpenNebulaTemplate.cost(that.vm_template_json);
169 175

  
src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js
267 267

  
268 268
    $.extend(true, templateJSON, CapacityCreate.retrieve($("div.capacityCreate", context)));
269 269

  
270
    if (templateJSON['MEMORY_COST'] && templateJSON['MEMORY_UNIT_COST'] && templateJSON['MEMORY_UNIT_COST'] == "GB") {
271
      templateJSON['MEMORY_COST'] = templateJSON['MEMORY_COST']/1024;
272
    }
273
    if (templateJSON['DISK_COST']) {
274
      templateJSON['DISK_COST'] = templateJSON['DISK_COST']/1024;
275
    }
270 276
    return templateJSON;
271 277
  }
272 278

  
273 279
  function _fill(context, templateJSON) {
280

  
281
    if (templateJSON['MEMORY_COST'] && templateJSON['MEMORY_UNIT_COST'] && templateJSON['MEMORY_UNIT_COST'] == "GB") {
282
      templateJSON['MEMORY_COST'] = templateJSON['MEMORY_COST']*1024;
283
    }
284
    if (templateJSON['DISK_COST']) {
285
      templateJSON['DISK_COST'] = templateJSON['DISK_COST']*1024;
286
    }
287

  
274 288
    that.templateDISKS = $.extend(true, {}, templateJSON.DISK);
275 289
    localStorage.setItem("disksJSON", JSON.stringify(that.templateDISKS));
276 290
    var sunstone_template = templateJSON.SUNSTONE;
src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js
398 398
          var memoryCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_COST;
399 399
          var memoryUnitCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_UNIT_COST;
400 400

  
401
          if (memoryCost && memoryUnitCost && memoryUnitCost == "GB") {
402
            memoryCost = (memoryCost*1024).toString();
403
          }
404

  
401 405
          if (cpuCost == undefined){
402 406
            cpuCost = Config.onedConf.DEFAULT_COST.CPU_COST;
403 407
          }
src/sunstone/public/app/utils/disks-resize.js
30 30

  
31 31
  function _calculateCost(context, disk_cost, callback){
32 32
    var cost = 0;
33
    disk_cost = disk_cost / 1024;
34 33

  
35 34
    $(".diskContainer", context).each(function(){
36 35
      var size = 0;

Also available in: Unified diff