mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-23 17:33:56 +03:00
parent
7b587cd1a5
commit
7f7f65cd64
@ -179,7 +179,7 @@ define(function(require) {
|
||||
* @param {Function} callback will be called as callback( retrieve(context) )
|
||||
*/
|
||||
function _setCallback(context, callback) {
|
||||
context.on("input", function(){
|
||||
context.on("change", function(){
|
||||
callback( _retrieve(context) );
|
||||
});
|
||||
|
||||
|
@ -386,7 +386,7 @@ 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 / 1024;
|
||||
var memoryCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_COST;
|
||||
var memoryUnitCost = template_json.VMTEMPLATE.TEMPLATE.MEMORY_UNIT_COST;
|
||||
|
||||
if (cpuCost == undefined){
|
||||
@ -395,6 +395,10 @@ define(function(require) {
|
||||
|
||||
if (memoryCost == undefined){
|
||||
memoryCost = Config.onedConf.DEFAULT_COST.MEMORY_COST;
|
||||
} else {
|
||||
if (memoryUnitCost == "GB"){
|
||||
memoryCost = memoryCost / 1024;
|
||||
}
|
||||
}
|
||||
|
||||
if ((cpuCost != 0 || memoryCost != 0) && Config.isFeatureEnabled("showback")) {
|
||||
@ -403,14 +407,14 @@ define(function(require) {
|
||||
CapacityInputs.setCallback(capacityContext, function(values){
|
||||
var cost = 0;
|
||||
|
||||
if (values.CPU != undefined){
|
||||
cost += cpuCost * values.CPU;
|
||||
}
|
||||
|
||||
if (values.MEMORY != undefined){
|
||||
cost += memoryCost * values.MEMORY;
|
||||
}
|
||||
|
||||
if (values.CPU != undefined){
|
||||
cost += cpuCost * values.CPU;
|
||||
}
|
||||
|
||||
$(".cost_value", capacityContext).html(cost.toFixed(2));
|
||||
|
||||
_calculateCost(context);
|
||||
|
Loading…
Reference in New Issue
Block a user