From 9abb82564345bc6d9d356d0226107490ad001627 Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Tue, 12 Nov 2024 20:38:43 +0800 Subject: [PATCH] update 2024-11-12 20:38:43 --- aria2/Makefile | 2 +- luci-app-alist/Makefile | 2 +- .../luci-static/resources/view/alist/basic.js | 5 +++++ .../luci-static/resources/view/alist/logs.js | 14 +++++++++++--- luci-app-alist/po/zh_Hans/alist.po | 7 +++++-- .../root/usr/share/rpcd/acl.d/luci-app-alist.json | 4 ++-- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/aria2/Makefile b/aria2/Makefile index 55c45b162..7f70d9c4d 100644 --- a/aria2/Makefile +++ b/aria2/Makefile @@ -53,7 +53,7 @@ define Package/aria2 SUBMENU:=File Transfer TITLE:=lightweight download utility URL:=https://aria2.github.io/ - DEPENDS:=+zlib +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls \ + DEPENDS:=+zlib +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_OPENSSL:libopenssl-legacy +ARIA2_GNUTLS:libgnutls \ +ARIA2_NETTLE:libnettle +ARIA2_LIBGCRYPT:libgcrypt +ARIA2_GMP:libgmp \ +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +ARIA2_SFTP:libssh2 \ +ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3 diff --git a/luci-app-alist/Makefile b/luci-app-alist/Makefile index 331cb4eff..d1ecd1917 100644 --- a/luci-app-alist/Makefile +++ b/luci-app-alist/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-alist -PKG_VERSION:=1.1.1 +PKG_VERSION:=1.1.2 PKG_RELEASE:=1 LUCI_TITLE:=LuCI support for alist diff --git a/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js b/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js index cce629da6..72d388fa1 100644 --- a/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js +++ b/luci-app-alist/htdocs/luci-static/resources/view/alist/basic.js @@ -170,6 +170,11 @@ return view.extend({ o.default = 1; o.rmempty = false; + o = s.option(form.Value, 'log_path', _('Log path')); + o.default = '/var/log/alist.log'; + o.rmempty = false; + o.depends('log', '1'); + o = s.option(form.Value, 'log_max_size', _('Max Size')); o.datatype = 'uinteger'; o.default = '10'; diff --git a/luci-app-alist/htdocs/luci-static/resources/view/alist/logs.js b/luci-app-alist/htdocs/luci-static/resources/view/alist/logs.js index 66f7f8504..15a91f1a8 100644 --- a/luci-app-alist/htdocs/luci-static/resources/view/alist/logs.js +++ b/luci-app-alist/htdocs/luci-static/resources/view/alist/logs.js @@ -2,15 +2,21 @@ 'require dom'; 'require fs'; 'require poll'; +'require uci'; 'require view'; var scrollPosition = 0; var userScrolled = false; var logTextarea; +var log_path; + +uci.load('alist').then(function() { + log_path = uci.get('alist', '@alist[0]', 'log_path') || '/var/log/alist.log'; +}); function pollLog() { return Promise.all([ - fs.read_direct('/var/log/alist.log', 'text').then(function (res) { + fs.read_direct(log_path, 'text').then(function (res) { return res.trim().split(/\n/).join('\n').replace(/\u001b\[33mWARN\u001b\[0m/g, '').replace(/\u001b\[36mINFO\u001b\[0m/g, '').replace(/\u001b\[31mERRO\u001b\[0m/g, ''); }), ]).then(function (data) { @@ -26,7 +32,7 @@ function pollLog() { return view.extend({ handleCleanLogs: function () { - return fs.write('/var/log/alist.log', '') + return fs.write(log_path, '') .catch(function (e) { ui.addNotification(null, E('p', e.message)) }); }, @@ -45,7 +51,9 @@ return view.extend({ var log_textarea_wrapper = E('div', { 'id': 'log_textarea' }, logTextarea); - poll.add(pollLog); + setTimeout(function () { + poll.add(pollLog); + }, 100); var clear_logs_button = E('input', { 'class': 'btn cbi-button-action', 'type': 'button', 'style': 'margin-left: 10px; margin-top: 10px;', 'value': _('Clear logs') }); clear_logs_button.addEventListener('click', this.handleCleanLogs.bind(this)); diff --git a/luci-app-alist/po/zh_Hans/alist.po b/luci-app-alist/po/zh_Hans/alist.po index ef9fa3b44..7aa75b260 100644 --- a/luci-app-alist/po/zh_Hans/alist.po +++ b/luci-app-alist/po/zh_Hans/alist.po @@ -80,8 +80,11 @@ msgstr "允许从外网访问" msgid "Enable Logs" msgstr "启用日志" -msgid "Max Size" -msgstr "日志文大小" +msgid "Log path" +msgstr "日志文件路径" + +msgid "Max Size (MB)" +msgstr "日志文件大小(MB)" msgid "Max backups" msgstr "日志备份数量" diff --git a/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json b/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json index 46d12af5e..e2dc2d4b6 100644 --- a/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json +++ b/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json @@ -4,7 +4,7 @@ "read": { "file": { "/usr/bin/alist": [ "exec" ], - "/var/log/alist.log": [ "read" ] + "/*": [ "read" ] }, "ubus": { "service": [ "list" ] @@ -13,7 +13,7 @@ }, "write": { "file": { - "/var/log/alist.log": [ "write" ] + "/*": [ "write" ] }, "uci": [ "alist" ] }