1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-12 09:17:41 +03:00

F #5284 Added unit size posibility (MB or GB) (#435)

* F #5284 Added unit size posibility (MB or GB) in attach volatile disk

* F #5284 Added unit size posibility (MB or GB) in create image DS
This commit is contained in:
Abel Coronado 2017-08-31 16:50:37 +02:00 committed by Ruben S. Montero
parent 79d5a4292c
commit 6b4664537c
4 changed files with 32 additions and 6 deletions

View File

@ -432,6 +432,11 @@ define(function(require) {
break;
case "datablock":
size = WizardFields.retrieveInput($('#img_size', context));
if(size && $(".mb_input_unit", context).val() == "GB"){
size = size * 1024;
size = size.toString();
}
if (size) img_json["SIZE"] = size;
var vcenter_disk_type = WizardFields.retrieveInput($('#vcenter_disk_type', context));

View File

@ -99,9 +99,19 @@
<div class="img_size row">
<div class="medium-6 columns">
<label for="img_size">
{{tr "Size in MB"}}
{{tr "Size"}}
</label>
<input type="text" name="img_size" id="img_size" />
<div class="input-group mb_input_wrapper">
<div class="input-group-field">
<input type="text" name="img_size" id="img_size" />
</div>
<div class="input-group-button">
<select class="mb_input_unit">
<option value="MB">{{tr "MB"}}</option>
<option value="GB" selected>{{tr "GB"}}</option>
</select>
</div>
</div>
</div>
<div class="medium-6 columns only_vcenter">
<label for="vcenter_disk_type">

View File

@ -148,8 +148,9 @@ define(function(require) {
var tmpl = WizardFields.retrieve(selectedContext);
if(tmpl.SIZE){
if($(".mb_input_unit", context).val() == "GB"){
tmpl.SIZE = tmpl.SIZE * 1024;
tmpl.SIZE = tmpl.SIZE.toString();
}
if($("input[name='" + this.diskTabId + "']:checked", context).val() == "image" && !tmpl["IMAGE"] && !tmpl["IMAGE_ID"]){

View File

@ -62,11 +62,21 @@
</div>
<div id="disk_type" class="volatile" style="display: none;">
<div class="row">
<div class="medium-6 columns left">
<div class="medium-6 columns">
<label for="SIZE">
{{tr "Size in GB"}}
{{tr "Size"}}
</label>
<input wizard_field="SIZE" type="number" id="SIZE" name="SIZE"/>
<div class="input-group mb_input_wrapper">
<div class="input-group-field">
<input wizard_field="SIZE" type="number" id="SIZE" name="SIZE"/>
</div>
<div class="input-group-button">
<select class="mb_input_unit">
<option value="MB">{{tr "MB"}}</option>
<option value="GB" selected>{{tr "GB"}}</option>
</select>
</div>
</div>
</div>
</div>
<div class="row">