diff options
Diffstat (limited to 'modules/luci-base/luasrc')
-rw-r--r-- | modules/luci-base/luasrc/cacheloader.lua | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/ccache.lua | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/dispatcher.lua | 12 | ||||
-rw-r--r-- | modules/luci-base/luasrc/model/uci.lua | 4 | ||||
-rw-r--r-- | modules/luci-base/luasrc/sgi/cgi.lua | 4 | ||||
-rw-r--r-- | modules/luci-base/luasrc/store.lua | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/sys.lua | 4 | ||||
-rw-r--r-- | modules/luci-base/luasrc/sys.luadoc | 49 | ||||
-rw-r--r-- | modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua | 13 | ||||
-rw-r--r-- | modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua | 3 | ||||
-rw-r--r-- | modules/luci-base/luasrc/template.lua | 6 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/error404.htm | 1 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/header.htm | 2 |
13 files changed, 27 insertions, 77 deletions
diff --git a/modules/luci-base/luasrc/cacheloader.lua b/modules/luci-base/luasrc/cacheloader.lua index 11e5f6900f..7ef971df8d 100644 --- a/modules/luci-base/luasrc/cacheloader.lua +++ b/modules/luci-base/luasrc/cacheloader.lua @@ -9,4 +9,4 @@ module "luci.cacheloader" if config.ccache and config.ccache.enable == "1" then ccache.cache_ondemand() -end
\ No newline at end of file +end diff --git a/modules/luci-base/luasrc/ccache.lua b/modules/luci-base/luasrc/ccache.lua index bcc76e6a7b..d3be7cba6c 100644 --- a/modules/luci-base/luasrc/ccache.lua +++ b/modules/luci-base/luasrc/ccache.lua @@ -61,7 +61,7 @@ function cache_enable(cachepath, mode) package.loaders[2] = function(mod) local encoded = cachepath .. "/" .. _encode_filename(mod) local modcons = _load_sane(encoded) - + if modcons then return modcons end diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 560140e3d3..2f965b16a8 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -395,7 +395,7 @@ function error404(message) local function render() local template = require "luci.template" - template.render("error404") + template.render("error404", {message=message}) end if not util.copcall(render) then @@ -563,15 +563,13 @@ local function session_setup(user, pass) ubus_rpc_session = login.ubus_rpc_session, values = { token = sys.uniqueid(16) } }) - - io.stderr:write("luci: accepted login on /%s for %s from %s\n" - %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" }) + nixio.syslog("info", tostring("luci: accepted login on /%s for %s from %s\n" + %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" })) return session_retrieve(login.ubus_rpc_session) end - - io.stderr:write("luci: failed login on /%s for %s from %s\n" - %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" }) + nixio.syslog("info", tostring("luci: failed login on /%s for %s from %s\n" + %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" })) end local function check_authentication(method) diff --git a/modules/luci-base/luasrc/model/uci.lua b/modules/luci-base/luasrc/model/uci.lua index a50e28a871..816f6f2053 100644 --- a/modules/luci-base/luasrc/model/uci.lua +++ b/modules/luci-base/luasrc/model/uci.lua @@ -123,10 +123,10 @@ function apply(self, rollback) if rollback then local sys = require "luci.sys" local conf = require "luci.config" - local timeout = tonumber(conf and conf.apply and conf.apply.rollback or 30) or 0 + local timeout = tonumber(conf and conf.apply and conf.apply.rollback or 90) or 0 _, err = call("apply", { - timeout = (timeout > 30) and timeout or 30, + timeout = (timeout > 90) and timeout or 90, rollback = true }) diff --git a/modules/luci-base/luasrc/sgi/cgi.lua b/modules/luci-base/luasrc/sgi/cgi.lua index 68ae17a9eb..400db4710d 100644 --- a/modules/luci-base/luasrc/sgi/cgi.lua +++ b/modules/luci-base/luasrc/sgi/cgi.lua @@ -35,11 +35,11 @@ function run() limitsource(io.stdin, tonumber(luci.sys.getenv("CONTENT_LENGTH"))), ltn12.sink.file(io.stderr) ) - + local x = coroutine.create(luci.dispatcher.httpdispatch) local hcache = "" local active = true - + while coroutine.status(x) ~= "dead" do local res, id, data1, data2 = coroutine.resume(x, r) diff --git a/modules/luci-base/luasrc/store.lua b/modules/luci-base/luasrc/store.lua index 34eb296229..a735981137 100644 --- a/modules/luci-base/luasrc/store.lua +++ b/modules/luci-base/luasrc/store.lua @@ -3,4 +3,4 @@ -- Licensed to the public under the Apache License 2.0. local util = require "luci.util" -module("luci.store", util.threadlocal)
\ No newline at end of file +module("luci.store", util.threadlocal) diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua index c8ad5393e0..aa00766fb8 100644 --- a/modules/luci-base/luasrc/sys.lua +++ b/modules/luci-base/luasrc/sys.lua @@ -379,7 +379,7 @@ function process.list() for line in ps do local pid, ppid, user, stat, vsz, mem, cpu, cmd = line:match( - "^ *(%d+) +(%d+) +(%S.-%S) +([RSDZTW][<NW ][<N ]) +(%d+) +(%d+%%) +(%d+%%) +(.+)" + "^ *(%d+) +(%d+) +(%S.-%S) +([RSDZTW][<NW ][<N ]) +(%d+m?) +(%d+%%) +(%d+%%) +(.+)" ) local idx = tonumber(pid) @@ -509,7 +509,7 @@ user.getuser = nixio.getpw function user.getpasswd(username) local pwe = nixio.getsp and nixio.getsp(username) or nixio.getpw(username) local pwh = pwe and (pwe.pwdp or pwe.passwd) - if not pwh or #pwh < 1 or pwh == "!" or pwh == "x" then + if not pwh or #pwh < 1 then return nil, pwe else return pwh, pwe diff --git a/modules/luci-base/luasrc/sys.luadoc b/modules/luci-base/luasrc/sys.luadoc index 162650e7ac..c1e088eb23 100644 --- a/modules/luci-base/luasrc/sys.luadoc +++ b/modules/luci-base/luasrc/sys.luadoc @@ -111,16 +111,6 @@ LuCI system utilities / network related functions. ]] ---[[ -Returns the current arp-table entries as two-dimensional table. - -@class function -@name net.arptable -@return Table of table containing the current arp entries. --- The following fields are defined for arp entry objects: --- { "IP address", "HW address", "HW type", "Flags", "Mask", "Device" } -]] - ----[[ Returns a two-dimensional table of mac address hints. @class function @@ -177,45 +167,6 @@ Determine the names of available network interfaces. ]] ---[[ -Return information about available network interfaces. - -@class function -@name net.deviceinfo -@return Table containing all current interface names and their information -]] - ----[[ -Returns the current kernel routing table entries. - -@class function -@name net.routes -@return Table of tables with properties of the corresponding routes. --- The following fields are defined for route entry tables: --- { "dest", "gateway", "metric", "refcount", "usecount", "irtt", --- "flags", "device" } -]] - ----[[ -Returns the current ipv6 kernel routing table entries. - -@class function -@name net.routes6 -@return Table of tables with properties of the corresponding routes. --- The following fields are defined for route entry tables: --- { "source", "dest", "nexthop", "metric", "refcount", "usecount", --- "flags", "device" } -]] - ----[[ -Tests whether the given host responds to ping probes. - -@class function -@name net.pingtest -@param host String containing a hostname or IPv4 address -@return Number containing 0 on success and >= 1 on error -]] - ----[[ LuCI system utilities / process related functions. @class module diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua index 95f2ad4cfc..787b910f4c 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua @@ -28,7 +28,7 @@ TZ = { { 'Africa/Gaborone', 'CAT-2' }, { 'Africa/Harare', 'CAT-2' }, { 'Africa/Johannesburg', 'SAST-2' }, - { 'Africa/Juba', 'EAT-3' }, + { 'Africa/Juba', 'CAT-2' }, { 'Africa/Kampala', 'EAT-3' }, { 'Africa/Khartoum', 'CAT-2' }, { 'Africa/Kigali', 'CAT-2' }, @@ -202,10 +202,10 @@ TZ = { { 'America/Winnipeg', 'CST6CDT,M3.2.0,M11.1.0' }, { 'America/Yakutat', 'AKST9AKDT,M3.2.0,M11.1.0' }, { 'America/Yellowknife', 'MST7MDT,M3.2.0,M11.1.0' }, - { 'Antarctica/Casey', '<+08>-8' }, + { 'Antarctica/Casey', '<+11>-11' }, { 'Antarctica/Davis', '<+07>-7' }, { 'Antarctica/DumontDUrville', '<+10>-10' }, - { 'Antarctica/Macquarie', '<+11>-11' }, + { 'Antarctica/Macquarie', 'AEST-10AEDT,M10.1.0,M4.1.0/3' }, { 'Antarctica/Mawson', '<+05>-5' }, { 'Antarctica/McMurdo', 'NZST-12NZDT,M9.5.0,M4.1.0/3' }, { 'Antarctica/Palmer', '<-03>3' }, @@ -239,8 +239,8 @@ TZ = { { 'Asia/Dubai', '<+04>-4' }, { 'Asia/Dushanbe', '<+05>-5' }, { 'Asia/Famagusta', 'EET-2EEST,M3.5.0/3,M10.5.0/4' }, - { 'Asia/Gaza', 'EET-2EEST,M3.5.5/0,M10.5.6/1' }, - { 'Asia/Hebron', 'EET-2EEST,M3.5.5/0,M10.5.6/1' }, + { 'Asia/Gaza', 'EET-2EEST,M3.4.4/48,M10.4.4/49' }, + { 'Asia/Hebron', 'EET-2EEST,M3.4.4/48,M10.4.4/49' }, { 'Asia/Ho Chi Minh', '<+07>-7' }, { 'Asia/Hong Kong', 'HKT-8' }, { 'Asia/Hovd', '<+07>-7' }, @@ -310,7 +310,6 @@ TZ = { { 'Australia/Adelaide', 'ACST-9:30ACDT,M10.1.0,M4.1.0/3' }, { 'Australia/Brisbane', 'AEST-10' }, { 'Australia/Broken Hill', 'ACST-9:30ACDT,M10.1.0,M4.1.0/3' }, - { 'Australia/Currie', 'AEST-10AEDT,M10.1.0,M4.1.0/3' }, { 'Australia/Darwin', 'ACST-9:30' }, { 'Australia/Eucla', '<+0845>-8:45' }, { 'Australia/Hobart', 'AEST-10AEDT,M10.1.0,M4.1.0/3' }, @@ -401,7 +400,7 @@ TZ = { { 'Europe/Vatican', 'CET-1CEST,M3.5.0,M10.5.0/3' }, { 'Europe/Vienna', 'CET-1CEST,M3.5.0,M10.5.0/3' }, { 'Europe/Vilnius', 'EET-2EEST,M3.5.0/3,M10.5.0/4' }, - { 'Europe/Volgograd', '<+04>-4' }, + { 'Europe/Volgograd', '<+03>-3' }, { 'Europe/Warsaw', 'CET-1CEST,M3.5.0,M10.5.0/3' }, { 'Europe/Zagreb', 'CET-1CEST,M3.5.0,M10.5.0/3' }, { 'Europe/Zaporozhye', 'EET-2EEST,M3.5.0/3,M10.5.0/4' }, diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua index e63e2a6958..caee1d2c1c 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua @@ -24,6 +24,8 @@ OFFSET = { pdt = -25200, -- PDT nst = -12600, -- NST ndt = -9000, -- NDT + aest = 36000, -- AEST + aedt = 39600, -- AEDT nzst = 43200, -- NZST nzdt = 46800, -- NZDT hkt = 28800, -- HKT @@ -38,7 +40,6 @@ OFFSET = { wet = 0, -- WET acst = 34200, -- ACST acdt = 37800, -- ACDT - aest = 36000, -- AEST awst = 28800, -- AWST msk = 10800, -- MSK sst = -39600, -- SST diff --git a/modules/luci-base/luasrc/template.lua b/modules/luci-base/luasrc/template.lua index cd9b73b22b..3955bd76f3 100644 --- a/modules/luci-base/luasrc/template.lua +++ b/modules/luci-base/luasrc/template.lua @@ -53,7 +53,7 @@ function Template.__init__(self, name, template) -- Create a new namespace for this template self.viewns = context.viewns - + -- If we have a cached template, skip compiling and loading if not self.template then @@ -84,13 +84,13 @@ end -- Renders a template function Template.render(self, scope) scope = scope or getfenv(2) - + -- Put our predefined objects in the scope of the template setfenv(self.template, setmetatable({}, {__index = function(tbl, key) return rawget(tbl, key) or self.viewns[key] or scope[key] end})) - + -- Now finally render the thing local stat, err = util.copcall(self.template) if not stat then diff --git a/modules/luci-base/luasrc/view/error404.htm b/modules/luci-base/luasrc/view/error404.htm index a762f6038b..ff151d1834 100644 --- a/modules/luci-base/luasrc/view/error404.htm +++ b/modules/luci-base/luasrc/view/error404.htm @@ -7,5 +7,6 @@ <%+header%> <h2 name="content">404 <%:Not Found%></h2> <p><%:Sorry, the object you requested was not found.%></p> +<p><%=message%></p> <tt><%:Unable to dispatch%>: <%=url(unpack(luci.dispatcher.context.request))%></tt> <%+footer%> diff --git a/modules/luci-base/luasrc/view/header.htm b/modules/luci-base/luasrc/view/header.htm index e7b2d4787b..cffe9482ca 100644 --- a/modules/luci-base/luasrc/view/header.htm +++ b/modules/luci-base/luasrc/view/header.htm @@ -29,7 +29,7 @@ ubuspath = luci.config.main.ubuspath or '/ubus/', sessionid = luci.dispatcher.context.authsession, nodespec = luci.dispatcher.context.dispatched, - apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30), + apply_rollback = math.max(applyconf and applyconf.rollback or 90, 90), apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1), apply_timeout = math.max(applyconf and applyconf.timeout or 5, 1), apply_display = math.max(applyconf and applyconf.display or 1.5, 1), |