Commit ae626b77 authored by Keith Downie's avatar Keith Downie

Added 'Advanced Options' section to the Finalize page

parent 6f9f7aa7
...@@ -570,6 +570,7 @@ function CheckStep2() ...@@ -570,6 +570,7 @@ function CheckStep2()
global $ajax_args; global $ajax_args;
global $ISAPT, $ISPNET, $ISCLOUD, $ISEMULAB; global $ISAPT, $ISPNET, $ISCLOUD, $ISEMULAB;
global $TB_PROJECT_CREATEEXPT; global $TB_PROJECT_CREATEEXPT;
$durationlimit = 16;
if (!isset($ajax_args["formfields"])) { if (!isset($ajax_args["formfields"])) {
SPITAJAX_ERROR(-1, "Missing formfields"); SPITAJAX_ERROR(-1, "Missing formfields");
...@@ -683,6 +684,16 @@ function CheckStep2() ...@@ -683,6 +684,16 @@ function CheckStep2()
$errors["name"] = "Already in use by another experiment"; $errors["name"] = "Already in use by another experiment";
} }
} }
if (!isset($formfields["duration"]) || $formfields["duration"] == "") {
$errors["duration"] = "Must set an experiment duration";
}
elseif (!ctype_digit($formfields["duration"]) ) {
$errors["duration"] = "Must be an integer between 1 and ".$durationlimit;
}
elseif (((int)$formfields["duration"]) <= 0 || ((int)$formfields["duration"]) > $durationlimit) {
$errors["duration"] = "Must be an integer between 1 and ".$durationlimit;
}
} }
if (count($errors)) { if (count($errors)) {
SPITAJAX_ERROR(2, $errors); SPITAJAX_ERROR(2, $errors);
......
...@@ -232,16 +232,16 @@ ...@@ -232,16 +232,16 @@
<table class='table table-condensed nospaceafter border-none' <table class='table table-condensed nospaceafter border-none'
style="font-size: 14px; font-family: Arial,sans-serif;"> style="font-size: 14px; font-family: Arial,sans-serif;">
<tr> <tr>
<td style="padding: 0px;"> <td style="padding: 0px; border: 0;">
<span style="font-weight: bolder;">Profile:</span> <span style="font-weight: bolder;">Profile:</span>
<span id='finalize_profile_name'><%= profilename %></span> <span id='finalize_profile_name'><%= profilename %></span>
</td> </td>
<td style="padding: 0px;"> <td style="padding: 0px; border: 0;">
<span style="font-weight: bolder;">Version:</span> <span style="font-weight: bolder;">Version:</span>
<span id='finalize_profile_version'><%= profilevers %> <span id='finalize_profile_version'><%= profilevers %>
</span> </span>
</td> </td>
<td style="padding: 0px;"> <td style="padding: 0px; border: 0;">
<button class='btn btn-primary btn-xs' <button class='btn btn-primary btn-xs'
type='button' type='button'
id="show_xml_modal_button"> id="show_xml_modal_button">
...@@ -356,22 +356,60 @@ ...@@ -356,22 +356,60 @@
</div> </div>
<% } %> <% } %>
<% if (1) { %> <% if (1) { %>
<div class='form-horizontal experiment_option'> <h5>
<div class='form-group format-me'> <a href="#advanced_options_dropdown" data-toggle="collapse">
<div class="row"> <span class="glyphicon glyphicon-plus-sign pull-left"
style="font-weight: bold;"></span>
<span style="font-weight: bold; margin-left: 12px">Advanced Options</span>
</a>
</h5>
<div id="advanced_options_dropdown"
class="panel-collapse collapse">
<div class='form-horizontal experiment_option'>
<div class='form-group format-me'>
<label class='col-sm-4 control-label' <label class='col-sm-4 control-label'
style='text-align: right;'>Ignore Failures:</label> style='text-align: right;'>Experiment Duration:</label>
<div class='col-sm-2'> <div class="col-sm-6"
<input id='failure_okay' type="checkbox" data-toggle='popover'
value="checked" data-delay='{hide:1500, show:500}'
class='' data-html='true'
data-key='failure_okay' data-content="Sets the intial amount of time that the
name='failure_okay' experiment will run. Limit: 16 hours. If more time is needed, the duration can be extended after the
<%= formfields.failure_okay %>> experiment has been created.">
<input id='experiment_duration'
class='form-control'
data-key='duration'
name='duration'
value='16'>
<label style='position: absolute;
top: 6px;
right: 22px;
font-weight: normal;
color: #aaa'>
hours
</label>
<label class='control-label control-error hidden'
for='duration'></label>
</div> </div>
</div> </div>
<label class='control-label control-error hidden' </div>
for='failure_okay'></label> <div class='form-horizontal experiment_option'>
<div class='form-group format-me'>
<div class="row">
<label class='col-sm-4 control-label'
style='text-align: right;'>Ignore Failures:</label>
<div class='col-sm-2'>
<input id='failure_okay' type="checkbox"
value="checked"
class=''
data-key='failure_okay'
name='failure_okay'
<%= formfields.failure_okay %>>
</div>
</div>
<label class='control-label control-error hidden'
for='failure_okay'></label>
</div>
</div> </div>
</div> </div>
<% } %> <% } %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment