update 2023-08-11 20:01:24

This commit is contained in:
github-actions[bot] 2023-08-11 20:01:24 +08:00
parent 42f767af12
commit 5ee7b2e337
5 changed files with 13 additions and 15 deletions

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-alist
PKG_VERSION:=1.0.10
PKG_VERSION:=1.0.11
PKG_RELEASE:=1
LUCI_TITLE:=LuCI support for alist

View File

@ -41,8 +41,9 @@ function clear_log()
end
function admin_info()
local username = luci.sys.exec("/usr/bin/alist --data $(uci -q get alist.@alist[0].data_dir) password 2>&1 | tail -2 | awk 'NR==1 {print $2}'")
local password = luci.sys.exec("/usr/bin/alist --data $(uci -q get alist.@alist[0].data_dir) password 2>&1 | tail -2 | awk 'NR==2 {print $2}'")
local random = luci.sys.exec("/usr/bin/alist --data $(uci -q get alist.@alist[0].data_dir) admin random 2>&1")
local username = string.match(random, "username: (%S+)")
local password = string.match(random, "password: (%S+)")
luci.http.prepare_content("application/json")
luci.http.write_json({username = username, password = password})

View File

@ -86,7 +86,7 @@ o.datatype = "string"
o.default = "/tmp/alist"
o.rmempty = false
o = s:option(Button, "admin_info", translate("View Password"))
o = s:option(Button, "admin_info", translate("Reset Password"))
o.rawhtml = true
o.template = "alist/admin_info"

View File

@ -3,7 +3,7 @@
function admin_info(btn)
{
btn.disabled = true;
btn.value = '<%:Reading...%>';
btn.value = '<%:Collecting data...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "nas", "alist", "admin_info")%>',
null,
function(x,rv)
@ -15,12 +15,12 @@
tb.innerHTML += "<%:Password:%>" + "<font color='green'>" + rv.password + "</font>";
}
btn.disabled = false;
btn.value = '<%:Read%>';
btn.value = '<%:Reset%>';
}
);
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Read%>" onclick="return admin_info(this)" />
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Reset%>" onclick="return admin_info(this)" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
<%+cbi/valuefooter%>

View File

@ -64,8 +64,11 @@ msgstr "启用日志"
msgid "Clear logs"
msgstr "清空日志"
msgid "View Password"
msgstr "查看密码"
msgid "Reset Password"
msgstr "重置密码"
msgid "Reset"
msgstr "重置"
msgid "Username:"
msgstr "用户名:"
@ -73,12 +76,6 @@ msgstr "用户名:"
msgid "Password:"
msgstr "密码:"
msgid "Reading..."
msgstr "读取中..."
msgid "Read"
msgstr "读取"
msgid "Login Validity Period (hours)"
msgstr "登录有效期(小时)"