luci-app-mwan3: rename status page files
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 11 Jan 2018 12:18:28 +0000 (13:18 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 11 Jan 2018 13:46:28 +0000 (14:46 +0100)
rename status page files

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-mwan3/luasrc/controller/mwan3.lua
applications/luci-app-mwan3/luasrc/view/mwan/advanced_diagnostics.htm [deleted file]
applications/luci-app-mwan3/luasrc/view/mwan/advanced_troubleshooting.htm [deleted file]
applications/luci-app-mwan3/luasrc/view/mwan/overview_detailed.htm [deleted file]
applications/luci-app-mwan3/luasrc/view/mwan/overview_interface.htm [deleted file]
applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm [new file with mode: 0644]
applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm [new file with mode: 0644]
applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm [new file with mode: 0644]
applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm [new file with mode: 0644]

index 09469bc077a51c93a14e57add7f34938727d0881..59d77966a523ca37af6138bb5de0591c2ce3ee8e 100644 (file)
@@ -15,13 +15,13 @@ function index()
                _("Load Balancing"), 600)
 
        entry({"admin", "status", "mwan", "overview"},
-               template("mwan/overview_interface"))
+               template("mwan/status_interface"))
        entry({"admin", "status", "mwan", "detail"},
-               template("mwan/overview_detailed"))
+               template("mwan/status_detail"))
        entry({"admin", "status", "mwan", "diagnostics"},
-               template("mwan/advanced_diagnostics"))
+               template("mwan/status_diagnostics"))
        entry({"admin", "status", "mwan", "troubleshooting"},
-               template("mwan/advanced_troubleshooting"))
+               template("mwan/status_troubleshooting"))
        entry({"admin", "status", "mwan", "interface_status"},
                call("interfaceStatus"))
        entry({"admin", "status", "mwan", "detailed_status"},
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_diagnostics.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_diagnostics.htm
deleted file mode 100644 (file)
index 19433f4..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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"
-
-       interfaceNames = ""
-       uci.cursor():foreach("mwan3", "interface",
-               function (section)
-                       interfaceNames = interfaceNames .. section[".name"] .. " "
-               end
-       )
-%>
-
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       var stxhr = new XHR();
-
-       function update_status(tool, task, task_name)
-       {
-               var iface = document.getElementById('mwaniface').value;
-               var output = document.getElementById('diag_output');
-
-               if (tool == "service")
-                       {
-                               output.innerHTML =
-                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
-                                       String.format("<%:Waiting for MWAN to %s...%>", task_name)
-                               ;
-                       }
-                       else
-                       {
-                               output.innerHTML =
-                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
-                                       "<%:Waiting for diagnostic results...%>"
-                               ;
-                       }
-
-               output.parentNode.style.display = 'block';
-               output.style.display = 'inline';
-
-               stxhr.get('<%=luci.dispatcher.build_url("admin", "status", "mwan")%>/diagnostics_display' + '/' + iface + '/' + tool + '/' + task, null,
-                       function(x, mArray)
-                       {
-                               if (mArray.diagnostics)
-                               {
-                                       output.innerHTML = String.format('<pre id="diag_output_css">%h</pre>', mArray.diagnostics[0]);
-                               }
-                               else
-                               {
-                                       output.innerHTML = '<pre id="diag_output_css"><strong><%:No diagnostic results returned%></strong></pre>';
-                               }
-                       }
-               );
-       }
-//]]></script>
-
-<div id="mwan_diagnostics" class="cbi-map">
-       <fieldset id="diag_select" class="cbi-section">
-               <legend><%:MWAN Interface Diagnostics%></legend>
-               <select id="mwaniface">
-                       <% for z in interfaceNames:gmatch("[^ ]+") do -%><option value="<%=z%>"><%=z%></option><%- end %>
-               </select>
-               <div id="buttoncss">
-                       <input type="button" value="<%:Ping default gateway%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'gateway', null)" />
-                       <input type="button" value="<%:Ping tracking IP%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'track_ip', null)" />
-                       <input type="button" value="<%:Check IP rules%>" class="cbi-button cbi-button-apply" onclick="update_status('rulechk', null, null)" />
-                       <input type="button" value="<%:Check routing table%>" class="cbi-button cbi-button-apply" onclick="update_status('routechk', null, null)" />
-                       <input type="button" value="<%:Hotplug ifup%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifup', null)" />
-                       <input type="button" value="<%:Hotplug ifdown%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifdown', null)" />
-               </div>
-       </fieldset>
-       <fieldset id="diag_select" class="cbi-section">
-               <legend><%:MWAN Service Control%></legend>
-               <div id="buttoncss">
-                       <input type="button" value="<%:Restart MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'restart', '<%:restart%>')" />
-                       <input type="button" value="<%:Stop MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'stop', '<%:stop%>')" />
-                       <input type="button" value="<%:Start MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'start', '<%:start%>')" />
-               </div>
-       </fieldset>
-       <fieldset class="cbi-section" style="display:none">
-               <legend><%:Diagnostic Results%></legend>
-               <div id="diag_output"></div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  #mwaniface {
-       float: left;
-       margin: 8px 20px 0px 0px;
-  }
-  #buttoncss {
-       display: table;
-       float: left;
-       text-align: left;
-  }
-  .cbi-button {
-       margin: 8px 20px 0px 0px;
-       min-width: 153px;
-  }
-  #diag_output_css {
-       padding: 20px;
-       text-align: left;
-  }
-</style>
-
-<%+footer%>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_troubleshooting.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_troubleshooting.htm
deleted file mode 100644 (file)
index 483e289..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "troubleshooting_display")%>', null,
-               function(x, mArray)
-               {
-                       var tshoot = document.getElementById('troubleshoot_text');
-                       if (mArray.versions)
-                       {
-                               var versions = '<span class="description">Software versions : </span><br /><br />';
-                               var mwanConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/mwan3&#34; : </span><br /><br />';
-                               var netConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/network&#34; : </span><br /><br />';
-                               var wifiConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/wireless&#34; : </span><br /><br />';
-                               var ifconfig = '<br /><br /><span class="description">Output of &#34;ifconfig&#34; : </span><br /><br />';
-                               var ipRoute = '<br /><br /><span class="description">Output of &#34;route -n&#34; : </span><br /><br />';
-                               var ipRuleShow = '<br /><br /><span class="description">Output of &#34;ip rule show&#34; : </span><br /><br />';
-                               var routeListTable = '<br /><br /><span class="description">Output of &#34;ip route list table 1-250&#34; : </span><br /><br />';
-                               var firewallOut = '<br /><br /><span class="description">Firewall default output policy (must be ACCEPT) : </span><br /><br />';
-                               var iptables = '<br /><br /><span class="description">Output of &#34;iptables -L -t mangle -v -n&#34; : </span><br /><br />';
-                               tshoot.innerHTML = String.format(
-                                       '<pre>%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s</pre>',
-                                       versions, mArray.versions[0], mwanConfig, mArray.mwanconfig[0], netConfig, mArray.netconfig[0],
-                                       wifiConfig, mArray.wificonfig[0], ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0],
-                                       ipRuleShow, mArray.iprule[0], routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0],
-                                       iptables, mArray.iptables[0]
-                               );
-                       }
-                       else
-                       {
-                               tshoot.innerHTML = '<strong><%:Error collecting troubleshooting information%></strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<div id="troubleshoot">
-       <fieldset class="cbi-section">
-               <legend><%:Troubleshooting Data%></legend>
-               <div id="troubleshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  #troubleshoot_text {
-       padding: 20px;
-       text-align: left;
-  }
-  .description {
-       background-color: rgb(78, 186, 241);
-  }
-</style>
-
-<%+footer%>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_detailed.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_detailed.htm
deleted file mode 100644 (file)
index 0ff2824..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "detailed_status")%>', null,
-               function(x, mArray)
-               {
-                       var status = document.getElementById('mwan_detail_text');
-                       if (mArray.mwandetail)
-                       {
-                               status.innerHTML = String.format('<pre>%s</pre>', mArray.mwandetail[0]);
-                       }
-                       else
-                       {
-                               status.innerHTML = '<strong><%:No detailed status information available%></strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<div id="mwan_detail_status">
-       <fieldset class="cbi-section">
-               <legend><%:MWAN Detailed Status%></legend>
-               <div id="mwan_detail_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  #mwan_detail_text {
-       padding: 20px;
-       text-align: left;
-  }
-</style>
-
-<%+footer%>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/overview_interface.htm b/applications/luci-app-mwan3/luasrc/view/mwan/overview_interface.htm
deleted file mode 100644 (file)
index c7039f7..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
-               function(x, mArray)
-               {
-                       var statusDiv = document.getElementById('mwan_status_text');
-                       if (mArray.wans)
-                       {
-                               var interfaceStatus = '';
-                               for ( var i = 0; i < mArray.wans.length; i++ )
-                               {
-                                       var status = '';
-                                       var css = '';
-                                       switch (mArray.wans[i].status)
-                                       {
-                                               case 'online':
-                                                       status = '<%:Online (tracking active)%>';
-                                                       css = 'wanon';
-                                                       break;
-                                               case 'notMonitored':
-                                                       status = '<%:Online (tracking off)%>';
-                                                       css = 'wanon';
-                                                       break;
-                                               case 'offline':
-                                                       status = '<%:Offline%>';
-                                                       css = 'wanoff';
-                                                       break;
-                                               case 'notEnabled':
-                                                       status = '<%:Disabled%>';
-                                                       css = 'wanoff';
-                                                       break;
-                                       }
-                                       interfaceStatus += String.format(
-                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
-                                               css, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, status
-                                       );
-                               }
-                               statusDiv.innerHTML = interfaceStatus;
-                       }
-                       else
-                       {
-                               statusDiv.innerHTML = '<strong><%:No MWAN interfaces found%></strong>';
-                       }
-
-                       var logs = document.getElementById('mwan_statuslog_text');
-                       if (mArray.mwanlog)
-                       {
-                               var mwanLog = '<%:Last 50 MWAN systemlog entries. Newest entries sorted at the top :%>';
-                               logs.innerHTML = String.format('<pre>%s<br /><br />%s</pre>', mwanLog, mArray.mwanlog[0]);
-                       }
-                       else
-                       {
-                               logs.innerHTML = '<strong><%:No MWAN systemlog history found%></strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<div id="mwan_interface_status">
-       <fieldset id="interface_field" class="cbi-section">
-               <legend><%:MWAN Interface Live Status%></legend>
-               <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
-       </fieldset>
-       <fieldset class="cbi-section">
-               <legend><%:MWAN Interface Systemlog%></legend>
-               <div id="mwan_statuslog_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  #mwan_status_text {
-       display: table;
-       font-size: 14px;
-       margin: auto;
-       max-width: 1044px;
-       min-width: 246px;
-       width: 100%;
-  }
-  .wanon {
-       background-color: rgb(144, 240, 144);
-  }
-  .wanoff {
-       background-color: rgb(240, 144, 144);
-  }
-  .wanon, .wanoff {
-       border-radius: 60px;
-       box-shadow: 0px 2px 5px -3px;
-       float: left;
-       margin: 8px 3px 0px 3px;
-       min-height: 30px;
-       min-width: 235px;
-       padding: 5px 10px 8px 10px;
-       text-align: center;
-  }
-  #mwan_statuslog_text {
-       padding: 20px;
-       text-align: left;
-  }
-</style>
-
-<%+footer%>
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm
new file mode 100644 (file)
index 0000000..0ff2824
--- /dev/null
@@ -0,0 +1,42 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "detailed_status")%>', null,
+               function(x, mArray)
+               {
+                       var status = document.getElementById('mwan_detail_text');
+                       if (mArray.mwandetail)
+                       {
+                               status.innerHTML = String.format('<pre>%s</pre>', mArray.mwandetail[0]);
+                       }
+                       else
+                       {
+                               status.innerHTML = '<strong><%:No detailed status information available%></strong>';
+                       }
+               }
+       );
+//]]></script>
+
+<div id="mwan_detail_status">
+       <fieldset class="cbi-section">
+               <legend><%:MWAN Detailed Status%></legend>
+               <div id="mwan_detail_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+       </fieldset>
+</div>
+
+<style type="text/css">
+  #mwan_detail_text {
+       padding: 20px;
+       text-align: left;
+  }
+</style>
+
+<%+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
new file mode 100644 (file)
index 0000000..19433f4
--- /dev/null
@@ -0,0 +1,113 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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"
+
+       interfaceNames = ""
+       uci.cursor():foreach("mwan3", "interface",
+               function (section)
+                       interfaceNames = interfaceNames .. section[".name"] .. " "
+               end
+       )
+%>
+
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       var stxhr = new XHR();
+
+       function update_status(tool, task, task_name)
+       {
+               var iface = document.getElementById('mwaniface').value;
+               var output = document.getElementById('diag_output');
+
+               if (tool == "service")
+                       {
+                               output.innerHTML =
+                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
+                                       String.format("<%:Waiting for MWAN to %s...%>", task_name)
+                               ;
+                       }
+                       else
+                       {
+                               output.innerHTML =
+                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
+                                       "<%:Waiting for diagnostic results...%>"
+                               ;
+                       }
+
+               output.parentNode.style.display = 'block';
+               output.style.display = 'inline';
+
+               stxhr.get('<%=luci.dispatcher.build_url("admin", "status", "mwan")%>/diagnostics_display' + '/' + iface + '/' + tool + '/' + task, null,
+                       function(x, mArray)
+                       {
+                               if (mArray.diagnostics)
+                               {
+                                       output.innerHTML = String.format('<pre id="diag_output_css">%h</pre>', mArray.diagnostics[0]);
+                               }
+                               else
+                               {
+                                       output.innerHTML = '<pre id="diag_output_css"><strong><%:No diagnostic results returned%></strong></pre>';
+                               }
+                       }
+               );
+       }
+//]]></script>
+
+<div id="mwan_diagnostics" class="cbi-map">
+       <fieldset id="diag_select" class="cbi-section">
+               <legend><%:MWAN Interface Diagnostics%></legend>
+               <select id="mwaniface">
+                       <% for z in interfaceNames:gmatch("[^ ]+") do -%><option value="<%=z%>"><%=z%></option><%- end %>
+               </select>
+               <div id="buttoncss">
+                       <input type="button" value="<%:Ping default gateway%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'gateway', null)" />
+                       <input type="button" value="<%:Ping tracking IP%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'track_ip', null)" />
+                       <input type="button" value="<%:Check IP rules%>" class="cbi-button cbi-button-apply" onclick="update_status('rulechk', null, null)" />
+                       <input type="button" value="<%:Check routing table%>" class="cbi-button cbi-button-apply" onclick="update_status('routechk', null, null)" />
+                       <input type="button" value="<%:Hotplug ifup%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifup', null)" />
+                       <input type="button" value="<%:Hotplug ifdown%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifdown', null)" />
+               </div>
+       </fieldset>
+       <fieldset id="diag_select" class="cbi-section">
+               <legend><%:MWAN Service Control%></legend>
+               <div id="buttoncss">
+                       <input type="button" value="<%:Restart MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'restart', '<%:restart%>')" />
+                       <input type="button" value="<%:Stop MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'stop', '<%:stop%>')" />
+                       <input type="button" value="<%:Start MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'start', '<%:start%>')" />
+               </div>
+       </fieldset>
+       <fieldset class="cbi-section" style="display:none">
+               <legend><%:Diagnostic Results%></legend>
+               <div id="diag_output"></div>
+       </fieldset>
+</div>
+
+<style type="text/css">
+  #mwaniface {
+       float: left;
+       margin: 8px 20px 0px 0px;
+  }
+  #buttoncss {
+       display: table;
+       float: left;
+       text-align: left;
+  }
+  .cbi-button {
+       margin: 8px 20px 0px 0px;
+       min-width: 153px;
+  }
+  #diag_output_css {
+       padding: 20px;
+       text-align: left;
+  }
+</style>
+
+<%+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
new file mode 100644 (file)
index 0000000..c7039f7
--- /dev/null
@@ -0,0 +1,110 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
+               function(x, mArray)
+               {
+                       var statusDiv = document.getElementById('mwan_status_text');
+                       if (mArray.wans)
+                       {
+                               var interfaceStatus = '';
+                               for ( var i = 0; i < mArray.wans.length; i++ )
+                               {
+                                       var status = '';
+                                       var css = '';
+                                       switch (mArray.wans[i].status)
+                                       {
+                                               case 'online':
+                                                       status = '<%:Online (tracking active)%>';
+                                                       css = 'wanon';
+                                                       break;
+                                               case 'notMonitored':
+                                                       status = '<%:Online (tracking off)%>';
+                                                       css = 'wanon';
+                                                       break;
+                                               case 'offline':
+                                                       status = '<%:Offline%>';
+                                                       css = 'wanoff';
+                                                       break;
+                                               case 'notEnabled':
+                                                       status = '<%:Disabled%>';
+                                                       css = 'wanoff';
+                                                       break;
+                                       }
+                                       interfaceStatus += String.format(
+                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
+                                               css, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, status
+                                       );
+                               }
+                               statusDiv.innerHTML = interfaceStatus;
+                       }
+                       else
+                       {
+                               statusDiv.innerHTML = '<strong><%:No MWAN interfaces found%></strong>';
+                       }
+
+                       var logs = document.getElementById('mwan_statuslog_text');
+                       if (mArray.mwanlog)
+                       {
+                               var mwanLog = '<%:Last 50 MWAN systemlog entries. Newest entries sorted at the top :%>';
+                               logs.innerHTML = String.format('<pre>%s<br /><br />%s</pre>', mwanLog, mArray.mwanlog[0]);
+                       }
+                       else
+                       {
+                               logs.innerHTML = '<strong><%:No MWAN systemlog history found%></strong>';
+                       }
+               }
+       );
+//]]></script>
+
+<div id="mwan_interface_status">
+       <fieldset id="interface_field" class="cbi-section">
+               <legend><%:MWAN Interface Live Status%></legend>
+               <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+       </fieldset>
+       <fieldset class="cbi-section">
+               <legend><%:MWAN Interface Systemlog%></legend>
+               <div id="mwan_statuslog_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+       </fieldset>
+</div>
+
+<style type="text/css">
+  #mwan_status_text {
+       display: table;
+       font-size: 14px;
+       margin: auto;
+       max-width: 1044px;
+       min-width: 246px;
+       width: 100%;
+  }
+  .wanon {
+       background-color: rgb(144, 240, 144);
+  }
+  .wanoff {
+       background-color: rgb(240, 144, 144);
+  }
+  .wanon, .wanoff {
+       border-radius: 60px;
+       box-shadow: 0px 2px 5px -3px;
+       float: left;
+       margin: 8px 3px 0px 3px;
+       min-height: 30px;
+       min-width: 235px;
+       padding: 5px 10px 8px 10px;
+       text-align: center;
+  }
+  #mwan_statuslog_text {
+       padding: 20px;
+       text-align: left;
+  }
+</style>
+
+<%+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
new file mode 100644 (file)
index 0000000..483e289
--- /dev/null
@@ -0,0 +1,61 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/overview")%>"><%:Interface Status%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/status/mwan/detail")%>"><%:Detailed Status%></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" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "troubleshooting_display")%>', null,
+               function(x, mArray)
+               {
+                       var tshoot = document.getElementById('troubleshoot_text');
+                       if (mArray.versions)
+                       {
+                               var versions = '<span class="description">Software versions : </span><br /><br />';
+                               var mwanConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/mwan3&#34; : </span><br /><br />';
+                               var netConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/network&#34; : </span><br /><br />';
+                               var wifiConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/wireless&#34; : </span><br /><br />';
+                               var ifconfig = '<br /><br /><span class="description">Output of &#34;ifconfig&#34; : </span><br /><br />';
+                               var ipRoute = '<br /><br /><span class="description">Output of &#34;route -n&#34; : </span><br /><br />';
+                               var ipRuleShow = '<br /><br /><span class="description">Output of &#34;ip rule show&#34; : </span><br /><br />';
+                               var routeListTable = '<br /><br /><span class="description">Output of &#34;ip route list table 1-250&#34; : </span><br /><br />';
+                               var firewallOut = '<br /><br /><span class="description">Firewall default output policy (must be ACCEPT) : </span><br /><br />';
+                               var iptables = '<br /><br /><span class="description">Output of &#34;iptables -L -t mangle -v -n&#34; : </span><br /><br />';
+                               tshoot.innerHTML = String.format(
+                                       '<pre>%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s</pre>',
+                                       versions, mArray.versions[0], mwanConfig, mArray.mwanconfig[0], netConfig, mArray.netconfig[0],
+                                       wifiConfig, mArray.wificonfig[0], ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0],
+                                       ipRuleShow, mArray.iprule[0], routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0],
+                                       iptables, mArray.iptables[0]
+                               );
+                       }
+                       else
+                       {
+                               tshoot.innerHTML = '<strong><%:Error collecting troubleshooting information%></strong>';
+                       }
+               }
+       );
+//]]></script>
+
+<div id="troubleshoot">
+       <fieldset class="cbi-section">
+               <legend><%:Troubleshooting Data%></legend>
+               <div id="troubleshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
+       </fieldset>
+</div>
+
+<style type="text/css">
+  #troubleshoot_text {
+       padding: 20px;
+       text-align: left;
+  }
+  .description {
+       background-color: rgb(78, 186, 241);
+  }
+</style>
+
+<%+footer%>