Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-ssr-plus: status.lua: Add restart Service button. #1642

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ if nixio.fs.access("/usr/bin/kcptun-client") then
end
end

s = m:field(Button, "Restart", translate("Restart ShadowSocksR Plus+"))
s.inputtitle = translate("Restart Service")
s.inputstyle = "reload"
s.write = function()
luci.sys.call("/etc/init.d/shadowsocksr restart >/dev/null 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "client"))
end

s = m:field(DummyValue, "google", translate("Google Connectivity"))
s.value = translate("No Check")
s.template = "shadowsocksr/check"
Expand All @@ -181,10 +189,10 @@ if uci:get_first("shadowsocksr", 'global', 'apple_optimization', '0') ~= '0' the
end

if uci:get_first("shadowsocksr", 'global', 'netflix_enable', '0') ~= '0' then
s = m:field(DummyValue, "nfip_data", translate("Netflix IP Data"))
s.rawhtml = true
s.template = "shadowsocksr/refresh"
s.value = nfip_count .. " " .. translate("Records")
s = m:field(DummyValue, "nfip_data", translate("Netflix IP Data"))
s.rawhtml = true
s.template = "shadowsocksr/refresh"
s.value = nfip_count .. " " .. translate("Records")
end

if uci:get_first("shadowsocksr", 'global', 'adblock', '0') == '1' then
Expand Down
6 changes: 6 additions & 0 deletions luci-app-ssr-plus/po/zh_Hans/ssr-plus.po
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ msgstr "强制走代理"
msgid "UDP Relay"
msgstr "UDP 中继"

msgid "Restart ShadowSocksR Plus+"
msgstr "重启 ShadowSocksR Plus+"

msgid "Restart Service"
msgstr "重启服务"

msgid "Google Connectivity"
msgstr "【谷歌】连通性检查"

Expand Down
Loading