4 local utl = require "luci.util"
5 local nwm = require "luci.model.network".init()
8 local networks = nwm:get_networks()
9 local value = self:formvalue(section)
13 if not value or value == "-" then
14 value = self:cfgvalue(section) or self.default
18 for value in utl.imatch(value) do
23 <div class="cbi-dropdown" display-items="5" placeholder="<%:-- please select -- %>"<%=
25 ifattr(self.widget == "checkbox", "multiple", "multiple") ..
26 ifattr(self.widget == "checkbox", "optional", "optional")
28 <script type="item-template"><!--
29 <li value="{{value}}">
30 <span class="ifacebadge" style="background:repeating-linear-gradient(45deg,rgba(204,204,204,0.5),rgba(204,204,204,0.5) 5px,rgba(255,255,255,0.5) 5px,rgba(255,255,255,0.5) 10px)">
31 {{value}}: <em>(<%:create%>)</em>
36 <% if self.widget ~= "checkbox" then %>
37 <li value=""<%= ifattr(not value, "selected", "selected") %>>
38 <em><%:unspecified%></em>
42 <% for _, net in ipairs(networks) do
43 if (net:name() ~= "loopback") and
44 (net:name() ~= self.exclude) and
45 (not self.novirtual or not net:is_virtual())
47 <li<%= attr("value", net:name()) .. ifattr(checked[net:name()], "selected", "selected") %>>
48 <span class="ifacebadge"><%=net:name()%>:
51 for _, iface in ipairs(net:is_bridge() and net:get_interfaces() or { net:get_interface() }) do
52 if not iface:is_bridge() then
55 <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
58 <em class="hide-close"><%:(no interfaces attached)%></em>
59 <em class="hide-open">-</em>
65 <% if not self.nocreate then %>
66 <li value="-"<%= ifattr(not value and self.widget ~= "checkbox", "selected", "selected") %>>
68 <%- if self.widget == "checkbox" then -%>
71 <%:unspecified -or- create:%>
74 <input style="display:none" type="password" />
75 <input class="create-item-input" type="text" />