<%+cbi/valueheader%>
<%-
- local utl = require "luci.util"
local net = require "luci.model.network"
local iface
if type(value) == "table" then value = table.concat(value, " ") end
for value in value:gmatch("%S+") do
checked[value] = true
- end
+ end
else
local n = self.network and net:get_network(self.network)
if n then
-%>
<ul style="margin:0; list-style-type:none">
- <% for _, iface in utl.spairs(ifaces, function(a,b) return (ifaces[a]:type() < ifaces[b]:type()) end) do
+ <% for _, iface in ipairs(ifaces) do
+ local link = iface:adminlink()
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")%> />
<label<%=attr("for", cbid .. "." .. iface:name())%>>
+ <% if link then -%><a href="<%=link%>"><% end -%>
<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:get_i18n()%><% local n = iface:get_network(); if n then %> (<%=n:name()%>)<% end %>
+ <% if link then -%></a><% end -%>
+ <%=iface:get_i18n()%><% local n = iface:get_network(); if n then %> (<a href="<%=n:adminlink()%>"><%=n:name()%></a>)<% end %>
</label>
</li>
<% end end %>
<%+cbi/valueheader%>
<%-
- local utl = require "luci.util"
local nwm = require "luci.model.network"
local net, iface
-%>
<ul style="margin:0; list-style-type:none; text-align:left">
- <% for _, net in utl.spairs(networks, function(a,b) return (networks[a]:name() < networks[b]:name()) end) do
+ <% for _, net in ipairs(networks) do
if net:name() ~= "loopback" then %>
<li style="padding:0.25em 0">
<input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. net:name()) .. attr("name", cbid) .. attr("value", net:name()) .. ifattr(value == net:name(), "checked", "checked")%> />