Completes MAXH2O-81.

Adds toggle to hide/show control buttons.
This commit is contained in:
Patrick McDonagh
2017-12-01 12:33:28 -06:00
parent e4234bc2c3
commit aba5ed61f5
3 changed files with 79 additions and 34 deletions

View File

@@ -67,6 +67,48 @@
</div> </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> <script>
$('.channel_value').each(function(topLevel){ $('.channel_value').each(function(topLevel){
@@ -80,4 +122,5 @@ $('.channel_value').each(function(topLevel){
}); });
}); });
</script> </script>

View File

@@ -1,32 +1,34 @@
<div class="row row-flex box-me"> <% if (channels["flowmonitor.start_stop_enabled"].value == "True"){ %>
<div class="col-md-6 text-center"> <div class="row row-flex box-me">
<a href="#" <div class="col-md-6 text-center">
data-confirm-message="Are you sure you want to do this?" <a href="#"
data-refreshpause="1" data-confirm-message="Are you sure you want to do this?"
data-command="" data-refreshpause="1"
data-staticsend=1 data-command=""
data-channelId="<%= channels["flowmonitor.startcmd"].channelId %>" data-staticsend=1
data-techname="<%=channels["flowmonitor.startcmd"].techName %>" data-channelId="<%= channels["flowmonitor.startcmd"].channelId %>"
data-name="<%= channels["flowmonitor.startcmd"].name%>" data-techname="<%=channels["flowmonitor.startcmd"].techName %>"
data-nodechannelcurrentId="<%= channels["flowmonitor.startcmd"].nodechannelcurrentId %>" data-name="<%= channels["flowmonitor.startcmd"].name%>"
id="<%= channels["flowmonitor.startcmd"].channelId %>" data-nodechannelcurrentId="<%= channels["flowmonitor.startcmd"].nodechannelcurrentId %>"
class="btn btn-large btn-theme animated setstatic">Start</a> id="<%= channels["flowmonitor.startcmd"].channelId %>"
</div> class="btn btn-large btn-theme animated setstatic">Start</a>
</div>
<div class="col-md-6 text-center"> <div class="col-md-6 text-center">
<a href="#" <a href="#"
data-confirm-message="Are you sure you want to do this?" data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1" data-refreshpause="1"
data-command="" data-command=""
data-staticsend=1 data-staticsend=1
data-channelId="<%= channels["flowmonitor.stopcmd"].channelId %>" data-channelId="<%= channels["flowmonitor.stopcmd"].channelId %>"
data-techname="<%=channels["flowmonitor.stopcmd"].techName %>" data-techname="<%=channels["flowmonitor.stopcmd"].techName %>"
data-name="<%= channels["flowmonitor.stopcmd"].name%>" data-name="<%= channels["flowmonitor.stopcmd"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.stopcmd"].nodechannelcurrentId %>" data-nodechannelcurrentId="<%= channels["flowmonitor.stopcmd"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.stopcmd"].channelId %>" id="<%= channels["flowmonitor.stopcmd"].channelId %>"
class="btn btn-large btn-theme animated setstatic">Stop</a> class="btn btn-large btn-theme animated setstatic">Stop</a>
</div>
</div> </div>
</div> <% } %>
<div class="row row-flex box-me"> <div class="row row-flex box-me">
<div class='col-xs-6 text-center box-me'> <div class='col-xs-6 text-center box-me'>

View File

@@ -1,11 +1,11 @@
{ {
"files": { "files": {
"file3": "persistence.py", "file3": "persistence.py",
"file2": "utilities.py", "file2": "utilities.py",
"file1": "flow-monitor.py" "file1": "flow-monitor.py"
}, },
"deviceName": "flowmonitor", "deviceName": "flowmonitor",
"driverId": "0180", "driverId": "0140",
"releaseVersion": "9", "releaseVersion": "9",
"driverFileName": "flow-monitor.py" "driverFileName": "flow-monitor.py"
} }