1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-14 01:57:24 +03:00

F #5173: Add validation option to raw part (#713)

This commit is contained in:
Sergio Betanzos 2021-01-28 19:19:02 +01:00 committed by GitHub
parent b03be57ca8
commit bbda529cea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 5 deletions

View File

@ -92,6 +92,8 @@ define(function(require) {
if (rawType != undefined) {
rawJSON['TYPE'] = rawType;
}
rawJSON['VALIDATE'] = $("#raw_validate", context).is(":checked") ? 'YES' : 'NO';
}
if (!$.isEmptyObject(rawJSON)) { templateJSON['RAW'] = rawJSON; };
@ -104,8 +106,13 @@ define(function(require) {
if (rawJSON) {
$('.raw_type', context).val(rawJSON['TYPE']);
$('.raw_type', context).change();
WizardFields.fillInput($('.raw_data', context), rawJSON['DATA']);
if (['yes', 'YES'].includes(rawJSON['VALIDATE'])) {
$("#raw_validate", context).prop('checked', 'checked');
}
delete templateJSON.RAW;
}

View File

@ -29,11 +29,19 @@
</label>
</div>
<div class="medium-8 columns">
<label>
{{tr "Data"}}
{{{tip (tr "Raw data to be passed directly to the hypervisor")}}}
<textarea rows="2" type="text" class="raw_data"/>
</label>
<div class="row">
<div class="large-12 columns">
<label>
{{tr "Data"}}
{{{tip (tr "Raw data to be passed directly to the hypervisor")}}}
<textarea rows="2" type="text" class="raw_data"/>
</label>
</div>
<div class="large-12 columns">
<input type="checkbox" id="raw_validate" name="raw_validate">
<label for="raw_validate">{{tr "Validate"}}</label>
</div>
</div>
</div>
</div>
</fieldset>