mirror of
https://github.com/OpenNebula/one.git
synced 2025-08-24 17:49:28 +03:00
committed by
Tino Vázquez
parent
cba1e26ce9
commit
c0ab0f71f4
@ -55,7 +55,7 @@ define(function(require) {
|
||||
|
||||
function _setup(context) {
|
||||
if (Config.isFeatureEnabled("instantiate_hide_cpu")){
|
||||
$(".cpu_input_wrapper", context).remove();
|
||||
$(".cpu_input_wrapper", context).hide();
|
||||
}
|
||||
|
||||
Tips.setup(context);
|
||||
@ -85,7 +85,6 @@ define(function(require) {
|
||||
var attr;
|
||||
var input;
|
||||
|
||||
if (!Config.isFeatureEnabled("instantiate_hide_cpu")){
|
||||
if (userInputs != undefined && userInputs.CPU != undefined){
|
||||
attr = UserInputs.parse("CPU", userInputs.CPU);
|
||||
} else {
|
||||
@ -111,7 +110,6 @@ define(function(require) {
|
||||
}
|
||||
|
||||
$("div.cpu_input", context).html(input);
|
||||
}
|
||||
|
||||
if (userInputs != undefined && userInputs.VCPU != undefined){
|
||||
attr = UserInputs.parse("VCPU", userInputs.VCPU);
|
||||
@ -136,10 +134,16 @@ define(function(require) {
|
||||
$("div.vcpu_input", context).html(input);
|
||||
|
||||
if (Config.isFeatureEnabled("instantiate_cpu_factor")){
|
||||
$("div.cpu_input input", context).prop("disabled", true);
|
||||
$("div.vcpu_input input", context).on("change", function(){
|
||||
var vcpuValue = $("div.vcpu_input input", context).val();
|
||||
$("div.cpu_input input", context).val(vcpuValue * Config.scaleFactor);
|
||||
});
|
||||
} else {
|
||||
$("div.vcpu_input input", context).on("change", function(){
|
||||
var vcpuValue = $("div.vcpu_input input", context).val();
|
||||
$("div.cpu_input input", context).val(vcpuValue);
|
||||
});
|
||||
}
|
||||
|
||||
if (userInputs != undefined && userInputs.MEMORY != undefined){
|
||||
@ -163,6 +167,10 @@ define(function(require) {
|
||||
}
|
||||
|
||||
UserInputs.insertAttributeInputMB(attr, $("div.memory_input", context));
|
||||
|
||||
if (Config.isFeatureEnabled("instantiate_hide_cpu")){
|
||||
$(".vcpu_input input", context).prop("required", true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -189,12 +197,6 @@ define(function(require) {
|
||||
function _retrieve(context) {
|
||||
var values = WizardFields.retrieve(context);
|
||||
|
||||
if (Config.isFeatureEnabled("instantiate_hide_cpu")){
|
||||
if(values.VCPU != undefined){
|
||||
values.CPU = values.VCPU;
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
@ -219,12 +221,6 @@ define(function(require) {
|
||||
}
|
||||
});
|
||||
|
||||
if (Config.isFeatureEnabled("instantiate_hide_cpu")){
|
||||
if(templateJSON.VCPU != undefined){
|
||||
templateJSON.CPU = templateJSON.VCPU;
|
||||
}
|
||||
}
|
||||
|
||||
return templateJSON;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user