diff options
Diffstat (limited to 'applications/luci-app-mwan3/luasrc/view/mwan')
5 files changed, 0 insertions, 309 deletions
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm deleted file mode 100644 index b3210ee137..0000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm +++ /dev/null @@ -1,114 +0,0 @@ -<%# - Copyright 2014 Aedan Renner <chipdankly@gmail.com> - Copyright 2018 Florian Eckert <fe@dev.tdt.de> - Licensed to the public under the GNU General Public License v2. --%> - -<script type="text/javascript">//<![CDATA[ - -function secondsToString(time) { - var seconds = parseInt(time, 10); - - var hrs = Math.floor(seconds / 3600); - seconds -= hrs*3600; - var mnts = Math.floor(seconds / 60); - seconds -= mnts*60; - return String.format("%sh:%sm:%ss", hrs, mnts, seconds); -} - -XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null, - function(x, status) - { - var statusDiv = document.getElementById('mwan_status_text'); - if (status.interfaces) - { - var statusview = ''; - for ( var iface in status.interfaces) - { - var state = ''; - var css = ''; - var time = ''; - switch (status.interfaces[iface].status) - { - case 'online': - state = '<%:Online%>'; - time = String.format( - '<div><strong><%:Uptime%>: </strong>%s</div>', - secondsToString(status.interfaces[iface].online) - ); - css = 'success'; - break; - case 'offline': - state = '<%:Offline%>'; - time = String.format( - '<div><strong><%:Downtime%>: </strong>%s</div>', - secondsToString(status.interfaces[iface].offline) - ); - css = 'danger'; - break; - case 'notracking': - state = '<%:No Tracking%>'; - if ((status.interfaces[iface].uptime) > 0) { - time = String.format( - '<div><strong><%:Uptime%>: </strong>%s</div>', - secondsToString(status.interfaces[iface].uptime) - ); - css = 'success'; - } - else { - time = '<div> </div>' - css = 'warning'; - } - break; - default: - state = '<%:Disabled%>'; - time = '<div> </div>' - css = 'warning'; - break; - } - statusview += String.format( - '<div class="alert-message %s">', - css - ); - statusview += String.format( - '<div><strong><%:Interface%>: </strong>%s</div>', - iface - ); - statusview += String.format( - '<div><strong><%:Status%>: </strong>%s</div>', - state - ); - if (time) - { - statusview += time; - } - statusview += '</div>' - } - statusDiv.innerHTML = statusview; - } - else - { - statusDiv.innerHTML = '<strong><%:No MWAN interfaces found%></strong>'; - } - } - ); -//]]></script> - -<style type="text/css"> - #mwan_status_text > div { - display: inline-block; - margin: 1rem; - padding: 1rem; - width: 15rem; - float: left; - line-height: 125%; - } -</style> - -<fieldset id="interface_field" class="cbi-section"> - <legend><%:MWAN Interfaces%></legend> - <div id="mwan_status_text"> - <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> - <%:Collecting data...%> - </div> -</fieldset> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm deleted file mode 100644 index 77fce3f913..0000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm +++ /dev/null @@ -1,39 +0,0 @@ -<%# - Copyright 2014 Aedan Renner <chipdankly@gmail.com> - Copyright 2018 Florian Eckert <fe@dev.tdt.de> - Licensed to the public under the GNU General Public License v2. --%> - -<%+header%> - -<ul class="cbi-tabmenu"> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface%></a></li> - <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detail%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/diagnostics")%>"><%:Diagnostics%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/troubleshooting")%>"><%:Troubleshooting%></a></li> -</ul> - -<script type="text/javascript">//<![CDATA[ - XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "detailed_status")%>', null, - function(x) - { - var output = document.getElementById('diag-rc-output'); - output.innerHTML = String.format('<pre>%h</pre>', x.responseText); - } - ); -//]]></script> - -<div class="cbi-map"> - <h2 name="content"><%:MWAN Status - Detail%></h2> - <%if not require("luci.sys").init.enabled("mwan3") then%> - <div><strong><%:INFO: MWAN not running%></strong></div> - <%end%> - <fieldset class="cbi-section"> - <span id="diag-rc-output"> - <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" /> - <%:Collecting data...%> - </span> - </fieldset> -</div> - -<%+footer%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm deleted file mode 100644 index b08f1d138a..0000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm +++ /dev/null @@ -1,97 +0,0 @@ -<%# - Copyright 2014 Aedan Renner <chipdankly@gmail.com> - Copyright 2018 Florian Eckert <fe@dev.tdt.de> - Licensed to the public under the GNU General Public License v2. --%> - -<%+header%> - -<ul class="cbi-tabmenu"> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detail%></a></li> - <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/diagnostics")%>"><%:Diagnostics%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/troubleshooting")%>"><%:Troubleshooting%></a></li> -</ul> - -<% - local uci = require "luci.model.uci" - - local iface = {} - - uci.cursor():foreach("mwan3", "interface", - function (section) - table.insert(iface, section[".name"]) - end - ) -%> - -<script type="text/javascript">//<![CDATA[ - var stxhr = new XHR(); - - function update_status(iface, task) - { - var output = document.getElementById('diag-rc-output'); - - output.innerHTML = - '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" />' + - "<%:Waiting for command to complete...%>" - ; - - output.parentNode.style.display = 'block'; - output.style.display = 'inline'; - - stxhr.post('<%=url('admin/status/mwan')%>/diagnostics_display' + '/' + iface + '/' + task, { token: '<%=token%>' }, - function(x) - { - output.innerHTML = String.format('<pre>%h</pre>', x.responseText); - } - ); - } -//]]></script> - -<form method="post" action="<%=url('admin/network/diagnostics')%>"> - <div class="cbi-map"> - <h2 name="content"><%:MWAN Status - Diagnostics%></h2> - <%if not require("luci.sys").init.enabled("mwan3") then%> - <div><strong><%:INFO: MWAN not running%></strong></div> - <%end%> - <div class="cbi-section"> - <div class="cbi-section-node"> - <div class="cbi-value"> - <label class="cbi-value-title"><%:Interface%></label> - <div class="cbi-value-field"> - <select class="cbi-input-select" name="iface"> - <% for _, z in ipairs(iface) do -%><option value="<%=z%>"><%=z%></option><%- end %> - </select> - </div> - </div> - </div> - - <div class="cbi-section-node"> - <div class="cbi-value"> - <label class="cbi-value-title"><%:Task%></label> - <div class="cbi-value-field"> - <select class="cbi-input-select" name="task"> - <option value="ping_gateway"><%:Ping default gateway%></option> - <option value="ping_trackips"><%:Ping tracking IP%></option> - <option value="check_rules"><%:Check IP rules%></option> - <option value="check_routes"><%:Check routing table%></option> - <option value="hotplug_ifup"><%:Hotplug ifup%></option> - <option value="hotplug_ifdown"><%:Hotplug ifdown%></option> - </select> - </div> - </div> - </div> - </div> - - <div class="cbi-section-create"> - <input type="button" value="<%:Execute%>" class="btn cbi-button cbi-button-apply" onclick="update_status(this.form.iface.value, this.form.task.value)"/> - </div> - - <div class="cbi-section" style="display:none"> - <span id="diag-rc-output"></span> - </div> - </div> -</form> - -<%+footer%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm deleted file mode 100644 index 962cde521d..0000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm +++ /dev/null @@ -1,20 +0,0 @@ -<%# - Copyright 2014 Aedan Renner <chipdankly@gmail.com> - Copyright 2018 Florian Eckert <fe@dev.tdt.de> - Licensed to the public under the GNU General Public License v2. --%> - -<%+header%> - -<ul class="cbi-tabmenu"> - <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detail%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/diagnostics")%>"><%:Diagnostics%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/troubleshooting")%>"><%:Troubleshooting%></a></li> -</ul> - - -<div class="cbi-map"> - <%+mwan/overview_status_interface%> -</div> -<%+footer%> diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm deleted file mode 100644 index a20516bd2a..0000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm +++ /dev/null @@ -1,39 +0,0 @@ -<%# - Copyright 2014 Aedan Renner <chipdankly@gmail.com> - Copyright 2018 Florian Eckert <fe@dev.tdt.de> - Licensed to the public under the GNU General Public License v2. --%> - -<%+header%> - -<ul class="cbi-tabmenu"> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detail%></a></li> - <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/diagnostics")%>"><%:Diagnostics%></a></li> - <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/troubleshooting")%>"><%:Troubleshooting%></a></li> -</ul> - -<script type="text/javascript">//<![CDATA[ - XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "troubleshooting_display")%>', null, - function(x) - { - var output = document.getElementById('diag-rc-output'); - output.innerHTML = String.format('<pre>%h</pre>', x.responseText); - } - ); -//]]></script> - -<div class="cbi-map"> - <h2 name="content"><%:MWAN Status - Troubleshooting%></h2> - <%if not require("luci.sys").init.enabled("mwan3") then%> - <div><strong><%:INFO: MWAN not running%></strong></div> - <%end%> - <fieldset class="cbi-section"> - <span id="diag-rc-output"> - <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" /> - <%:Collecting data...%> - </span> - </fieldset> -</div> - -<%+footer%> |