2 Copyright
2014 Aedan Renner
<chipdankly@gmail.com
>
3 Copyright
2018 Florian Eckert
<fe@dev.tdt.de
>
4 Licensed to the public under the GNU General Public License v2.
7 <script type=
"text/javascript">//<![CDATA[
9 function secondsToString(time) {
10 var seconds = parseInt(time,
10);
12 var hrs = Math.floor(seconds /
3600);
14 var mnts = Math.floor(seconds /
60);
16 return String.format(
"%sh:%sm:%ss", hrs, mnts, seconds);
19 XHR.poll(-
1, '<%=luci.dispatcher.build_url(
"admin",
"status",
"mwan",
"interface_status")%
>', null,
22 var statusDiv = document.getElementById('mwan_status_text');
23 if (status.interfaces)
26 for ( var iface in status.interfaces)
31 switch (status.interfaces[iface].status)
34 state = '<%:Online%
>';
36 '
<div><strong>Uptime:
</strong>%s
</div>',
37 secondsToString(status.interfaces[iface].online)
42 state = '<%:Offline%
>';
44 '
<div><strong>Downtime:
</strong>%s
</div>',
45 secondsToString(status.interfaces[iface].offline)
50 state = '<%:No Tracking%
>';
51 if ((status.interfaces[iface].uptime)
> 0) {
53 '
<div><strong>Uptime:
</strong>%s
</div>',
54 secondsToString(status.interfaces[iface].uptime)
59 time = '
<div> </div>'
64 state = '<%:Disabled%
>';
65 time = '
<div> </div>'
69 statusview += String.format(
70 '
<div class=
"alert-message %s">',
73 statusview += String.format(
74 '
<div><strong>Interface:
</strong>%s
</div>',
77 statusview += String.format(
78 '
<div><strong>Status:
</strong>%s
</div>',
85 statusview += '
</div>'
87 statusDiv.innerHTML = statusview;
91 statusDiv.innerHTML = '
<strong><%:No MWAN interfaces found%
></strong>';
97 <style type=
"text/css">
98 #mwan_status_text
> div {
99 display: inline-block;
108 <fieldset id=
"interface_field" class=
"cbi-section">
109 <legend><%:MWAN Interfaces%
></legend>
110 <div id=
"mwan_status_text">
111 <img src=
"<%=resource%>/icons/loading.gif" alt=
"<%:Loading%>" style=
"vertical-align:middle" />
112 <%:Collecting data...%
>