Skip to content

Commit

Permalink
F #2427: Added switch to select automatic selection mode for virtual …
Browse files Browse the repository at this point in the history
…networks within Template section
  • Loading branch information
juanmont committed Sep 20, 2018
1 parent ba4f0bf commit 871bb59
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ define(function(require) {
CreateUtils.setupPCIRows($(".pci-row", context));

$("input.pci-type-nic", context).change();

$("input#"+this.nicTabId+"_network_mode", context).on("change", function(){
var network_mode_on = $(this).prop("checked");

if(network_mode_on){
$(".no_auto", context).hide();
} else {
$(".no_auto", context).show();
}
});
}

function _retrieve(context) {
Expand Down Expand Up @@ -180,6 +190,10 @@ define(function(require) {
nicJSON["NIC_PCI"] = true;
}

if( $("input#"+this.nicTabId+"_network_mode", context).prop("checked") ){
nicJSON["NETWORK_MODE"] = "auto";
}

return nicJSON;
}

Expand Down Expand Up @@ -243,6 +257,10 @@ define(function(require) {
$("input.pci-type-nic", context).click();
}

if ( templateJSON["NETWORK_MODE"] && templateJSON["NETWORK_MODE"] === "auto" ) {
$("input#"+this.nicTabId+"_network_mode", context).prop("checked", true);
}

WizardFields.fill(context, templateJSON);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,28 @@
{{! See the License for the specific language governing permissions and }}
{{! limitations under the License. }}
{{! -------------------------------------------------------------------------- }}

{{{vnetsTableSelectHTML}}}
{{!-- {{#isFeatureEnabled "automatic_selection_vnet"}} --}}
<div class="row autoContainer">
<div class="large-12 large-centered columns">
<div class="switch left">
<input class="switch-input" id="{{nicTabId}}_network_mode" type="checkbox">
<label class="switch-paddle" for="{{nicTabId}}_network_mode">
</label>
</div>
<label class="left">
&nbsp;&nbsp;
{{tr "Automatic selection"}}
{{{tip (tr "The Schedule will decide which is the bets virtual network")}}}
</label>
</div>
</div>
{{!-- {{/isFeatureEnabled}} --}}
<div class="no_auto">
{{{vnetsTableSelectHTML}}}
</div>
<br>
{{#advancedSection (tr "Advanced options") }}
<fieldset>
<fieldset class="no_auto">
<legend>{{tr "Choose Network"}}</legend>
<div class="row">
<div class="medium-6 columns">
Expand Down Expand Up @@ -54,9 +71,9 @@
</label>
<input type="text" wizard_field="OPENNEBULA_MANAGED" id="OPENNEBULA_MANAGED" name="OPENNEBULA_MANAGED"/>
</div>
</div>
</div>
</fieldset>
<fieldset>
<fieldset class="no_auto">
<legend>{{tr "Override Network Values IPv4"}}</legend>
<div class="row">
<div class="medium-6 columns">
Expand Down Expand Up @@ -109,7 +126,7 @@
</div>
</div>
</fieldset>
<fieldset>
<fieldset class="no_auto">
<legend>{{tr "Override Network Values IPv6"}}</legend>
<div class="row">
<div class="medium-6 columns">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</span>
</label>
<input type="text" name="vm_name" id="vm_name" />
</div>
</div>
<div class="medium-4 columns">
<label for="vm_n_times">
{{tr "Number of instances"}}
Expand Down

0 comments on commit 871bb59

Please sign in to comment.