update 2026-06-04 00:28:20

This commit is contained in:
action committed 2026-06-04 00:28:20 +08:00
1 parent a3dfac28a4
commit 623cdab94c
36 files changed
+468 -228

No files matched your search

@@ -22,7 +22,6 @@ function index()
local appname = api.appname -- global definitions not available
local uci = api.uci -- in function index()
entry({"admin", "services", appname}).dependent = true
entry({"admin", "services", appname, "reset_config"}, call("reset_config")).leaf = true
entry({"admin", "services", appname, "show"}, call("show_menu")).leaf = true
entry({"admin", "services", appname, "hide"}, call("hide_menu")).leaf = true
local e
@@ -109,6 +108,7 @@ function index()
--[[Backup]]
entry({"admin", "services", appname, "create_backup"}, call("create_backup")).leaf = true
entry({"admin", "services", appname, "restore_backup"}, call("restore_backup")).leaf = true
entry({"admin", "services", appname, "reset_config"}, call("reset_config")).leaf = true
--[[geoview]]
entry({"admin", "services", appname, "geo_view"}, call("geo_view")).leaf = true
@@ -130,6 +130,8 @@ local function http_write_json_error(data)
end
function reset_config()
uci:revert(appname)
luci.sys.call("echo '' > /tmp/log/passwall2.log")
luci.sys.call('/etc/init.d/passwall2 stop')
luci.sys.call('[ -f "/usr/share/passwall2/0_default_config" ] && cp -f /usr/share/passwall2/0_default_config /etc/config/passwall2')
http.redirect(api.url())
@@ -745,6 +747,7 @@ function restore_backup()
fp:write(decoded)
fp:close()
if chunk_index + 1 == total_chunks then
uci:revert(appname)
api.sys.call("echo '' > /tmp/log/passwall2.log")
api.log(0, string.format(" * PassWall2 %s", i18n.translate("Configuration file uploaded successfully…")))
local temp_dir = '/tmp/passwall2_bak'