From 7964407ab4d1edead500b1d002124a8ede15379a Mon Sep 17 00:00:00 2001 From: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:44:18 +0000 Subject: [PATCH 1/3] aliyundrive-fuse: Do not use `$(PKG_NAME)` --- openwrt/aliyundrive-fuse/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openwrt/aliyundrive-fuse/Makefile b/openwrt/aliyundrive-fuse/Makefile index b79faf2..5f39ec2 100644 --- a/openwrt/aliyundrive-fuse/Makefile +++ b/openwrt/aliyundrive-fuse/Makefile @@ -28,7 +28,7 @@ PKG_HASH:=skip include $(INCLUDE_DIR)/package.mk -define Package/$(PKG_NAME) +define Package/aliyundrive-fuse SECTION:=multimedia CATEGORY:=Multimedia DEPENDS:=+fuse-utils @@ -36,11 +36,11 @@ define Package/$(PKG_NAME) URL:=https://github.com/messense/aliyundrive-fuse endef -define Package/$(PKG_NAME)/description +define Package/aliyundrive-fuse/description FUSE for AliyunDrive. endef -define Package/$(PKG_NAME)/conffiles +define Package/aliyundrive-fuse/conffiles /etc/config/aliyundrive-fuse endef @@ -62,10 +62,10 @@ define Build/Prepare endef define Build/Compile - echo "$(PKG_NAME) using precompiled binary." + echo "aliyundrive-fuse using precompiled binary." endef -define Package/$(PKG_NAME)/install +define Package/aliyundrive-fuse/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/aliyundrive-fuse $(1)/usr/bin/aliyundrive-fuse $(INSTALL_DIR) $(1)/etc/init.d @@ -74,4 +74,4 @@ define Package/$(PKG_NAME)/install $(INSTALL_CONF) ./files/aliyundrive-fuse.config $(1)/etc/config/aliyundrive-fuse endef -$(eval $(call BuildPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,aliyundrive-fuse)) From 056d5686cf7b7a4f638ef9d37f3782c243f029b2 Mon Sep 17 00:00:00 2001 From: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:50:00 +0000 Subject: [PATCH 2/3] luci-app-aliyundrive-fuse: drop useless depends --- openwrt/luci-app-aliyundrive-fuse/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openwrt/luci-app-aliyundrive-fuse/Makefile b/openwrt/luci-app-aliyundrive-fuse/Makefile index e252856..6c44386 100644 --- a/openwrt/luci-app-aliyundrive-fuse/Makefile +++ b/openwrt/luci-app-aliyundrive-fuse/Makefile @@ -10,7 +10,7 @@ PKG_MAINTAINER:=messense LUCI_TITLE:=LuCI Support for aliyundrive-fuse LUCI_PKGARCH:=all -LUCI_DEPENDS:=+aliyundrive-fuse +lua +libuci-lua +LUCI_DEPENDS:=+aliyundrive-fuse include $(TOPDIR)/feeds/luci/luci.mk From 07d7647975aab3a10d88c990535d08d7371e7883 Mon Sep 17 00:00:00 2001 From: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:06:14 +0000 Subject: [PATCH 3/3] luci-app-aliyundrive-fuse: compatible 19.07 luci --- .../luasrc/controller/aliyundrive-fuse.lua | 11 ++++++++--- .../luasrc/model/cbi/aliyundrive-fuse/client.lua | 3 --- openwrt/luci-app-aliyundrive-fuse/po/zh_Hans | 1 + .../share/rpcd/acl.d/luci-app-aliyundrive-fuse.json | 11 +++++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) create mode 120000 openwrt/luci-app-aliyundrive-fuse/po/zh_Hans create mode 100644 openwrt/luci-app-aliyundrive-fuse/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-fuse.json diff --git a/openwrt/luci-app-aliyundrive-fuse/luasrc/controller/aliyundrive-fuse.lua b/openwrt/luci-app-aliyundrive-fuse/luasrc/controller/aliyundrive-fuse.lua index d3fd418..53640bc 100644 --- a/openwrt/luci-app-aliyundrive-fuse/luasrc/controller/aliyundrive-fuse.lua +++ b/openwrt/luci-app-aliyundrive-fuse/luasrc/controller/aliyundrive-fuse.lua @@ -4,9 +4,14 @@ function index() if not nixio.fs.access("/etc/config/aliyundrive-fuse") then return end - entry({"admin", "services", "aliyundrive-fuse"}, alias("admin", "services", "aliyundrive-fuse", "client"),_("AliyunDrive FUSE"), 10).dependent = true -- 首页 - entry({"admin", "services", "aliyundrive-fuse", "client"}, cbi("aliyundrive-fuse/client"),_("Settings"), 10).leaf = true -- 客户端配置 - entry({"admin", "services", "aliyundrive-fuse", "log"}, form("aliyundrive-fuse/log"),_("Log"), 30).leaf = true -- 日志页面 + + local page + page = entry({"admin", "services", "aliyundrive-fuse"}, alias("admin", "services", "aliyundrive-fuse", "client"), _("AliyunDrive FUSE"), 10) -- 首页 + page.dependent = true + page.acl_depends = { "luci-app-aliyundrive-fuse" } + + entry({"admin", "services", "aliyundrive-fuse", "client"}, cbi("aliyundrive-fuse/client"), _("Settings"), 10).leaf = true -- 客户端配置 + entry({"admin", "services", "aliyundrive-fuse", "log"}, form("aliyundrive-fuse/log"), _("Log"), 30).leaf = true -- 日志页面 entry({"admin", "services", "aliyundrive-fuse", "status"}, call("action_status")).leaf = true entry({"admin", "services", "aliyundrive-fuse", "logtail"}, call("action_logtail")).leaf = true diff --git a/openwrt/luci-app-aliyundrive-fuse/luasrc/model/cbi/aliyundrive-fuse/client.lua b/openwrt/luci-app-aliyundrive-fuse/luasrc/model/cbi/aliyundrive-fuse/client.lua index ef3bfea..d2e29a5 100644 --- a/openwrt/luci-app-aliyundrive-fuse/luasrc/model/cbi/aliyundrive-fuse/client.lua +++ b/openwrt/luci-app-aliyundrive-fuse/luasrc/model/cbi/aliyundrive-fuse/client.lua @@ -1,6 +1,3 @@ -local uci = luci.model.uci.cursor() -local m, e - m = Map("aliyundrive-fuse") m.title = translate("AliyunDrive FUSE") m.description = translate("Project GitHub URL") diff --git a/openwrt/luci-app-aliyundrive-fuse/po/zh_Hans b/openwrt/luci-app-aliyundrive-fuse/po/zh_Hans new file mode 120000 index 0000000..41451e4 --- /dev/null +++ b/openwrt/luci-app-aliyundrive-fuse/po/zh_Hans @@ -0,0 +1 @@ +zh-cn \ No newline at end of file diff --git a/openwrt/luci-app-aliyundrive-fuse/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-fuse.json b/openwrt/luci-app-aliyundrive-fuse/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-fuse.json new file mode 100644 index 0000000..cc2e584 --- /dev/null +++ b/openwrt/luci-app-aliyundrive-fuse/root/usr/share/rpcd/acl.d/luci-app-aliyundrive-fuse.json @@ -0,0 +1,11 @@ +{ + "luci-app-aliyundrive-fuse": { + "description": "Grant UCI access for luci-app-aliyundrive-fuse", + "read": { + "uci": [ "aliyundrive-fuse" ] + }, + "write": { + "uci": [ "aliyundrive-fuse" ] + } + } +}