Merge remote-tracking branch 'remotes/bmx6-owrt/master' into openwrt-bmx6
[feed/routing.git] / bmx6-luci / files / usr / lib / lua / luci / view / bmx6 / gateways_j.htm
1 <%+header%>
2 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
3
4 <script type="text/javascript">//<![CDATA[
5
6 var displayExtraInfo = function ( id ) {
7
8 document.getElementById('extra-info').innerHTML = document.getElementById(id).innerHTML;
9 }
10 XHR.poll(5, '/cgi-bin/bmx6-info', { 'descriptions/all': '' },
11 function(x, st)
12 {
13 var tb = document.getElementById('descriptions_table');
14 var rowcount = 0;
15 var tunicon = "<%=resource%>/icons/tunnel.png";
16 /* clear all rows */
17 while( tb.rows.length > 1 ) tb.deleteRow(1);
18
19 for ( var k in st )
20 {
21 var description = st[k].DESC_ADV;
22 var tun4in6;
23
24 for ( var k in description.extensions )
25 {
26 var value = description.extensions[k];
27
28 if ( value.TUN4IN6_NET_EXTENSION )
29 {
30 tun4in6 = value.TUN4IN6_NET_EXTENSION;
31 break;
32 }
33 }
34
35 if ( tun4in6 )
36 {
37 var nodename = description.globalId.replace(/\..+$/,'');
38
39 for( var i = 0; i < tun4in6.length; i++ )
40 {
41 var tr = tb.insertRow(-1);
42 var network = tun4in6[i].network;
43 var network_len = tun4in6[i].networklen;
44 var network_bw = tun4in6[i].bandwidth;
45
46 if ( network_len >= 32 ) continue;
47
48 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((rowcount++ % 2) + 1);
49 tr.insertCell(-1).innerHTML = String.format('<a href="/cgi-bin/bmx6control?function=gwselect&amp;node=%s"><img src="%s" /></a>',nodename,tunicon);
50 tr.insertCell(-1).innerHTML = nodename;
51 tr.insertCell(-1).innerHTML = network + '/' + network_len;
52 tr.insertCell(-1).innerHTML = network_bw;
53
54
55 }
56
57 if( tb.rows.length == 1 )
58 {
59 var tr = tb.insertRow(-1);
60 tr.className = 'cbi-section-table-row';
61
62 var td = tr.insertCell(-1);
63 td.colSpan = 4;
64 td.innerHTML = '<em><br /><%:There are no gateways announced in the network.%></em>';
65 }
66 }
67 }
68 }
69 );
70 //]]></script>
71
72 <style>
73
74 div.hideme{
75 display: none;
76 }
77
78 div.info{
79 background: #FFF;
80 border: solid 1px;
81 height: 80px;
82 display: block;
83 overflow: auto;
84 }
85
86 div.inforow{
87 text-align:left;
88 display:inline-block;
89 width:20%;
90 margin:5px;
91 vertical-align:top;
92
93 }
94
95 #extra-info ul { list-style: none outside none; margin-left: 0em; }
96
97 </style>
98 <div class="cbi-map">
99
100 <h2>Originators</h2>
101 <div class="cbi-map-descr"></div>
102 <fieldset class="cbi-section">
103 <legend><%:Mesh gateways%></legend>
104 <table class="cbi-section-table" id="descriptions_table">
105 <tr class="cbi-section-table-titles">
106 <th class="cbi-section-table-cell"></th>
107 <th class="cbi-section-table-cell"><%:Node%></th>
108 <th class="cbi-section-table-cell"><%:Network%></th>
109 <th class="cbi-section-table-cell"><%:Bandwidth%></th>
110 </tr>
111 <tr class="cbi-section-table-row">
112 <td colspan="4"><em><br /><%:Collecting data...%></em></td>
113 </tr>
114 </table>
115 </fieldset>
116
117 </div>
118
119 <%+footer%>
120