diff options
Diffstat (limited to 'modules/luci-base/luasrc/view')
8 files changed, 42 insertions, 23 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/browser.htm b/modules/luci-base/luasrc/view/cbi/browser.htm index 362c40bec1..eb47ffafe6 100644 --- a/modules/luci-base/luasrc/view/cbi/browser.htm +++ b/modules/luci-base/luasrc/view/cbi/browser.htm @@ -1,8 +1,10 @@ -<% local v = self:cfgvalue(section) or self.default -%> <%+cbi/valueheader%> - <input class="cbi-input-text" type="text"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> /> - <script type="text/javascript"> -cbi_init() -cbi_browser_init('<%=cbid%>', '<%=resource%>', '<%=url('admin/filebrowser')%>'<%=self.default_path and ", '"..self.default_path.."'"%>); - </script> + +<input class="cbi-input-text" type="text"<%= + attr("id", cbid) .. + attr("name", cbid) .. + attr("value", self:cfgvalue(section) or self.default) .. + attr("data-browser", self.default_path or "") +%> /> + <%+cbi/valuefooter%> diff --git a/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm b/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm index ea0568f409..cb11d8f61a 100644 --- a/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm +++ b/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm @@ -6,7 +6,7 @@ <div class="td cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %>"<%= attr("data-name", self.option) .. ifattr(ftype and #ftype > 0, "data-type", ftype) .. - ifattr(title and #title > 0, "data-title", title) .. - ifattr(descr and #descr > 0, "data-description", descr) + ifattr(title and #title > 0, "data-title", title, true) .. + ifattr(descr and #descr > 0, "data-description", descr, true) %>> <div id="cbi-<%=self.config.."-"..section.."-"..self.option%>" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>"> diff --git a/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm b/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm index 55a7e31687..f23e51d18d 100644 --- a/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm +++ b/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm @@ -41,7 +41,7 @@ <input type="hidden" name="<%=cbeid%>" value="1" /> -<div class="cbi-dropdown" display-items="5" placeholder="<%:-- please select -- %>"<%= +<div class="cbi-dropdown" display-items="10" placeholder="<%:-- please select -- %>"<%= attr("name", cbid) .. ifattr(self.widget == "checkbox", "multiple", "multiple") .. ifattr(self.widget == "checkbox", "optional", "optional") diff --git a/modules/luci-base/luasrc/view/cbi/network_netlist.htm b/modules/luci-base/luasrc/view/cbi/network_netlist.htm index d3efcc062f..3ee4274a33 100644 --- a/modules/luci-base/luasrc/view/cbi/network_netlist.htm +++ b/modules/luci-base/luasrc/view/cbi/network_netlist.htm @@ -20,7 +20,7 @@ end -%> -<div class="cbi-dropdown" display-items="5" placeholder="<%:-- please select -- %>"<%= +<div class="cbi-dropdown" display-items="10" placeholder="<%:-- please select -- %>"<%= attr("name", cbid) .. ifattr(self.widget == "checkbox", "multiple", "multiple") .. ifattr(self.widget == "checkbox", "optional", "optional") diff --git a/modules/luci-base/luasrc/view/cbi/tblsection.htm b/modules/luci-base/luasrc/view/cbi/tblsection.htm index 408dfa7fe8..11c2206d8c 100644 --- a/modules/luci-base/luasrc/view/cbi/tblsection.htm +++ b/modules/luci-base/luasrc/view/cbi/tblsection.htm @@ -127,7 +127,7 @@ end section = k local sectionname = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k) - local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname) + local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname, true) local colorclass = (self.extedit or self.rowcolors) and rowstyle() or "" local scope = { valueheader = "cbi/cell_valueheader", diff --git a/modules/luci-base/luasrc/view/cbi/tsection.htm b/modules/luci-base/luasrc/view/cbi/tsection.htm index 547a793329..8f3b7f0ffb 100644 --- a/modules/luci-base/luasrc/view/cbi/tsection.htm +++ b/modules/luci-base/luasrc/view/cbi/tsection.htm @@ -2,6 +2,11 @@ <% if self.title and #self.title > 0 then -%> <legend><%=self.title%></legend> <%- end %> + <% if self.error_msg and #self.error_msg > 0 then -%> + <div class="cbi-section-error"> + <%=self.error_msg%> + </div> + <%- end %> <% if self.description and #self.description > 0 then -%> <div class="cbi-section-descr"><%=self.description%></div> <%- end %> diff --git a/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm b/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm index ebb02e489b..eeb1d5c5cb 100644 --- a/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm +++ b/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm @@ -4,6 +4,7 @@ var freqlist = <%= luci.http.write_json(self.iwinfo.freqlist) %>; var hwmodes = <%= luci.http.write_json(self.iwinfo.hwmodelist or {}) %>; var htmodes = <%= luci.http.write_json(self.iwinfo.htmodelist) %>; + var acs = <%= luci.http.write_json(self.hostapd_acs or 0) %>; var channels = { '11g': [ @@ -14,6 +15,10 @@ ] }; + if (acs < 1) { + channels[(freqlist[freqlist.length - 1].mhz > 2484) ? '11a' : '11g'].length = 0; + } + for (var i = 0; i < freqlist.length; i++) channels[(freqlist[i].mhz > 2484) ? '11a' : '11g'].push( freqlist[i].channel, diff --git a/modules/luci-base/luasrc/view/lease_status.htm b/modules/luci-base/luasrc/view/lease_status.htm index bf2a8968d1..bbaf5986ba 100644 --- a/modules/luci-base/luasrc/view/lease_status.htm +++ b/modules/luci-base/luasrc/view/lease_status.htm @@ -79,17 +79,24 @@ </div> </div> -<div class="cbi-section" style="display:none"> - <h3><%:Active DHCPv6 Leases%></h3> - <div class="table" id="lease6_status_table"> - <div class="tr table-titles"> - <div class="th"><%:Host%></div> - <div class="th"><%:IPv6-Address%></div> - <div class="th"><%:DUID%></div> - <div class="th"><%:Leasetime remaining%></div> - </div> - <div class="tr placeholder"> - <div class="td"><em><%:Collecting data...%></em></div> +<% + local fs = require "nixio.fs" + local has_ipv6 = fs.access("/proc/net/ipv6_route") + + if has_ipv6 then +-%> + <div class="cbi-section" style="display:none"> + <h3><%:Active DHCPv6 Leases%></h3> + <div class="table" id="lease6_status_table"> + <div class="tr table-titles"> + <div class="th"><%:Host%></div> + <div class="th"><%:IPv6-Address%></div> + <div class="th"><%:DUID%></div> + <div class="th"><%:Leasetime remaining%></div> + </div> + <div class="tr placeholder"> + <div class="td"><em><%:Collecting data...%></em></div> + </div> </div> </div> -</div> +<% end -%> |