From 33aa7c46bff9bb6817c7636ecaaa9b7b71b9579f Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 20 Nov 2023 17:49:55 +0800 Subject: [PATCH] chore(generator/client): fix parse any outbound Signed-off-by: Tianling Shen --- htdocs/luci-static/resources/view/homeproxy/client.js | 2 +- root/etc/homeproxy/scripts/generate_client.uc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/luci-static/resources/view/homeproxy/client.js b/htdocs/luci-static/resources/view/homeproxy/client.js index a5921710..9beb3a75 100644 --- a/htdocs/luci-static/resources/view/homeproxy/client.js +++ b/htdocs/luci-static/resources/view/homeproxy/client.js @@ -794,7 +794,7 @@ return view.extend({ delete this.keylist; delete this.vallist; - this.value('any', _('Any')); + this.value('any-out', _('Any')); this.value('direct-out', _('Direct')); this.value('block-out', _('Block')); uci.sections(data[0], 'routing_node', (res) => { diff --git a/root/etc/homeproxy/scripts/generate_client.uc b/root/etc/homeproxy/scripts/generate_client.uc index 057e1bde..3e323a81 100755 --- a/root/etc/homeproxy/scripts/generate_client.uc +++ b/root/etc/homeproxy/scripts/generate_client.uc @@ -244,12 +244,15 @@ function get_outbound(cfg) { return null; if (type(cfg) === 'array') { + if ('any-out' in cfg) + return 'any'; + let outbounds = []; for (let i in cfg) push(outbounds, get_outbound(i)); return outbounds; } else { - if (cfg in ['any', 'direct-out', 'block-out']) { + if (cfg in ['direct-out', 'block-out']) { return cfg; } else { const node = uci.get(uciconfig, cfg, 'node');