diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/cbi/luasrc/view/cbi/button.htm | 6 | ||||
-rw-r--r-- | libs/cbi/luasrc/view/cbi/nullsection.htm | 3 | ||||
-rw-r--r-- | libs/cbi/luasrc/view/cbi/tblsection.htm | 8 | ||||
-rw-r--r-- | libs/sys/luasrc/sys.lua | 7 |
4 files changed, 19 insertions, 5 deletions
diff --git a/libs/cbi/luasrc/view/cbi/button.htm b/libs/cbi/luasrc/view/cbi/button.htm index 2d740f45c..c2a0d437e 100644 --- a/libs/cbi/luasrc/view/cbi/button.htm +++ b/libs/cbi/luasrc/view/cbi/button.htm @@ -13,5 +13,9 @@ $Id$ -%> <%+cbi/valueheader%> - <input<% if self.inputstyle then %> class="cbi-input-<%=self.inputstyle%>"<% end %> type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.title) %> /> + <% if self:cfgvalue(section) ~= false then %> + <input<% if self.inputstyle then %> class="cbi-input-<%=self.inputstyle%>"<% end %> type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.title)%> /> + <% else %> + - + <% end %> <%+cbi/valuefooter%> diff --git a/libs/cbi/luasrc/view/cbi/nullsection.htm b/libs/cbi/luasrc/view/cbi/nullsection.htm index b01a6a9f5..476db96d8 100644 --- a/libs/cbi/luasrc/view/cbi/nullsection.htm +++ b/libs/cbi/luasrc/view/cbi/nullsection.htm @@ -13,6 +13,9 @@ $Id$ -%> <fieldset class="cbi-section"> + <% if self.title and #self.title > 0 then -%> + <legend><%=self.title%></legend> + <%- end %> <div class="cbi-section-node"> <% self:render_children(1, scope or {}) %> </div> diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index d03d6f497..66de5aeb2 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -76,7 +76,13 @@ end <%- if self.extedit or self.addremove then -%> <td class="cbi-section-table-cell"> <%- if self.extedit then -%> - <a href="<%=self.extedit:format(section)%>" title="<%:edit%>"><img style="border: none" src="<%=resource%>/cbi/edit.gif" alt="<%:edit%>" /></a> + <a href=" + <%- if type(self.extedit) == "string" then -%> + <%=self.extedit:format(section)%> + <%- elseif type(self.extedit) == "function" then -%> + <%=self:extedit(section)%> + <%- end -%> + " title="<%:edit%>"><img style="border: none" src="<%=resource%>/cbi/edit.gif" alt="<%:edit%>" /></a> <%- end; if self.addremove then %> <input type="image" value="<%:cbi_del%>" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" /> <%- end -%> diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua index 970dcffaa..d0dc5acbd 100644 --- a/libs/sys/luasrc/sys.lua +++ b/libs/sys/luasrc/sys.lua @@ -432,8 +432,9 @@ end --- Get iwlist scan output from all wireless devices. -- @return Table of tables contaiing all scan results -function wifi.iwscan() - local cnt = luci.util.exec("iwlist scan 2>/dev/null") +function wifi.iwscan(iface) + local siface = iface or "" + local cnt = luci.util.exec("iwlist "..siface.." scan 2>/dev/null") local iws = {} for i, l in pairs(luci.util.split(luci.util.trim(cnt), "\n\n")) do @@ -451,7 +452,7 @@ function wifi.iwscan() end end - return iws + return iface and (iws[iface] or {}) or iws end |