luci-mod-admin-full: remove useless "bit" requires
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_status / routes.htm
1 <%#
2 LuCI - Lua Configuration Interface
3 Copyright 2008-2009 Steven Barth <steven@midlink.org>
4 Copyright 2008-2009 Jo-Philipp Wich <xm@subsignal.org>
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$
13
14 -%>
15
16 <%-
17         require "luci.sys"
18         require "luci.tools.webadmin"
19         require "nixio.fs"
20
21         local style = true
22 -%>
23
24 <%+header%>
25
26 <div class="cbi-map" id="cbi-network">
27         <h2><a id="content" name="content"><%:Routes%></a></h2>
28         <div class="cbi-map-descr"><%:The following rules are currently active on this system.%></div>
29
30         <fieldset class="cbi-section" id="cbi-table-table">
31                 <legend>ARP</legend>
32                 <div class="cbi-section-node">
33                         <table class="cbi-section-table">
34                                 <tr class="cbi-section-table-titles">
35                                         <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Address%></th>
36                                         <th class="cbi-section-table-cell"><%_<abbr title="Media Access Control">MAC</abbr>-Address%></th>
37                                         <th class="cbi-section-table-cell"><%:Interface%></th>
38                                 </tr>
39
40                                 <% luci.sys.net.arptable(function(e) %>
41                                 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
42                                         <td class="cbi-value-field"><%=e["IP address"]%></td>
43                                         <td class="cbi-value-field"><%=e["HW address"]%></td>
44                                         <td class="cbi-value-field"><%=e["Device"]%></td>
45                                 </tr>
46                                 <% style = not style; end) %>
47                         </table>
48                 </div>
49         </fieldset>
50         <br />
51
52         <fieldset class="cbi-section" id="cbi-table-table">
53                 <legend><%_Active <abbr title="Internet Protocol Version 4">IPv4</abbr>-Routes%></legend>
54
55                 <div class="cbi-section-node">
56                         <table class="cbi-section-table">
57                                 <tr class="cbi-section-table-titles">
58                                         <th class="cbi-section-table-cell"><%:Network%></th>
59                                         <th class="cbi-section-table-cell"><%:Target%></th>
60                                         <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Gateway%></th>
61                                         <th class="cbi-section-table-cell"><%:Metric%></th>
62                                 </tr>
63                                 <% luci.sys.net.routes(function(rt) %>
64                                 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
65                                         <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%></td>
66                                         <td class="cbi-value-field"><%=rt.dest:string()%></td>
67                                         <td class="cbi-value-field"><%=rt.gateway:string()%></td>
68                                         <td class="cbi-value-field"><%=rt.metric%></td>
69                                 </tr>
70                                 <% style = not style; end) %>
71                         </table>
72                 </div>
73         </fieldset>
74         <br />
75
76         <% if nixio.fs.access("/proc/net/ipv6_route") then
77                 style = true
78                 fe80 = luci.ip.IPv6("fe80::/10")
79         %>
80         <fieldset class="cbi-section" id="cbi-table-table">
81                 <legend><%_Active <abbr title="Internet Protocol Version 6">IPv6</abbr>-Routes%></legend>
82
83                 <div class="cbi-section-node">
84                         <table class="cbi-section-table">
85                                 <tr class="cbi-section-table-titles">
86                                         <th class="cbi-section-table-cell"><%:Network%></th>
87                                         <th class="cbi-section-table-cell"><%:Target%></th>
88                                         <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 6">IPv6</abbr>-Gateway%></th>
89                                         <th class="cbi-section-table-cell"><%:Metric%></th>
90                                 </tr>
91                                 <% luci.sys.net.routes6(function(rt) if fe80:contains(rt.dest) then return end %>
92                                 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
93                                         <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or '(' .. rt.device .. ')'%></td>
94                                         <td class="cbi-value-field"><%=rt.dest:string()%></td>
95                                         <td class="cbi-value-field"><%=rt.source:string()%></td>
96                                         <td class="cbi-value-field"><%=rt.metric_raw:upper()%></td>
97                                 </tr>
98                                 <% style = not style; end) %>
99                         </table>
100                 </div>
101         </fieldset>
102         <br />
103         <% end %>
104 </div>
105
106 <%+footer%>