fix lua.fs depends bug and version bump to 1.3

This commit is contained in:
jerrykuku 2019-11-11 23:39:13 +08:00
parent 8a6f751e82
commit 53a8baea39
2 changed files with 14 additions and 4 deletions

View File

@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=Argon Theme LUCI_TITLE:=Argon Theme
LUCI_DEPENDS:= LUCI_DEPENDS:=
PKG_VERSION:=1.2 PKG_VERSION:=1.3
PKG_RELEASE:=01-20191109 PKG_RELEASE:=01-20191111
include $(TOPDIR)/feeds/luci/luci.mk include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -26,7 +26,8 @@
local util = require "luci.util" local util = require "luci.util"
local http = require "luci.http" local http = require "luci.http"
local disp = require "luci.dispatcher" local disp = require "luci.dispatcher"
local fs = require "luci.fs" local fs = require "nixio.fs"
local nutil = require "nixio.util"
local boardinfo = util.ubus("system", "board") local boardinfo = util.ubus("system", "board")
@ -46,6 +47,15 @@
local c = tree local c = tree
local i, r local i, r
function glob(...)
local iter, code, msg = fs.glob(...)
if iter then
return nutil.consume(iter)
else
return nil, code, msg
end
end
-- tag all nodes leading to this page -- tag all nodes leading to this page
for i, r in ipairs(request) do for i, r in ipairs(request) do
if c.nodes and c.nodes[r] then if c.nodes and c.nodes[r] then
@ -183,7 +193,7 @@
math.randomseed(os.time()) math.randomseed(os.time())
local bgcount = 0 local bgcount = 0
for f in ipairs(fs.glob("/www/luci-static/argon/img/*")) do for f in ipairs(glob("/www/luci-static/argon/img/*")) do
bgcount = bgcount + 1 bgcount = bgcount + 1
end end