luci: fix typo

This commit is contained in:
xiaorouji 2023-02-09 23:26:34 +08:00 committed by sbwml
parent be8f6b1909
commit 092b474a22
3 changed files with 7 additions and 13 deletions

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall PKG_NAME:=luci-app-passwall
PKG_VERSION:=4.58 PKG_VERSION:=4.58
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_CONFIG_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \ CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \

View File

@ -25,7 +25,7 @@ local geosite_update = api.uci_get_type("global_rules", "geosite_update", "1") =
} }
} }
XHR.get('<%=api.url("update_rules")%>', { XHR.get('<%=api.url("update_rules")%>', {
update: checkBoxList update: checkBoxList.join(",")
}, },
function(x, data) { function(x, data) {
if(x && x.status == 200) { if(x && x.status == 200) {

View File

@ -49,16 +49,10 @@ local log = function(...)
end end
end end
-- trim
local function trim(text)
if not text or text == "" then return "" end
return (string.gsub(text, "^%s*(.-)%s*$", "%1"))
end
-- curl -- curl
local function curl(url, file, valifile) local function curl(url, file, valifile)
local args = { local args = {
"-sKL", "-w %{http_code}", "--retry 3", "--connect-timeout 3" "-skL", "-w %{http_code}", "--retry 3", "--connect-timeout 3"
} }
if file then if file then
args[#args + 1] = "-o " .. file args[#args + 1] = "-o " .. file
@ -241,8 +235,8 @@ end
local function fetch_geoip() local function fetch_geoip()
--请求geoip --请求geoip
xpcall(function() xpcall(function()
local json_str = api.curl_logic(geoip_api) local return_code, content = api.curl_logic(geoip_api)
local json = jsonc.parse(json_str) local json = jsonc.parse(content)
if json.tag_name and json.assets then if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do for _, v in ipairs(json.assets) do
if v.name and v.name == "geoip.dat.sha256sum" then if v.name and v.name == "geoip.dat.sha256sum" then
@ -292,8 +286,8 @@ end
local function fetch_geosite() local function fetch_geosite()
--请求geosite --请求geosite
xpcall(function() xpcall(function()
local json_str = api.curl_logic(geosite_api) local return_code, content = api.curl_logic(geosite_api)
local json = jsonc.parse(json_str) local json = jsonc.parse(content)
if json.tag_name and json.assets then if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do for _, v in ipairs(json.assets) do
if v.name and v.name == "geosite.dat.sha256sum" then if v.name and v.name == "geosite.dat.sha256sum" then