diff options
Diffstat (limited to 'modules/luci-base/luasrc')
-rw-r--r-- | modules/luci-base/luasrc/model/uci.lua | 38 | ||||
-rw-r--r-- | modules/luci-base/luasrc/sys.lua | 18 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/apply_widget.htm | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/value.htm | 2 |
4 files changed, 26 insertions, 34 deletions
diff --git a/modules/luci-base/luasrc/model/uci.lua b/modules/luci-base/luasrc/model/uci.lua index b2c1e463bf..2119a210bb 100644 --- a/modules/luci-base/luasrc/model/uci.lua +++ b/modules/luci-base/luasrc/model/uci.lua @@ -95,41 +95,15 @@ end function changes(self, config) - local rv = call("changes", { config = config }) - local res = {} + local rv, err = call("changes", { config = config }) if type(rv) == "table" and type(rv.changes) == "table" then - local package, changes - for package, changes in pairs(rv.changes) do - res[package] = {} - - local _, change - for _, change in ipairs(changes) do - local operation, section, option, value = unpack(change) - if option and operation ~= "add" then - res[package][section] = res[package][section] or { } - - if operation == "list-add" then - local v = res[package][section][option] - if type(v) == "table" then - v[#v+1] = value or "" - elseif v ~= nil then - res[package][section][option] = { v, value } - else - res[package][section][option] = { value } - end - else - res[package][section][option] = value or "" - end - else - res[package][section] = res[package][section] or {} - res[package][section][".type"] = option or "" - end - end - end + return rv.changes + elseif err then + return nil, ERRSTR[err] + else + return { } end - - return res end diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua index 823e20770c..1436a3a235 100644 --- a/modules/luci-base/luasrc/sys.lua +++ b/modules/luci-base/luasrc/sys.lua @@ -70,6 +70,24 @@ function mounts() return data end +function mtds() + local data = {} + + if fs.access("/proc/mtd") then + for l in io.lines("/proc/mtd") do + local d, s, e, n = l:match('^([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+"([^%s]+)"') + if s and n then + local d = {} + d.size = tonumber(s, 16) + d.name = n + table.insert(data, d) + end + end + end + + return data +end + -- containing the whole environment is returned otherwise this function returns -- the corresponding string value for the given name or nil if no such variable -- exists. diff --git a/modules/luci-base/luasrc/view/cbi/apply_widget.htm b/modules/luci-base/luasrc/view/cbi/apply_widget.htm index 4d7e9c56ea..ce279edd40 100644 --- a/modules/luci-base/luasrc/view/cbi/apply_widget.htm +++ b/modules/luci-base/luasrc/view/cbi/apply_widget.htm @@ -158,7 +158,7 @@ uci_status_message('notice', '<img src="<%=resource%>/icons/loading.gif" alt="" style="vertical-align:middle" /> ' + - '<%:Waiting for configuration to get applied… %ds%>'.format(Math.max(Math.floor((deadline - Date.now()) / 1000), 0))); + '<%:Waiting for configuration to be applied… %ds%>'.format(Math.max(Math.floor((deadline - Date.now()) / 1000), 0))); if (now >= deadline) return; diff --git a/modules/luci-base/luasrc/view/cbi/value.htm b/modules/luci-base/luasrc/view/cbi/value.htm index 942ab72e77..8eec865348 100644 --- a/modules/luci-base/luasrc/view/cbi/value.htm +++ b/modules/luci-base/luasrc/view/cbi/value.htm @@ -1,6 +1,6 @@ <%+cbi/valueheader%> <%- if self.password then -%> - <input type="password" style="position:absolute; left:-1000px"<%= + <input type="password" style="position:absolute; left:-1000px" aria-hidden="true" tabindex="-1"<%= attr("name", "password." .. cbid) %> /> <%- end -%> |