Changeset 5389
- Timestamp:
- 10/10/09 15:47:37 (4 years ago)
- Location:
- luci/trunk/libs/cbi/luasrc/view/cbi
- Files:
-
- 4 modified
-
firewall_zonelist.htm (modified) (4 diffs)
-
fvalue.htm (modified) (1 diff)
-
network_ifacelist.htm (modified) (1 diff)
-
value.htm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/cbi/luasrc/view/cbi/firewall_zonelist.htm
r5376 r5389 16 16 <%- 17 17 local utl = require "luci.util" 18 local wba = require "luci.tools.webadmin"19 local wbi = require "luci.tools.webadmin_interfaces"20 18 local fwm = require "luci.model.firewall" 19 local nwm = require "luci.model.network" 21 20 22 wbi.init(self.map.uci) 23 24 local zone, iface, ifname 21 local zone, net, iface 25 22 local zones = fwm:get_zones() 26 23 local value = self:cfgvalue(section) or self.default 24 local selected = false 27 25 28 26 if value and #value == 0 then value = nil end … … 30 28 31 29 <ul style="margin:0; list-style-type:none"> 32 <% for _, zone in utl.spairs(zones, function(a,b) return (zones[a]:name() < zones[b]:name()) end) do %> 30 <% 31 for _, zone in utl.spairs(zones, function(a,b) return (zones[a]:name() < zones[b]:name()) end) do 32 selected = selected or (value == zone:name()) 33 %> 33 34 <li style="padding:0.5em"> 34 35 <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "." .. zone:name()) .. attr("name", cbid) .. attr("value", zone:name()) .. ifattr(value == zone:name(), "checked", "checked")%> /> … … 37 38 <% 38 39 local empty = true 39 for _, iface in ipairs(zone:get_networks()) do 40 local ifname = wbi.network_get_ifname(iface) 41 local dev = wbi.iface_get_list()[ifname] 40 for _, net in ipairs(zone:get_networks()) do 41 net = nwm:get_network(net) 42 for _, iface in ipairs(net and net:get_interfaces() or {}) do 43 if not iface:is_bridgeport() then 44 empty = false 42 45 %> 43 <% if ifname and dev then empty = false %> 44 <img title="<%=wbi.iface_format_type(dev.type)%>" style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=dev.type or "ethernet"%><%=dev.flags and dev.flags.up and "" or "_disabled"%>.png" /> 45 <% if iface == self.iface then %><strong><%=ifname%></strong><% else %><%=ifname%><% end %> 46 <% end %> 47 <% end %> 46 <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" /> 47 <% if iface:name() == self.iface then %><strong><%=iface:name()%></strong><% else %><%=iface:name()%><% end %> 48 <% end end end %> 48 49 <% if empty then %><em><%:a_s_ipt_zone_empty (no interfaces attached)%></em><% end %> 49 50 </label> … … 51 52 <% end %> 52 53 54 <% if not self.nocreate then %> 53 55 <li style="padding:0.5em"> 54 <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value, "checked", "checked")%> /> 56 <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not selected, "checked", "checked")%> /> 55 57 <div style="background-color:<%=fwm.zone.get_color()%>; padding:0.5em; display:inline"> 56 58 <label<%=attr("for", cbid .. "_new")%>><em><%:a_s_ipt_zone_unspec_create unspecified -or- create:%> </em></label> 57 <input style="width:6em" type="text"<%=attr("name", cbid .. ".newzone") %> onfocus="document.getElementById('<%=cbid%>_new').checked=true" />59 <input style="width:6em" type="text"<%=attr("name", cbid .. ".newzone") .. ifattr(not selected, "value", self.default)%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" /> 58 60 </div> 59 61 </li> 62 <% end %> 60 63 </ul> 61 64 -
luci/trunk/libs/cbi/luasrc/view/cbi/fvalue.htm
r3530 r5389 14 14 -%> 15 15 <%+cbi/valueheader%> 16 <input class="cbi-input-checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="checkbox"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr( self:cfgvalue(section) == self.enabled, "checked", "checked") %> value="1" />16 <input class="cbi-input-checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="checkbox"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr((self:cfgvalue(section) or self.default) == self.enabled, "checked", "checked") %> value="1" /> 17 17 <%+cbi/valuefooter%> -
luci/trunk/libs/cbi/luasrc/view/cbi/network_ifacelist.htm
r5380 r5389 23 23 local checked = { } 24 24 25 if type(value) == "table" then value = table.concat(value, " ") end 25 26 for value in value:gmatch("%S+") do 26 27 checked[value] = true -
luci/trunk/libs/cbi/luasrc/view/cbi/value.htm
r3530 r5389 14 14 -%> 15 15 <%+cbi/valueheader%> 16 <input type="<%=self.password and 'password" class="cbi-input-password' or 'text" class="cbi-input-text' %>" onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) ) .. ifattr(self.size, "size")%> />16 <input type="<%=self.password and 'password" class="cbi-input-password' or 'text" class="cbi-input-text' %>" onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) .. ifattr(self.size, "size")%> /> 17 17 <% if #self.keylist > 0 then -%> 18 18 <script type="text/javascript">
