7fa8730423706cffd80c0305b3081e6c2bf19c6b
[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 2011 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 local i = 1
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
28 <% if has_smartgw then %>
29
30 <fieldset class="cbi-section">
31 <legend><%:Overview of smart gateways in this network%></legend>
32 <table class="cbi-section-table">
33 <tr class="cbi-section-table-titles">
34 <th class="cbi-section-table-cell"><%:Gateway%></th>
35 <th class="cbi-section-table-cell"><%:Status%></th>
36 <th class="cbi-section-table-cell"><%:ETX%></th>
37 <th class="cbi-section-table-cell"><%:Hops%></th>
38 <th class="cbi-section-table-cell"><%:Uplink%></th>
39 <th class="cbi-section-table-cell"><%:Downlink%></th>
40 <th class="cbi-section-table-cell"><%:IPv4%></th>
41 <th class="cbi-section-table-cell"><%:IPv6%></th>
42 <th class="cbi-section-table-cell"><%:Prefix%></th>
43
44 </tr>
45
46 <% for k, gw in ipairs(gws) do %>
47
48 <tr class="cbi-section-table-row cbi-rowstyle-<%=i%>">
49 <td class="cbi-section-table-cell"><a href="http://<%=gw["Gateway IP"]%>/cgi-bin-status.html"><%=gw["Gateway IP"]%></a></td>
50 <td class="cbi-section-table-cell"><%=gw.Status%></td>
51 <td class="cbi-section-table-cell"><%=gw.ETX%></td>
52 <td class="cbi-section-table-cell"><%=gw.Hopcnt%></td>
53 <td class="cbi-section-table-cell"><%=gw.Uplink%></td>
54 <td class="cbi-section-table-cell"><%=gw.Downlnk%></td>
55 <td class="cbi-section-table-cell"><%=gw.IPv4%></td>
56 <td class="cbi-section-table-cell"><%=gw.IPv6%></td>
57 <td class="cbi-section-table-cell"><%=gw.Prefix%></td>
58 </tr>
59
60 <% i = ((i % 2) + 1)
61 end %>
62 </table>
63 </fieldset>
64
65 <% else %>
66
67 <%:SmartGateway is not configured on this system.%>
68
69 <% end %>
70
71 <%+footer%>