a64c7bffdf14d1e970cc582625dabc7f84271e03
[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
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id: mid.htm 5448 2009-10-31 15:54:11Z jow $
13
14 -%>
15 <%
16 require("luci.model.uci")
17 local uci = luci.model.uci.cursor_state()
18
19 uci:foreach("olsrd", "olsrd", function(s)
20         if s.SmartGateway and s.SmartGateway == "yes" then has_smartgw  = true end
21 end)
22 %>
23
24 <%+header%>
25
26 <h2><a id="content" name="content"><%:SmartGW announcements%></a></h2>
27 <% if has_smartgw then %>
28 <p><%:Overview of smart gateways in this network%></p>
29 <br />
30 <table class="smalltext" cellspacing="0" cellpadding="6">
31 <tr>
32 <th><%:Gateway%></th>
33 <th><%:Status%></th>
34 <th><%:ETX%></th>
35 <th><%:Hops%></th>
36 <th><%:Uplink%></th>
37 <th><%:Downlink%></th>
38 <th><%:IPv4%></th>
39 <th><%:IPv6%></th>
40 <th><%:Prefix%></th>
41
42 </tr>
43 <% for k, gw in ipairs(gws) do %>
44 <tr>
45 <td><a href="http://<%=gw["Gateway IP"]%>/cgi-bin-status.html"><%=gw["Gateway IP"]%></a></td>
46 <td><%=gw.Status%></td>
47 <td><%=gw.ETX%></td>
48 <td><%=gw.Hopcnt%></td>
49 <td><%=gw.Uplink%></td>
50 <td><%=gw.Downlnk%></td>
51 <td><%=gw.IPv4%></td>
52 <td><%=gw.IPv6%></td>
53 <td><%=gw.Prefix%></td>
54 </tr>
55 <% end %>
56 </table>
57 <br />
58
59 <% else %>
60 SmartGateway is not configured on this system.
61 <% end %>
62 <%+footer%>