Files
MaxWaterSystem-Lite/HTML/Configuration.html
Patrick McDonagh aba5ed61f5 Completes MAXH2O-81.
Adds toggle to hide/show control buttons.
2017-12-01 12:33:28 -06:00

127 lines
6.0 KiB
HTML

<div class="row row-flex">
<div class="col-md-6 box-me entry-top-level" id="low_flow_gpm">
<div style="margin-left:15px;">
<h2>Low Flow Setpoint</h2>
<form class="form-inline">
<div class="form-group" style="margin-bottom:15px;">
<label
class="sr-only"
for="<%= channels["flowmonitor.low_flow_gpm"].channelId %>">Low Flow Limit (GPM)</label>
<div class="input-group">
<input
class="form-control channel_value"
type="number"
step="any"
value="<%=channels['flowmonitor.low_flow_gpm'].value %>">
<div class="input-group-addon">GPM</div>
</div>
</div>
<hr />
<a
href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend=1.0
data-channelId="<%= channels["flowmonitor.low_flow_gpm"].channelId %>"
data-techname="<%=channels["flowmonitor.low_flow_gpm"].techName %>"
data-name="<%= channels["flowmonitor.low_flow_gpm"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.low_flow_gpm"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.low_flow_gpm"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<div class="col-md-6 box-me entry-top-level" id="cost_per_bbl">
<div style="margin-left:15px;">
<h2>Cost per BBL</h2>
<form class="form-inline">
<div class="form-group" style="margin-bottom:15px;">
<label
class="sr-only"
for="<%= channels["flowmonitor.cost_per_bbl"].channelId %>">Cost Per BBL ($)</label>
<div class="input-group">
<input
class="form-control channel_value"
type="number"
step="any"
value="<%=channels['flowmonitor.cost_per_bbl'].value %>">
<div class="input-group-addon">$</div>
</div>
</div>
<hr />
<a
href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend=1.0
data-channelId="<%= channels["flowmonitor.cost_per_bbl"].channelId %>"
data-techname="<%=channels["flowmonitor.cost_per_bbl"].techName %>"
data-name="<%= channels["flowmonitor.cost_per_bbl"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.cost_per_bbl"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.cost_per_bbl"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
</div>
<div class="row row-flex">
<div class="col-md-6 text-center box-me" id="start-stop-toggle">
<% if (channels['flowmonitor.start_stop_enabled'].value == "True"){ %>
<h2>Start / Stop Relay Enabled</h2>
<% } else { %>
<h2>Start / Stop Relay Disabled</h2>
<% } %>
<div data-valueupdate="start_stop_enabled" data-refreshonupdate=true>
<form>
<% if (channels['flowmonitor.start_stop_enabled'].value == "True"){ %>
<a
href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="False"
data-channelId="<%= channels["flowmonitor.start_stop_enabled"].channelId %>"
data-techname="<%=channels["flowmonitor.start_stop_enabled"].techName %>"
data-name="<%= channels["flowmonitor.start_stop_enabled"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.start_stop_enabled"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.start_stop_enabled"].channelId %>"
class="btn btn-large btn-theme animated setstatic">Disable Control</a>
<% } else { %>
<a
href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="True"
data-channelId="<%= channels["flowmonitor.start_stop_enabled"].channelId %>"
data-techname="<%=channels["flowmonitor.start_stop_enabled"].techName %>"
data-name="<%= channels["flowmonitor.start_stop_enabled"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.start_stop_enabled"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.start_stop_enabled"].channelId %>"
class="btn btn-large btn-theme animated setstatic">Enable Control</a>
<% } %>
</form>
</div>
</div>
</div>
<script>
$('.channel_value').each(function(topLevel){
$(this).change(function(){
var id = "#" + $(this).closest(".entry-top-level").attr('id');
if (id !== "#undefined"){
var val = $(id).find('.channel_value').val();
var tag = $(id).find('.setstatic').attr('data-staticsend', val);
console.log($(id).find('.setstatic').attr('data-staticsend'));
}
});
});
</script>