diff --git a/htdocs/luci-static/resources/view/homeproxy/client.js b/htdocs/luci-static/resources/view/homeproxy/client.js index 99364028..152f4f0e 100644 --- a/htdocs/luci-static/resources/view/homeproxy/client.js +++ b/htdocs/luci-static/resources/view/homeproxy/client.js @@ -534,7 +534,7 @@ return view.extend({ delete this.keylist; delete this.vallist; - this.value('null-rule', _('NULL')); + this.value('', _('-- Please choose --')); uci.sections(data[0], 'ruleset', (res) => { if (res.enabled === '1') this.value(res['.name'], res.label); @@ -831,7 +831,7 @@ return view.extend({ delete this.keylist; delete this.vallist; - this.value('null-rule', _('NULL')); + this.value('', _('-- Please choose --')); uci.sections(data[0], 'ruleset', (res) => { if (res.enabled === '1') this.value(res['.name'], res.label); diff --git a/root/etc/homeproxy/scripts/generate_client.uc b/root/etc/homeproxy/scripts/generate_client.uc index 39b78757..1930601e 100755 --- a/root/etc/homeproxy/scripts/generate_client.uc +++ b/root/etc/homeproxy/scripts/generate_client.uc @@ -304,16 +304,10 @@ function get_ruleset(cfg) { if (isEmpty(cfg)) return null; - if (type(cfg) === 'array') { - if ('null-rule' in cfg) - return null; - - let rules = []; - for (let i in cfg) - push(rules, get_ruleset(i)); - return rules; - } else - return 'cfg-' + cfg + '-rule'; + let rules = []; + for (let i in cfg) + push(rules, isEmpty(i) ? null : 'cfg-' + i + '-rule'); + return rules; } /* Config helper end */