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
>
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
11 http://www.apache.org/licenses/LICENSE-
2.0
16 require(
"luci.model.uci")
17 local uci = luci.model.uci.cursor_state()
19 uci:foreach(
"olsrd",
"olsrd", function(s)
20 if s.SmartGateway and s.SmartGateway ==
"yes" then has_smartgw = true end
26 <h2><a id=
"content" name=
"content"><%:SmartGW announcements%
></a></h2>
28 <% if has_smartgw then %
>
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>
46 <% for k, gw in ipairs(gws) do %
>
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>
60 <% if i ==
1 then i =
0 elseif i ==
0 then i =
1 end
67 <%:SmartGateway is not configured on this system.%
>