From 53a8baea390c086f61a6d05b83802d0572719875 Mon Sep 17 00:00:00 2001 From: jerrykuku Date: Mon, 11 Nov 2019 23:39:13 +0800 Subject: [PATCH] fix lua.fs depends bug and version bump to 1.3 --- Makefile | 4 ++-- luasrc/view/themes/argon/header.htm | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 95a88f1..e7b235b 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Argon Theme LUCI_DEPENDS:= -PKG_VERSION:=1.2 -PKG_RELEASE:=01-20191109 +PKG_VERSION:=1.3 +PKG_RELEASE:=01-20191111 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luasrc/view/themes/argon/header.htm b/luasrc/view/themes/argon/header.htm index 89fe6c4..e6efcff 100644 --- a/luasrc/view/themes/argon/header.htm +++ b/luasrc/view/themes/argon/header.htm @@ -26,7 +26,8 @@ local util = require "luci.util" local http = require "luci.http" 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") @@ -46,6 +47,15 @@ local c = tree 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 for i, r in ipairs(request) do if c.nodes and c.nodes[r] then @@ -183,7 +193,7 @@ math.randomseed(os.time()) 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 end