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

Feature : Volatile Disk in Sunstone dialog has more intelligence

This commit is contained in:
Jaime Melis 2016-05-06 17:47:38 +02:00
parent 4eff27b6e1
commit 540bce8ce9
3 changed files with 30 additions and 5 deletions
src/sunstone/public/app/tabs
images-tab/form-panels/create
templates-tab/form-panels/create/wizard-tabs/storage

@ -171,9 +171,9 @@
</label>
<select name="img_dev_prefix" id="img_dev_prefix">
<option value="" selected="selected"></option>
<option value="vd">virtio</option>
<option value="hd">ide</option>
<option value="sd">scsi</option>
<option value="vd">Virtio</option>
<option value="sd">SCSI</option>
<option value="hd">Parallel ATA (IDE)</option>
<option value="custom">custom</option>
</select>
<div>

@ -106,9 +106,31 @@ define(function(require) {
$("[wizard_field]", imageContext).prop('wizard_field_disabled', false);
$("[wizard_field]", volatileContext).prop('wizard_field_disabled', true);
// Volatile Type FS hides Format, Type SWAP displays Format
$("select#TYPE", volatileContext).change(function() {
var value = $(this).val();
switch (value){
case "fs":
$("select#FORMAT", volatileContext).parent().show();
break;
case "swap":
$("select#FORMAT", volatileContext).parent().hide();
break;
}
});
}
function _retrieve(context) {
var volatileContext = $("div.volatile", context);
var volatileType = $("select#TYPE", volatileContext).val();
if (volatileType == "swap")
{
$("select#FORMAT").val("");
}
return WizardFields.retrieve(context);
}

@ -194,7 +194,7 @@
{{tr "Size"}}
{{{tip (tr "Size of the new disk in MB")}}}
</label>
<input wizard_field="SIZE" type="text" id="SIZE" name="SIZE"/>
<input wizard_field="SIZE" type="text" id="SIZE" name="SIZE" required />
</div>
</div>
<div class="row">
@ -213,7 +213,10 @@
{{tr "Format"}}
{{{tip (tr "Filesystem type for the fs images")}}}
</label>
<input wizard_field="FORMAT" type="text" id="FORMAT" name="format" />
<select wizard_field="FORMAT" name="format" id="FORMAT">
<option value="raw" selected="selected">raw</option>
<option value="qcow2">qcow2</option>
</select>
</div>
</div>
<br>