Skip to content

Commit

Permalink
F #2427: Added input for requirements and rank
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmont committed Oct 9, 2018
1 parent f1142d3 commit a607523
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,14 @@ define(function(require) {

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

$(".auto", context).hide();
}

function _retrieve(context) {
Expand Down Expand Up @@ -192,6 +196,16 @@ define(function(require) {

if( $("input#"+this.nicTabId+"_network_mode", context).prop("checked") ){
nicJSON["NETWORK_MODE"] = "auto";
var req = $("input#"+this.nicTabId+"_SCHED_REQUIREMENTS", context).val();
var rank = $("input#"+this.nicTabId+"_SCHED_RANK", context).val();

if ( req !== "" ){
nicJSON["SCHED_REQUIREMENTS"] = req;
}

if ( rank !== "" ){
nicJSON["SCHED_RANK"] = rank;
}
}

return nicJSON;
Expand Down Expand Up @@ -260,6 +274,15 @@ define(function(require) {
if ( templateJSON["NETWORK_MODE"] && templateJSON["NETWORK_MODE"] === "auto" ) {
$("input#"+this.nicTabId+"_network_mode", context).prop("checked", true);
$(".no_auto", context).hide();
$(".auto", context).show();

if ( templateJSON["SCHED_REQUIREMENTS"] ) {
$("input#"+this.nicTabId+"_SCHED_REQUIREMENTS", context).val(templateJSON["SCHED_REQUIREMENTS"]);
}

if ( templateJSON["SCHED_RANK"] ) {
$("input#"+this.nicTabId+"_SCHED_RANK", context).val(templateJSON["SCHED_RANK"]);
}
}

WizardFields.fill(context, templateJSON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,38 @@
{{! limitations under the License. }}
{{! -------------------------------------------------------------------------- }}
{{!-- {{#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">
<div class="only_create">
<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>
<label class="left">
&nbsp;&nbsp;
{{tr "Automatic selection"}}
{{{tip (tr "The Schedule will decide which is the bets virtual network")}}}
</label>
</div>
<div class="auto">
<div class="row autoContainer">
<div class="large-12 large-centered columns">
<label for="{{nicTabId}}_SCHED_REQUIREMENTS">
{{tr "Requirements"}}
</label>
<input type="text" id="{{nicTabId}}_SCHED_REQUIREMENTS" name="SCHED_REQUIREMENTS"/>
</div>
</div>
<div class="row autoContainer">
<div class="large-12 large-centered columns">
<label for="{{nicTabId}}_SCHED_RANK">
{{tr "Rank"}}
</label>
<input type="text" id="{{nicTabId}}_SCHED_RANK" name="SCHED_RANK"/>
</div>
</div>
</div>
</div>
{{!-- {{/isFeatureEnabled}} --}}
Expand Down

0 comments on commit a607523

Please sign in to comment.