diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-01-18 14:45:18 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2018-01-18 15:10:16 +0100 |
commit | 6a700eded1136d79ec8001415a88d324bebcc8f0 (patch) | |
tree | 1a4567368b0e2d49d371a91b2d433fc3c486f860 /applications/luci-app-mwan3/luasrc/view | |
parent | 24fe9b12792e687993b818687c17f0a4eaa1764a (diff) |
luci-app-mwan3: refactoring troubleshooting page
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3/luasrc/view')
-rw-r--r-- | applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm b/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm index 2ede35cef1..348bf947fb 100644 --- a/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm +++ b/applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm @@ -10,52 +10,24 @@ <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) + function(x) { - 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 "cat /etc/config/mwan3" : </span><br /><br />'; - var netConfig = '<br /><br /><span class="description">Output of "cat /etc/config/network" : </span><br /><br />'; - var wifiConfig = '<br /><br /><span class="description">Output of "cat /etc/config/wireless" : </span><br /><br />'; - var ifconfig = '<br /><br /><span class="description">Output of "ifconfig" : </span><br /><br />'; - var ipRoute = '<br /><br /><span class="description">Output of "route -n" : </span><br /><br />'; - var ipRuleShow = '<br /><br /><span class="description">Output of "ip rule show" : </span><br /><br />'; - var routeListTable = '<br /><br /><span class="description">Output of "ip route list table 1-250" : </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 "iptables -L -t mangle -v -n" : </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>'; - } + var legend = document.getElementById('diag-rc-legend'); + var output = document.getElementById('diag-rc-output'); + legend.style.display = 'none'; + output.innerHTML = String.format('<pre>%h</pre>', x.responseText); } ); //]]></script> -<div id="troubleshoot"> +<div class="cbi-map"> + <h2 name="content"><%:MWAN Status - Troubleshooting%></h2> <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> + <legend id="diag-rc-legend"><%:Collecting data...%></legend> + <span id="diag-rc-output"> + <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align: middle;" /> + </span> </fieldset> </div> -<style type="text/css"> - #troubleshoot_text { - padding: 20px; - text-align: left; - } - .description { - background-color: rgb(78, 186, 241); - } -</style> - <%+footer%> |