luci: try fix balancing_node missing after subscribe

use uci:section '.name' replace '.index' which is actually config index not nodes index
This commit is contained in:
Hugo Zhang 2023-07-24 02:27:32 +08:00 committed by sbwml
parent da0a50a1e4
commit 96cd4d23da

View File

@ -267,8 +267,8 @@ do
--log("刷新负载均衡节点列表") --log("刷新负载均衡节点列表")
uci:foreach(appname, "nodes", function(node2) uci:foreach(appname, "nodes", function(node2)
if node2[".name"] == node[".name"] then if node2[".name"] == node[".name"] then
local index = node2[".index"] local section = uci:section(appname, "nodes", node_id)
uci:set_list(appname, "@nodes[" .. index .. "]", "balancing_node", vv.new_nodes) uci:set_list(appname, section, "balancing_node", vv.new_nodes)
end end
end) end)
end end