Merge branch 'master' into bmx6_testing
[feed/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"><%:Src%></th>
75 <th class="cbi-section-table-cell"><%:Search id%></th>
76 </tr>
77 <tr class="cbi-section-table-row">
78 <td colspan="10"><em><br /><%:Collecting data...%></em></td>
79 </tr>
80 </table>
81 </fieldset>
82
83 </div>
84
85 <script type="text/javascript">//<![CDATA[
86 new TablePooler(5,"/cgi-bin/bmx6-info", {'$tunnels':''}, "descriptions_table", function(st){
87 var tunicon = "<%=resource%>/icons/tunnel.png";
88 var tunicon_dis = "<%=resource%>/icons/tunnel_disabled.png";
89 var applyicon = "<%=resource%>/cbi/apply.gif";
90 var res = Array();
91 for ( var k in st.tunnels ){
92 var tunnel = st.tunnels[k];
93 var nodename = tunnel.remoteName.replace(/\..+$/,'');
94 var advnet = tunnel.advNet;
95 var status = '<img src="'+tunicon_dis+'"/>';
96
97 if ( tunnel.tunName != "---" ) status = '<img src="'+tunicon+'"/>';
98 if ( advnet == "0.0.0.0/0" ) advnet = "<b>Internet</b>";
99
100 res.push([status, tunnel.name, nodename, advnet, tunnel.advBw, tunnel.net, tunnel.advType,
101 tunnel.pathMtc, tunnel.ipMtc, tunnel.tunMtc, tunnel.bonus, tunnel.srcIngress, tunnel.id]);
102 }
103 return res;
104 });
105 //]]></script>
106
107 <%+footer%>
108