Revert "Adapt tunnels web view to new bmx6 syntax and options"
[lede-routing/.git] / luci-app-bmx6 / files / usr / lib / lua / luci / view / bmx6 / tunnels_j.htm
1 <%#
2    Copyright (C) 2011 Pau Escrich <pau@dabax.net>
3    Contributors Lluis Esquerda <eskerda@gmail.com>
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License along
16    with this program; if not, write to the Free Software Foundation, Inc.,
17    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19    The full GNU General Public License is included in this distribution in
20    the file called "COPYING".
21 -%>
22
23
24 <%+header%>
25 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
26 <script type="text/javascript" src="<%=resource%>/bmx6/js/polling.js"></script>
27
28
29 <style>
30
31         div.hideme{
32                 display: none;
33         }
34
35         div.info{
36                 background: #FFF;
37                 border: solid 1px;
38                 height: 80px;
39                 display: block;
40                 overflow: auto;
41         }
42
43         div.inforow{
44                 text-align:left;
45                 display:inline-block;
46                 width:20%;
47                 margin:5px;
48                 vertical-align:top;
49
50         }
51
52 #extra-info ul { list-style: none outside none; margin-left: 0em; }
53
54 </style>
55 <div class="cbi-map">
56
57 <h2>Gateways tunnel announcements</h2>
58 <div class="cbi-map-descr"></div>
59 <fieldset class="cbi-section">
60         <legend><%:Mesh gateways%></legend>
61         <table class="cbi-section-table" id="descriptions_table">
62                 <tr class="cbi-section-table-titles">
63                         <th class="cbi-section-table-cell"></th>
64                         <th class="cbi-section-table-cell"><%:Tunnel%></th>
65                         <th class="cbi-section-table-cell"><%:Node%></th>
66                         <th class="cbi-section-table-cell"><%:Network%></th>
67                         <th class="cbi-section-table-cell"><%:Bandwidth%></th>
68                         <th class="cbi-section-table-cell"><%:SearchNet%></th>
69                         <th class="cbi-section-table-cell"><%:Type%></th>
70                         <th class="cbi-section-table-cell"><%:Path Metric%></th>
71                         <th class="cbi-section-table-cell"><%:IP metric%></th>
72                         <th class="cbi-section-table-cell"><%:Tun metric%></th>
73                         <th class="cbi-section-table-cell"><%:Bonus%></th>
74                         <th class="cbi-section-table-cell"><%:search id%></th>
75                 </tr>
76                 <tr class="cbi-section-table-row">
77                         <td colspan="10"><em><br /><%:Collecting data...%></em></td>
78                 </tr>
79         </table>
80 </fieldset>
81
82 </div>
83
84 <script type="text/javascript">//<![CDATA[
85                 new TablePooler(5,"/cgi-bin/bmx6-info", {'$tunnels':''}, "descriptions_table", function(st){
86                   var tunicon = "<%=resource%>/icons/tunnel.png";
87                   var tunicon_dis = "<%=resource%>/icons/tunnel_disabled.png";
88                   var applyicon = "<%=resource%>/cbi/apply.gif";
89                   var res = Array();
90                   for ( var k in st.tunnels ){
91                         var tunnel = st.tunnels[k];
92                         var nodename = tunnel.remoteId.replace(/\..+$/,'');
93                         var advnet = tunnel.advNet;
94                         var status = '<img src="'+tunicon_dis+'"/>';
95                         
96                         if ( tunnel.tunName != "---" ) status = '<img src="'+tunicon+'"/>';
97                         if ( advnet == "0.0.0.0/0" ) advnet = "<b>Internet</b>";
98
99                         res.push([status, tunnel.name, nodename, advnet, tunnel.advBw, tunnel.searchNet, tunnel.advType,
100                                 tunnel.pathMtc, tunnel.ipMtc, tunnel.tunMtc, tunnel.bonus, tunnel.searchId]);
101                   }
102                   return res;
103                 });
104 //]]></script>
105
106 <%+footer%>
107