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

feature : Fix initrd and kernel switches

This commit is contained in:
Daniel Molina 2015-05-29 13:13:19 +02:00
parent 0639703b36
commit 9a0e2c7836
2 changed files with 34 additions and 4 deletions
src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs

@ -161,6 +161,38 @@ define(function(require) {
Tips.setup(context);
context.foundation('reflow', 'tab');
var kernelDSContext = $(".kernel_ds", context);
var kernelDSInputsContext = $("#kernel_path_inputs", context);
$("input[name='kernel_type']", context).change(function() {
if ($("input[name='kernel_type']:checked", context).val() == "kernel_ds") {
kernelDSContext.toggle();
kernelDSInputsContext.hide();
$("[wizard_field]", kernelDSContext).prop('wizard_field_disabled', false);
$("[wizard_field]", kernelDSInputsContext).prop('wizard_field_disabled', true);
} else {
kernelDSContext.hide();
kernelDSInputsContext.toggle();
$("[wizard_field]", kernelDSInputsContext).prop('wizard_field_disabled', false);
$("[wizard_field]", kernelDSContext).prop('wizard_field_disabled', true);
}
});
var initrdDSContext = $(".initrd_ds", context);
var initrdDSInputsContext = $("#initrd_path_inputs", context);
$("input[name='initrd_type']", context).change(function() {
if ($("input[name='initrd_type']:checked", context).val() == "initrd_ds") {
initrdDSContext.toggle();
initrdDSInputsContext.hide();
$("[wizard_field]", initrdDSContext).prop('wizard_field_disabled', false);
$("[wizard_field]", initrdDSInputsContext).prop('wizard_field_disabled', true);
} else {
initrdDSContext.hide();
initrdDSInputsContext.toggle();
$("[wizard_field]", initrdDSInputsContext).prop('wizard_field_disabled', false);
$("[wizard_field]", initrdDSContext).prop('wizard_field_disabled', true);
}
});
/* TODO
that.kernelFileTable.initialize({
'selectOptions': {

@ -129,7 +129,6 @@
<br>
<div class="kernel_ds">
{{! TODO kernelFilesTableSelectHTML}}
<br>
<div id="kernel_ds_inputs" class="row">
<div class="large-12 columns">
<label for="KERNEL_DS">{{tr "KERNEL_DS"}}</label>
@ -153,13 +152,12 @@
<input id="radioInintrdDs" type="radio" name="initrd_type" value="initrd_ds" checked>
<label for="radioInintrdDs">{{tr "Registered Image "}}</label>
<input id="radioInitrdPath" type="radio" name="initrd_type" value="initrd_path">
<label for="radioInitrdPath">{{tr "Remote PATH"}}"</label>
<label for="radioInitrdPath">{{tr "Remote PATH"}}</label>
</div>
</div>
<br>
<div class="initrd_ds">
{{! TODO initrdFilesTableSelectHTML}}
<br>
<div class="row">
<div class="large-12 columns">
<label for="INITRD_DS">{{tr "INITRD_DS"}}</label>
@ -170,7 +168,7 @@
<div id="initrd_path_inputs" class="initrd_path hidden">
<div class="row">
<div class="large-12 columns">
<label class="inline" for="INITRD">
<label for="INITRD">
{{tr "PATH"}}
<span class="tip">{{tr "Path to the initrd image"}}</span>
</label>