parent
d240aaf8d3
commit
7ba36b76e2
@ -79,9 +79,7 @@ function index()
|
|||||||
entry({"admin", "services", appname, "update_rules"}, call("update_rules")).leaf = true
|
entry({"admin", "services", appname, "update_rules"}, call("update_rules")).leaf = true
|
||||||
|
|
||||||
--[[rule_list]]
|
--[[rule_list]]
|
||||||
entry({"admin", "services", appname, "read_gfwlist"}, call("read_rulelist", "gfw")).leaf = true
|
entry({"admin", "services", appname, "read_rulelist"}, call("read_rulelist")).leaf = true
|
||||||
entry({"admin", "services", appname, "read_chnlist"}, call("read_rulelist", "chn")).leaf = true
|
|
||||||
entry({"admin", "services", appname, "read_chnroute"}, call("read_rulelist", "chnroute")).leaf = true
|
|
||||||
|
|
||||||
--[[Components update]]
|
--[[Components update]]
|
||||||
entry({"admin", "services", appname, "check_passwall"}, call("app_check")).leaf = true
|
entry({"admin", "services", appname, "check_passwall"}, call("app_check")).leaf = true
|
||||||
@ -495,14 +493,18 @@ function com_update(comname)
|
|||||||
http_write_json(json)
|
http_write_json(json)
|
||||||
end
|
end
|
||||||
|
|
||||||
function read_rulelist(list)
|
function read_rulelist()
|
||||||
|
local rule_type = http.formvalue("type")
|
||||||
local rule_path
|
local rule_path
|
||||||
if list == "gfw" then
|
if rule_type == "gfw" then
|
||||||
rule_path = "/usr/share/passwall/rules/gfwlist"
|
rule_path = "/usr/share/passwall/rules/gfwlist"
|
||||||
elseif list == "chn" then
|
elseif rule_type == "chn" then
|
||||||
rule_path = "/usr/share/passwall/rules/chnlist"
|
rule_path = "/usr/share/passwall/rules/chnlist"
|
||||||
else
|
elseif rule_type == "chnroute" then
|
||||||
rule_path = "/usr/share/passwall/rules/chnroute"
|
rule_path = "/usr/share/passwall/rules/chnroute"
|
||||||
|
else
|
||||||
|
http.status(400, "Invalid rule type")
|
||||||
|
return
|
||||||
end
|
end
|
||||||
if fs.access(rule_path) then
|
if fs.access(rule_path) then
|
||||||
http.prepare_content("text/plain")
|
http.prepare_content("text/plain")
|
||||||
|
@ -12,7 +12,10 @@ f:append(Template(appname .. "/log/log"))
|
|||||||
fb = SimpleForm('backup-restore')
|
fb = SimpleForm('backup-restore')
|
||||||
fb.reset = false
|
fb.reset = false
|
||||||
fb.submit = false
|
fb.submit = false
|
||||||
s = fb:section(SimpleSection, translate("Backup and Restore"), translate("Backup or Restore Client and Server Configurations."))
|
s = fb:section(SimpleSection, translate("Backup and Restore"), translate("Backup or Restore Client and Server Configurations.") ..
|
||||||
|
"<br><font color='red'>" ..
|
||||||
|
translate("Note: Restoring configurations across different versions may cause compatibility issues.") ..
|
||||||
|
"</font>")
|
||||||
o = s:option(DummyValue, '', nil)
|
o = s:option(DummyValue, '', nil)
|
||||||
o.template = appname .. "/log/backup_restore"
|
o.template = appname .. "/log/backup_restore"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ local total_lines_text = translate("Total Lines")
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
function read_gfw() {
|
function read_gfw() {
|
||||||
fetch('<%= api.url("read_gfwlist") %>')
|
fetch('<%= api.url("read_rulelist") %>?type=gfw')
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
var total_lines = data.split("\n").length;
|
var total_lines = data.split("\n").length;
|
||||||
@ -19,7 +19,7 @@ local total_lines_text = translate("Total Lines")
|
|||||||
}
|
}
|
||||||
|
|
||||||
function read_chn() {
|
function read_chn() {
|
||||||
fetch('<%= api.url("read_chnlist") %>')
|
fetch('<%= api.url("read_rulelist") %>?type=chn')
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
var total_lines = data.split("\n").length;
|
var total_lines = data.split("\n").length;
|
||||||
@ -32,7 +32,7 @@ local total_lines_text = translate("Total Lines")
|
|||||||
}
|
}
|
||||||
|
|
||||||
function read_chnroute() {
|
function read_chnroute() {
|
||||||
fetch('<%= api.url("read_chnroute") %>')
|
fetch('<%= api.url("read_rulelist") %>?type=chnroute')
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
var total_lines = data.split("\n").length;
|
var total_lines = data.split("\n").length;
|
||||||
|
@ -1759,6 +1759,9 @@ msgstr "备份还原"
|
|||||||
msgid "Backup or Restore Client and Server Configurations."
|
msgid "Backup or Restore Client and Server Configurations."
|
||||||
msgstr "备份或还原客户端及服务端配置。"
|
msgstr "备份或还原客户端及服务端配置。"
|
||||||
|
|
||||||
|
msgid "Note: Restoring configurations across different versions may cause compatibility issues."
|
||||||
|
msgstr "注意:不同版本间的配置恢复可能会导致兼容性问题。"
|
||||||
|
|
||||||
msgid "Create Backup File"
|
msgid "Create Backup File"
|
||||||
msgstr "创建备份文件"
|
msgstr "创建备份文件"
|
||||||
|
|
||||||
|
@ -20,10 +20,10 @@ index 2b72468..15c6437 100644
|
|||||||
|
|
||||||
define Package/$(PKG_NAME)/postrm
|
define Package/$(PKG_NAME)/postrm
|
||||||
diff --git a/luci-app-passwall/luasrc/controller/passwall.lua b/luci-app-passwall/luasrc/controller/passwall.lua
|
diff --git a/luci-app-passwall/luasrc/controller/passwall.lua b/luci-app-passwall/luasrc/controller/passwall.lua
|
||||||
index ae0617a..29e3604 100644
|
index e7fcbee..4143d44 100644
|
||||||
--- a/luci-app-passwall/luasrc/controller/passwall.lua
|
--- a/luci-app-passwall/luasrc/controller/passwall.lua
|
||||||
+++ b/luci-app-passwall/luasrc/controller/passwall.lua
|
+++ b/luci-app-passwall/luasrc/controller/passwall.lua
|
||||||
@@ -283,7 +283,7 @@ function connect_status()
|
@@ -281,7 +281,7 @@ function connect_status()
|
||||||
url = "-x socks5h://" .. socks_server .. " " .. url
|
url = "-x socks5h://" .. socks_server .. " " .. url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user