luci-app-mwan3: fix source styling
[project/luci.git] / applications / luci-app-mwan3 / luasrc / view / mwan / overview_status_interface.htm
1 <%#
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.
5 -%>
6
7 <script type="text/javascript">//<![CDATA[
8 XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
9 function(x, status)
10 {
11 var statusDiv = document.getElementById('mwan_status_text');
12 if (status.interfaces)
13 {
14 var statusview = '';
15 for ( var iface in status.interfaces)
16 {
17 var state = '';
18 var css = '';
19 switch (status.interfaces[iface].status)
20 {
21 case 'online':
22 state = '<%:Online (tracking active)%>';
23 css = 'wanon';
24 break;
25 case 'notMonitored':
26 state = '<%:Online (tracking off)%>';
27 css = 'wanon';
28 break;
29 case 'offline':
30 state = '<%:Offline%>';
31 css = 'wanoff';
32 break;
33 default:
34 state = '<%:Disabled%>';
35 css = 'wanoff';
36 break;
37 }
38 statusview += String.format(
39 '<span class="%s"><strong>%s</strong><br />%s</span>',
40 css,
41 iface,
42 state
43 );
44 }
45 statusDiv.innerHTML = statusview;
46 }
47 else
48 {
49 statusDiv.innerHTML = '<strong><%:No MWAN interfaces found%></strong>';
50 }
51 }
52 );
53 //]]></script>
54
55 <fieldset id="interface_field" class="cbi-section">
56 <legend><%:MWAN Interface Live Status%></legend>
57 <div id="mwan_status_text">
58 <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%>
59 </div>
60 </fieldset>