diff --git a/luci-app-alist/luasrc/model/cbi/alist.lua b/luci-app-alist/luasrc/model/cbi/alist.lua index eff9010..59d4220 100644 --- a/luci-app-alist/luasrc/model/cbi/alist.lua +++ b/luci-app-alist/luasrc/model/cbi/alist.lua @@ -1,6 +1,12 @@ local m, s +local sys = require "luci.sys" -m = Map("alist", translate("Alist"), translate("Alist is an file list program that supports multiple storage. Default password: alist")) +if sys.call("pidof alist >/dev/null") == 0 then + local password = sys.exec("/usr/bin/alist --conf /etc/alist/config.json -password | awk '{print $3}'") + m = Map("alist", translate("Alist"), translate("A file list program that supports multiple storage.") .. " " .. translate("manage password:") .. "" .. password .. "") +else + m = Map("alist", translate("Alist"), translate("A file list program that supports multiple storage.")) +end m:section(SimpleSection).template = "alist_status" diff --git a/luci-app-alist/po/zh-cn/alist.po b/luci-app-alist/po/zh-cn/alist.po index d6e8ca9..5325952 100644 --- a/luci-app-alist/po/zh-cn/alist.po +++ b/luci-app-alist/po/zh-cn/alist.po @@ -7,8 +7,11 @@ msgstr "运行状态" msgid "Click to open Alist" msgstr "点击打开 Alist" -msgid "Alist is an file list program that supports multiple storage. Default password: alist" -msgstr "Alist 是一个支持多存储的文件列表程序。默认密码:alist" +msgid "A file list program that supports multiple storage." +msgstr "一款支持多种存储的目录文件列表程序。" + +msgid "manage password:" +msgstr "管理密码:" msgid "Global settings" msgstr "全局设置"