Skip to content

Commit

Permalink
fix(generator/node): "Subscription Groups" --> MultiValue at least on…
Browse files Browse the repository at this point in the history
…e value is required

(cherry picked from commit 53af438)
  • Loading branch information
muink committed Jan 7, 2024
1 parent ac44081 commit 44e2a80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions htdocs/luci-static/resources/view/homeproxy/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ return view.extend({
/* Selector config start */
o = s.option(form.MultiValue, 'group', _('Subscription Groups'),
_('List of subscription groups.'));
o.value('null-grp', _('NULL'));
for (var key in args.subs_info)
o.value(key, args.subs_info[key].name || _('Group ') + args.subs_info[key].order);
o.depends('type', 'selector');
Expand Down
16 changes: 9 additions & 7 deletions root/etc/homeproxy/scripts/generate_client.uc
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@ function generate_outbound(node) {

if (node.type in ['selector', 'urltest']) {
let outbounds = [];
for (let grouphash in node.group) {
const output = executeCommand(`/sbin/uci -q show ${shellQuote(uciconfig)} | /bin/grep "\.grouphash='*${shellQuote(grouphash)}'*" | /usr/bin/cut -f2 -d'.'`) || {};
if (!isEmpty(trim(output.stdout)))
for (let order in split(trim(output.stdout), /\n/))
push(outbounds, get_tag(order, 'cfg-' + order + '-out', { "filter_nodes": node.filter_nodes, "filter_keywords": node.filter_keywords }));
if (!(grouphash in groups_tobe_checkedout))
push(groups_tobe_checkedout, grouphash);
if (!('null-grp' in node.group)) {
for (let grouphash in node.group) {
const output = executeCommand(`/sbin/uci -q show ${shellQuote(uciconfig)} | /bin/grep "\.grouphash='*${shellQuote(grouphash)}'*" | /usr/bin/cut -f2 -d'.'`) || {};
if (!isEmpty(trim(output.stdout)))
for (let order in split(trim(output.stdout), /\n/))
push(outbounds, get_tag(order, 'cfg-' + order + '-out', { "filter_nodes": node.filter_nodes, "filter_keywords": node.filter_keywords }));
if (!(grouphash in groups_tobe_checkedout))
push(groups_tobe_checkedout, grouphash);
}
}
for (let order in node.order) {
push(outbounds, get_tag(order, 'cfg-' + order + '-out', { "filter_nodes": node.filter_nodes, "filter_keywords": node.filter_keywords }));
Expand Down

0 comments on commit 44e2a80

Please sign in to comment.