Skip to content

Commit 768f24e

Browse files
SakuraFallingMad1715173329
authored andcommitted
luci-app-passwall: bump to 26.1.1
1 parent 077a508 commit 768f24e

File tree

21 files changed

+1901
-2070
lines changed

21 files changed

+1901
-2070
lines changed

applications/luci-app-passwall/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=luci-app-passwall
9-
PKG_VERSION:=25.12.25
9+
PKG_VERSION:=26.1.1
1010
PKG_RELEASE:=1
1111

1212
PKG_CONFIG_DEPENDS:= \

applications/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
local api = require "luci.passwall.api"
2-
local appname = "passwall"
2+
local appname = api.appname
33
local datatypes = api.datatypes
44
local net = require "luci.model.network".init()
55

@@ -9,14 +9,17 @@ for k, e in ipairs(api.get_valid_nodes()) do
99
nodes_table[#nodes_table + 1] = {
1010
id = e[".name"],
1111
obj = e,
12-
remarks = e["remark"]
12+
remarks = e["remark"],
13+
group = e["group"]
1314
}
1415
end
1516
end
1617

1718
m = Map(appname)
1819
api.set_apply_on_parse(m)
1920

21+
m:append(Template(appname .. "/cbi/nodes_value_com"))
22+
2023
-- [[ Haproxy Settings ]]--
2124
s = m:section(TypedSection, "global_haproxy", translate("Basic Settings"))
2225
s.anonymous = true
@@ -115,10 +118,15 @@ o.rmempty = false
115118

116119
---- Node Address
117120
o = s:option(Value, "lbss", translate("Node Address"))
118-
for k, v in pairs(nodes_table) do o:value(v.id, v.remarks) end
121+
o.template = appname .. "/cbi/nodes_value"
122+
o.group = {}
123+
for k, v in pairs(nodes_table) do
124+
o:value(v.id, v.remarks)
125+
o.group[#o.group+1] = (v.group and v.group ~= "") and v.group or translate("default")
126+
end
119127
o.rmempty = false
120128
o.validate = function(self, value)
121-
if not value then return nil end
129+
if not value then return nil, translate("Node address cannot be empty.") end
122130
local t = m:get(value) or nil
123131
if t and t[".type"] == "nodes" then
124132
return value
@@ -129,7 +137,7 @@ o.validate = function(self, value)
129137
if api.is_ipv6addrport(value) then
130138
return value
131139
end
132-
return nil, value
140+
return nil, translate("Not valid IP format, please re-enter!") .. " (IP:Port)"
133141
end
134142

135143
---- Haproxy Port

applications/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,21 @@ o:depends({ [_n("mux")] = true })
730730

731731
o = s:option(Flag, _n("tcp_fast_open"), "TCP " .. translate("Fast Open"))
732732
o.default = 0
733+
o:depends({ [_n("protocol")] = "vmess" })
734+
o:depends({ [_n("protocol")] = "vless" })
735+
o:depends({ [_n("protocol")] = "socks" })
736+
o:depends({ [_n("protocol")] = "shadowsocks" })
737+
o:depends({ [_n("protocol")] = "trojan" })
733738

734739
--[[tcpMptcp]]
735740
o = s:option(Flag, _n("tcpMptcp"), "tcpMptcp", translate("Enable Multipath TCP, need to be enabled in both server and client configuration."))
736741
o.default = 0
737742

743+
o = s:option(Value, _n("preconns"), translate("Pre-connections"), translate("Number of early established connections to reduce latency."))
744+
o.datatype = "uinteger"
745+
o.placeholder = 0
746+
o:depends({ [_n("protocol")] = "vless" })
747+
738748
o = s:option(ListValue, _n("chain_proxy"), translate("Chain Proxy"))
739749
o:value("", translate("Close(Not use)"))
740750
o:value("1", translate("Preproxy Node"))

applications/luci-app-passwall/luasrc/passwall/api.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ function url(...)
289289
end
290290

291291
function trim(s)
292-
local len = #s
293-
local i, j = 1, len
294-
while i <= len and s:byte(i) <= 32 do i = i + 1 end
292+
if type(s) ~= "string" then return "" end
293+
local i, j = 1, #s
294+
while i <= j and s:byte(i) <= 32 do i = i + 1 end
295295
while j >= i and s:byte(j) <= 32 do j = j - 1 end
296296
if i > j then return "" end
297297
return s:sub(i, j)

applications/luci-app-passwall/luasrc/passwall/util_xray.lua

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ function gen_outbound(flag, node, tag, proxy_table)
268268
id = node.uuid,
269269
level = 0,
270270
security = (node.protocol == "vmess") and node.security or nil,
271+
testpre = (node.protocol == "vless") and tonumber(node.preconns) or nil,
271272
encryption = (node.protocol == "vless") and ((node.encryption and node.encryption ~= "") and node.encryption or "none") or nil,
272273
flow = (node.protocol == "vless"
273274
and (node.tls == "1" or (node.encryption and node.encryption ~= "" and node.encryption ~= "none"))
@@ -627,6 +628,7 @@ function gen_config(var)
627628
local dns = nil
628629
local fakedns = nil
629630
local routing = nil
631+
local observatory = nil
630632
local burstObservatory = nil
631633
local strategy = nil
632634
local inbounds = {}
@@ -867,18 +869,23 @@ function gen_config(var)
867869
fallbackTag = fallback_node_tag,
868870
strategy = strategy
869871
})
870-
if _node.balancingStrategy == "leastPing" or _node.balancingStrategy == "leastLoad" or fallback_node_tag then
871-
if not burstObservatory then
872-
burstObservatory = {
873-
subjectSelector = { "blc-" },
874-
pingConfig = {
875-
destination = _node.useCustomProbeUrl and _node.probeUrl or nil,
876-
interval = (api.format_go_time(_node.probeInterval) ~= "0s") and api.format_go_time(_node.probeInterval) or "1m",
877-
sampling = 3,
878-
timeout = "5s"
879-
}
872+
if _node.balancingStrategy == "leastPing" and not observatory then
873+
observatory = {
874+
subjectSelector = { "blc-" },
875+
probeUrl = _node.useCustomProbeUrl and _node.probeUrl or nil,
876+
probeInterval = (api.format_go_time(_node.probeInterval) ~= "0s") and api.format_go_time(_node.probeInterval) or "1m",
877+
enableConcurrency = true
878+
}
879+
elseif _node.balancingStrategy == "leastLoad" and not burstObservatory then
880+
burstObservatory = {
881+
subjectSelector = { "blc-" },
882+
pingConfig = {
883+
destination = _node.useCustomProbeUrl and _node.probeUrl or nil,
884+
interval = (api.format_go_time(_node.probeInterval) ~= "0s") and api.format_go_time(_node.probeInterval) or "1m",
885+
sampling = 3,
886+
timeout = "5s"
880887
}
881-
end
888+
}
882889
end
883890
local inbound_tag = gen_loopback(loopback_tag, loopback_dst)
884891
table.insert(rules, { inboundTag = { inbound_tag }, balancerTag = balancer_tag })
@@ -1397,7 +1404,7 @@ function gen_config(var)
13971404
address = remote_dns_udp_server or remote_dns_tcp_server,
13981405
port = tonumber(remote_dns_udp_port) or tonumber(remote_dns_tcp_port),
13991406
network = remote_dns_udp_server and "udp" or "tcp",
1400-
nonIPQuery = "drop"
1407+
nonIPQuery = "reject"
14011408
}
14021409
})
14031410

@@ -1514,6 +1521,7 @@ function gen_config(var)
15141521
-- 传出连接
15151522
outbounds = outbounds,
15161523
-- 连接观测
1524+
observatory = (not burstObservatory) and observatory or nil,
15171525
burstObservatory = burstObservatory,
15181526
-- 路由
15191527
routing = routing,

applications/luci-app-passwall/luasrc/view/passwall/cbi/nodes_listvalue.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
<div id="<%=cbid%>.panel" class="cbi-listvalue-panel lv-dropdown-panel" style="display:none;">
105105
<!-- 搜索框 -->
106106
<div style="padding:8px;border-bottom:1px solid #f0f0f0;">
107-
<input id="<%=cbid%>.search" class="cbi-input-text lv-dropdown-search" type="text" placeholder="<%:Search nodes...%>" />
107+
<input id="<%=cbid%>.search" class="cbi-input-text lv-dropdown-search" type="text" placeholder="🔍 <%:Search nodes...%>" inputmode="search" enterkeyhint="done" />
108108
</div>
109109
<!-- 列表容器 -->
110110
<div id="<%=cbid%>.list" style="padding:8px;">

applications/luci-app-passwall/luasrc/view/passwall/cbi/nodes_listvalue_com.htm

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
-- Copyright: copyright(c)2025–2027
66
-- Description: Passwall(2) UI template
77
-- It is the common part of the template and cannot be used independently
8-
9-
local api = require "luci.passwall.api"
10-
local appname = api.appname
11-
128
%>
139
<style>
1410
/* 主下拉按钮的下箭头 */
@@ -73,6 +69,18 @@
7369
min-width: 220px;
7470
white-space: nowrap;
7571
}
72+
@media (max-width: 1152px) {
73+
.lv-dropdown-container {
74+
white-space: normal;
75+
}
76+
}
77+
@media (max-width: 600px) {
78+
.lv-dropdown-container {
79+
display: block;
80+
white-space: normal;
81+
}
82+
}
83+
7684
.lv-dropdown-display {
7785
cursor: pointer;
7886
display: inline-flex;
@@ -128,9 +136,6 @@
128136
overflow: hidden;
129137
text-overflow: ellipsis;
130138
text-align: left !important;
131-
}
132-
#cbi-<%=appname%>-socks .td.cbi-value-field > div {
133-
white-space: nowrap;
134139
}
135140
</style>
136141

@@ -257,12 +262,16 @@
257262

258263
const styleNode = document.createElement('style')
259264
const styleNames = ["width", "color", "height", "padding", "margin", "lineHeight", "border", "borderRadius", "minWidth", "minHeight"]
265+
if (styleSelect.borderBottomStyle !== "none") {
266+
styleNames.push("borderBottomWidth", "borderBottomStyle", "borderBottomColor");
267+
}
260268
document.head.appendChild(styleNode)
261269
// trace back from option -> select -> body for background color
270+
const panelRadius = styleSelect.borderRadius;
262271
const optionColor = !lv_isTransparent(styleOption.backgroundColor) ? styleOption.backgroundColor : !lv_isTransparent(styleSelect.backgroundColor) ? styleSelect.backgroundColor : styleBody.backgroundColor
263272
const titleColor = lv_getColorSchema(optionColor) === "light" ? lv_darker(optionColor, 30) : lv_lighter(optionColor, 30)
264273
const selectStyleCSS = [`#${CSS.escape(cbid + ".display")} {`, lv_style2Css(styleSelect, styleNames), lv_style2Css(styleSelect, ["backgroundColor"]), "}"]
265-
const optionStyleCSS = [`#${CSS.escape(cbid + ".panel")} {`, lv_style2Css(styleOption, styleNames), `background-color: ${optionColor};`, "}"]
274+
const optionStyleCSS = [`#${CSS.escape(cbid + ".panel")} {`, lv_style2Css(styleOption, styleNames), `background-color: ${optionColor};`, `border-radius: ${panelRadius};`, "}"]
266275
const titleStyleCSS = [`#${CSS.escape(cbid + ".panel")} .lv-group-title {`, `background-color: ${titleColor} !important;`, "}"]
267276
styleNode.textContent = [].concat(selectStyleCSS, optionStyleCSS, titleStyleCSS).join("\n")
268277
}
@@ -642,6 +651,13 @@
642651
lv_filterList(this.value, cbid, listContainer, hiddenSelect, searchInput);
643652
lv_repositionPanel(panel, display);
644653
});
654+
searchInput.addEventListener('keydown', function(e) {
655+
const isEnter = e.key === "Enter" || e.keyCode === 13;
656+
if (!isEnter) return;
657+
e.stopPropagation();
658+
e.preventDefault();
659+
searchInput.blur();
660+
});
645661

646662
// 切换组
647663
listContainer.querySelectorAll(".lv-group-title").forEach(title => {

applications/luci-app-passwall/luasrc/view/passwall/cbi/nodes_multivalue.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<!-- 搜索框 -->
6868
<input type="text" id="<%=cbid%>.search"
6969
class="mv_search_input cbi-input-text"
70-
placeholder="<%:Search nodes...%>" />
70+
placeholder="🔍 <%:Search nodes...%>" inputmode="search" enterkeyhint="done" />
7171
<!-- 主容器 -->
7272
<div class="mv_list_container">
7373
<ul class="cbi-multi mv_node_list" id="<%=cbid%>.node_list">
@@ -76,7 +76,7 @@
7676
<!-- 组标题 -->
7777
<div class="group-title">
7878
<span id="arrow-<%=self.option%>-<%=idSafe(gname)%>" class="mv-arrow-right"></span>
79-
<b style="margin-left:8px;"><%=gname%></b>
79+
<b style="margin-left:8px;"><%=pcdata(gname)%></b>
8080
<%
8181
local g_selected = 0
8282
for _, it in ipairs(items) do

applications/luci-app-passwall/luasrc/view/passwall/cbi/nodes_multivalue_com.htm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
// 更新总计
152152
const totalSpan = document.getElementById("count-" + opt);
153153
if (totalSpan) {
154-
totalSpan.innerHTML = "<%:Selected:%> <span style='color:red;'>" + checked + " / " + cbs.length + "</span>";
154+
totalSpan.innerHTML = "<%:Selected:%> <span style='color:red;'>" + checked + "/" + cbs.length + "</span>";
155155
}
156156
// 更新每个组计数
157157
nodeList.querySelectorAll(".group-block").forEach(group => {
@@ -268,7 +268,14 @@
268268
window.mv_nodeitem_rendered[cbid] = true;
269269
searchInput.addEventListener("input", function() {
270270
mv_filterGroups(searchInput, opt, nodeList);
271-
})
271+
});
272+
searchInput.addEventListener('keydown', function(e) {
273+
const isEnter = e.key === "Enter" || e.keyCode === 13;
274+
if (!isEnter) return;
275+
e.stopPropagation();
276+
e.preventDefault();
277+
searchInput.blur();
278+
});
272279
// checkbox 改变时更新计数
273280
nodeList.addEventListener("change", () => {
274281
mv_updateCount(opt, nodeList, searchInput);

0 commit comments

Comments
 (0)