10d516cd35fe3c3c1afa1ee6ad9b568ebcafa16e
[project/luci.git] / applications / luci-olsr / luasrc / view / status-olsr / smartgw.htm
1 <%#
2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
5 Copyright 2010 Manuel Munz <freifunk at somakoma dot de>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12 -%>
13
14 <%
15 require("luci.model.uci")
16 local uci = luci.model.uci.cursor_state()
17
18 uci:foreach("olsrd", "olsrd", function(s)
19         if s.SmartGateway and s.SmartGateway == "yes" then has_smartgw  = true end
20 end)
21 %>
22
23 <%+header%>
24
25 <h2><a id="content" name="content"><%:SmartGW announcements%></a></h2>
26 <% if has_smartgw then %>
27 <p><%:Overview of smart gateways in this network%></p>
28 <br />
29 <table class="smalltext" cellspacing="0" cellpadding="6">
30 <tr>
31 <th><%:Gateway%></th>
32 <th><%:Status%></th>
33 <th><%:ETX%></th>
34 <th><%:Hops%></th>
35 <th><%:Uplink%></th>
36 <th><%:Downlink%></th>
37 <th><%:IPv4%></th>
38 <th><%:IPv6%></th>
39 <th><%:Prefix%></th>
40
41 </tr>
42 <% for k, gw in ipairs(gws) do %>
43 <tr>
44 <td><a href="http://<%=gw["Gateway IP"]%>/cgi-bin-status.html"><%=gw["Gateway IP"]%></a></td>
45 <td><%=gw.Status%></td>
46 <td><%=gw.ETX%></td>
47 <td><%=gw.Hopcnt%></td>
48 <td><%=gw.Uplink%></td>
49 <td><%=gw.Downlnk%></td>
50 <td><%=gw.IPv4%></td>
51 <td><%=gw.IPv6%></td>
52 <td><%=gw.Prefix%></td>
53 </tr>
54 <% end %>
55 </table>
56 <br />
57
58 <% else %>
59 SmartGateway is not configured on this system.
60 <% end %>
61 <%+footer%>