Skip to content

Commit

Permalink
update 2024-02-23 13:47:31
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 23, 2024
1 parent fc543b3 commit 88f295b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
2 changes: 1 addition & 1 deletion luci-app-sunpanel/luasrc/controller/sunpanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
3 changes: 2 additions & 1 deletion luci-app-sunpanel/luasrc/model/cbi/sunpanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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:") .. "[email protected]/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"

Expand Down
21 changes: 21 additions & 0 deletions luci-app-sunpanel/po/zh-cn/sunpanel.po
Original file line number Diff line number Diff line change
@@ -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 "状态"

21 changes: 18 additions & 3 deletions sunpanel/files/sunpanel.init
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

START=99
USE_PROCD=1
NAME=sunpanel

get_config() {
config_get_bool enabled $1 enabled 0
Expand All @@ -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
Expand All @@ -24,3 +25,17 @@ start_service() {
procd_close_instance
}

service_triggers() {
procd_add_reload_trigger "$NAME"
}

reload_service() {
restart
}

restart() {
stop
sleep 2
start
}

0 comments on commit 88f295b

Please sign in to comment.