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

F #3383: Filter for the NIC in sunstone (#4118)

(cherry picked from commit 3b1773f50967e0015eb08360cc6dcad0a5702a44)
This commit is contained in:
Sergio Betanzos 2020-01-24 10:28:53 +01:00 committed by Tino Vazquez
parent b8138fddfa
commit 0f428a7ec1
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE
2 changed files with 21 additions and 4 deletions

View File

@ -138,10 +138,16 @@ define(function(require) {
if (aliasJSON.length > 0) { templateJSON['NIC_ALIAS'] = aliasJSON; };
if (pcisJSON.length > 0) { templateJSON['NIC_PCI'] = pcisJSON; };
var nicDefault = WizardFields.retrieveInput($('#DEFAULT_MODEL', context));
if (nicDefault) {
templateJSON['NIC_DEFAULT'] = {
'MODEL': nicDefault
var nicDefaultModel = WizardFields.retrieveInput($('#DEFAULT_MODEL', context));
var nicDefaultFilter = WizardFields.retrieveInput($('#DEFAULT_FILTER', context));
if (nicDefaultModel || nicDefaultFilter) {
templateJSON['NIC_DEFAULT'] = {}
if (nicDefaultModel) {
templateJSON['NIC_DEFAULT']['MODEL'] = nicDefaultModel
}
if (nicDefaultFilter) {
templateJSON['NIC_DEFAULT']['FILTER'] = nicDefaultFilter
}
}
@ -236,6 +242,9 @@ define(function(require) {
if (nicDefault.MODEL) {
WizardFields.fillInput($('#DEFAULT_MODEL', context), nicDefault.MODEL);
}
if (nicDefault.FILTER) {
WizardFields.fillInput($('#DEFAULT_FILTER', context), nicDefault.FILTER);
}
delete templateJSON.NIC_DEFAULT;
}

View File

@ -41,5 +41,13 @@
<input type="text" id="DEFAULT_MODEL" name="DEFAULT_MODEL"/>
</div>
</div>
<div class="row not_lxd">
<div class="medium-6 columns">
<label for="DEFAULT_FILTER">
{{tr "Default network filtering rule for all NICs"}}
</label>
<input type="text" id="DEFAULT_FILTER" name="DEFAULT_FILTER"/>
</div>
</div>
</div>
</div>