luci-app-passwall2: sync upstream

This commit is contained in:
actions 2024-03-30 03:30:05 +08:00
parent b1cbfa1c81
commit 3da2d267bd
3 changed files with 21 additions and 11 deletions

View File

@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall2
PKG_VERSION:=1.28-4
PKG_VERSION:=1.28-5
PKG_RELEASE:=
PKG_CONFIG_DEPENDS:= \

View File

@ -114,20 +114,25 @@ local api = require "luci.passwall2.api"
}
return ret;
},
query: function (param, src, default_value, tval = "1", fval = "0") {
var ret = "&" + param + "=";
query: function (param, src, default_value) {
var obj = this.get(src);
if (obj) {
var ret = "&" + param + "=";
if (obj.type === "checkbox") {
return ret + (obj.checked === true ? tval : fval);
return ret + (obj.checked === true ? "1" : "0");
} else {
var result = encodeURIComponent(obj.value);
if ((result == null || result.trim() == "") && default_value)
result = default_value;
return ret + result;
if (result == null || result.trim() == "") {
if (default_value) {
return ret + default_value;
}
return "";
} else {
return ret + result;
}
}
}
return ""
return "";
}
}
opt.base = "cbid." + urlname + "." + sid;

View File

@ -594,7 +594,9 @@ local function processData(szType, content, add_mode, add_from)
local params = {}
for _, v in pairs(split(query[2], '&')) do
local t = split(v, '=')
params[string.lower(t[1])] = UrlDecode(t[2])
if #t > 1 then
params[string.lower(t[1])] = UrlDecode(t[2])
end
end
-- [2001:4860:4860::8888]:443
-- 8.8.8.8:443
@ -838,7 +840,9 @@ local function processData(szType, content, add_mode, add_from)
local params = {}
for _, v in pairs(split(query[2], '&')) do
local t = split(v, '=')
params[string.lower(t[1])] = UrlDecode(t[2])
if #t > 1 then
params[string.lower(t[1])] = UrlDecode(t[2])
end
end
-- [2001:4860:4860::8888]:443
-- 8.8.8.8:443
@ -1186,7 +1190,8 @@ local function parse_link(raw, add_mode, add_from)
tinsert(node_list, result)
end
end
end, function ()
end, function (err)
--log(err)
log(v, "解析错误,跳过此节点。")
end
)