From 67d86bf3cfcc255e00c73ad3d7702d1a5d276d90 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Sun, 31 Oct 2021 17:03:39 +0800 Subject: [PATCH] luci-app-aliyundrive-webdav: update to 0.5.1 (#8144) Signed-off-by: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com> --- package/lean/aliyundrive-webdav/Makefile | 4 ++-- .../files/aliyundrive-webdav.config | 1 + .../files/aliyundrive-webdav.init | 19 ++++++++++++------- .../lean/luci-app-aliyundrive-webdav/Makefile | 2 +- .../model/cbi/aliyundrive-webdav/client.lua | 16 ++++++++++------ .../po/zh-cn/aliyundrive-webdav.po | 6 ++++++ 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/package/lean/aliyundrive-webdav/Makefile b/package/lean/aliyundrive-webdav/Makefile index 53296b3bc..47add87e8 100644 --- a/package/lean/aliyundrive-webdav/Makefile +++ b/package/lean/aliyundrive-webdav/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=aliyundrive-webdav -PKG_VERSION:=0.4.8 -PKG_RELEASE:=1 +PKG_VERSION:=0.5.1 +PKG_RELEASE:=$(AUTORELESE) PKG_LICENSE:=MIT PKG_MAINTAINER:=messense diff --git a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config index cc9ce6016..66a4ef1af 100644 --- a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config +++ b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.config @@ -11,3 +11,4 @@ config server option cache_ttl '600' option root '/' option no_trash '0' + option domain_id '' diff --git a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init index f762e46dd..f8faf91f9 100755 --- a/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init +++ b/package/lean/aliyundrive-webdav/files/aliyundrive-webdav.init @@ -25,15 +25,20 @@ start_service() { local host=$(uci_get_by_type server host 127.0.0.1) local port=$(uci_get_by_type server port 8080) local root=$(uci_get_by_type server root /) - local no_trash=$(uci_get_by_type server no_trash 0) + local domain_id=$(uci_get_by_type server domain_id) local extra_options="-I" - case "$no_trash" in - 1|on|true|yes|enabled) - extra_options="$extra_options --no-trash" - ;; - *) ;; - esac + + if [[ ! -z "$domain_id" ]]; then + extra_options="$extra_options --domain-id $domain_id" + else + case "$(uci_get_by_type server no_trash 0)" in + 1|on|true|yes|enabled) + extra_options="$extra_options --no-trash" + ;; + *) ;; + esac + fi procd_open_instance procd_set_param command /bin/sh -c "/usr/bin/$NAME $extra_options --host $host --port $port --root $root -S $read_buf_size --cache-size $cache_size --cache-ttl $cache_ttl --workdir /var/run/$NAME >>/var/log/$NAME.log 2>&1" diff --git a/package/lean/luci-app-aliyundrive-webdav/Makefile b/package/lean/luci-app-aliyundrive-webdav/Makefile index 63616b523..d8714b6dd 100644 --- a/package/lean/luci-app-aliyundrive-webdav/Makefile +++ b/package/lean/luci-app-aliyundrive-webdav/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-aliyundrive-webdav -PKG_VERSION:=0.4.8 +PKG_VERSION:=0.5.1 PKG_RELEASE:=1 PKG_LICENSE:=MIT diff --git a/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua b/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua index bc9f7cf3d..7cdbf8842 100644 --- a/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua +++ b/package/lean/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua @@ -1,8 +1,9 @@ local uci = luci.model.uci.cursor() local m, e -m = Map("aliyundrive-webdav", translate("AliyunDrive WebDAV"), - translate("Project GitHub URL")) +m = Map("aliyundrive-webdav") +m.title = translate("AliyunDrive WebDAV") +m.description = translate("Project GitHub URL") m:section(SimpleSection).template = "aliyundrive-webdav/aliyundrive-webdav_status" @@ -12,11 +13,11 @@ e.anonymous = true enable = e:option(Flag, "enable", translate("Enable")) enable.rmempty = false -refresh_token = e:option(Value, "refresh_token", translate("Refresh Token"), - translate("How to get refresh token")) +refresh_token = e:option(Value, "refresh_token", translate("Refresh Token")) +refresh_token.description = translate("How to get refresh token") -root = e:option(Value, "root", translate("Root Directory"), - translate("Restrict access to a folder of aliyundrive, defaults to / which means no restrictions")) +root = e:option(Value, "root", translate("Root Directory")) +root.description = translate("Restrict access to a folder of aliyundrive, defaults to / which means no restrictions") root.default = "/" host = e:option(Value, "host", translate("Host")) @@ -46,6 +47,9 @@ cache_ttl.datatype = "uinteger" no_trash = e:option(Flag, "no_trash", translate("Delete file permanently instead of trashing")) no_trash.rmempty = false +domain_id = e:option(Value, "domain_id", translate("Domain ID")) +domain_id.description = translate("Input domain_id option will use Aliyun PDS instead of AliyunDrive") + debug = e:option(Flag, "debug", translate("Debug Mode")) debug.rmempty = false diff --git a/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po b/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po index f0bf4e284..09718aab1 100644 --- a/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po +++ b/package/lean/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po @@ -66,3 +66,9 @@ msgstr "限制只能访问该云盘目录,默认为 / 表示不限制,注意 msgid "Delete file permanently instead of trashing" msgstr "删除文件不放入回收站" + +msgid "Domain ID" +msgstr "阿里云相册与云盘服务 domainId" + +msgid "Input domain_id option will use Aliyun PDS instead of AliyunDrive" +msgstr "填写此选项将使用阿里云相册与网盘服务而不是阿里云盘"