update 2024-02-23 13:47:31

This commit is contained in:
github-actions[bot] 2024-02-23 13:47:31 +08:00
parent fc543b3a43
commit 88f295b584
4 changed files with 42 additions and 5 deletions

View File

@ -16,7 +16,7 @@ function sunpanel_status()
local port = tonumber(uci:get_first("sunpanel", "sunpanel", "port"))
local status = {
running = (sys.call("pidof sunpanel >/dev/null") == 0),
running = (sys.call("pidof sunpanelbin >/dev/null") == 0),
port = (port or 8897)
}

View File

@ -4,7 +4,8 @@
local block_model = require "luci.model.sunpanel"
local m, s, o
m = Map("sunpanel", translate("SunPanel"), translate("Server, NAS navigation panel, Homepage, Browser homepage."))
m = Map("sunpanel", translate("SunPanel"), translate("Server, NAS navigation panel, Homepage, Browser homepage. Login:") .. "admin@sun.cc/12345678"
.. translate("Official website:") .. ' <a href=\"https://sun-panel-doc.enianteam.com/\" target=\"_blank\">https://sun-panel-doc.enianteam.com/</a>')
m:section(SimpleSection).template = "sunpanel/status"

View File

@ -0,0 +1,21 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Official website:"
msgstr "官方网站:"
msgid "Config path"
msgstr "配置文件路径"
msgid "Service Status"
msgstr "服务状态"
msgid "Server, NAS navigation panel, Homepage, Browser homepage. Login:"
msgstr "一个好看的NAS导航页登录"
msgid "Global settings"
msgstr "全局配置"
msgid "Status"
msgstr "状态"

View File

@ -2,6 +2,7 @@
START=99
USE_PROCD=1
NAME=sunpanel
get_config() {
config_get_bool enabled $1 enabled 0
@ -10,12 +11,12 @@ get_config() {
}
start_service() {
config_load sunpanel
config_foreach get_config sunpanel
config_load "$NAME"
config_foreach get_config "$NAME"
[ $enabled != 1 ] && return 1
[ -z $config_path ] && return 1
[ ! -d $config_path ] && return 1
lua /usr/libexec/istorec/sunpanel_conf.lua sunpanel /usr/share/sunpanel/conf.temp $config_path/conf.ini
lua /usr/libexec/istorec/sunpanel_conf.lua $NAME /usr/share/$NAME/conf.temp $config_path/conf.ini
procd_open_instance
procd_set_param command /usr/sbin/sunpanelbin -cfgPath $config_path
@ -24,3 +25,17 @@ start_service() {
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger "$NAME"
}
reload_service() {
restart
}
restart() {
stop
sleep 2
start
}