summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/cbi/luasrc/view/cbi/network_ifacelist.htm43
1 files changed, 43 insertions, 0 deletions
diff --git a/libs/cbi/luasrc/view/cbi/network_ifacelist.htm b/libs/cbi/luasrc/view/cbi/network_ifacelist.htm
new file mode 100644
index 0000000000..b3a61fa6ad
--- /dev/null
+++ b/libs/cbi/luasrc/view/cbi/network_ifacelist.htm
@@ -0,0 +1,43 @@
+<%#
+LuCI - Lua Configuration Interface
+Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+-%>
+<%+cbi/valueheader%>
+
+<%-
+ local utl = require "luci.util"
+ local net = require "luci.model.network"
+
+ local iface
+ local ifaces = net:get_interfaces()
+ local value = (self:cfgvalue(section) or self.default or "")
+ local checked = { }
+
+ for value in value:gmatch("%S+") do
+ checked[value] = true
+ end
+-%>
+
+<ul style="margin:0; list-style-type:none">
+ <% for _, iface in utl.spairs(ifaces, function(a,b) return (ifaces[a]:name() < ifaces[b]:name()) end) do
+ if not self.nobridges or not iface:is_bridge() then %>
+ <li>
+ <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. iface:name()) .. attr("name", cbid) .. attr("value", iface:name()) .. ifattr(checked[iface:name()], "checked", "checked")%> /> &nbsp;
+ <label<%=attr("for", cbid .. "." .. iface:name())%>>
+ <img title="<%=iface:get_type_i18n()%>" style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
+ <%=iface:name()%><% local n = iface:get_network(); if n then %> (<%=n:name()%>)<% end %>
+ </label>
+ </li>
+ <% end end %>
+</ul>
+
+<%+cbi/valuefooter%>