v1.2. BYPASS_IP

This commit is contained in:
gSpot
2023-07-18 16:25:52 +03:00
parent 92b5cf247e
commit ce79a1f469
13 changed files with 88 additions and 21 deletions
@@ -47,6 +47,7 @@ return view.extend({
if(data.rules.nftables && data.rules.nftables.length > 1) {
for(let i of data.rules.nftables) {
if(!i.rule) continue;
let set, bytes;
i.rule.expr.forEach(e => {
if(e.match) {
@@ -262,12 +263,15 @@ return view.extend({
]);
for(let [set, bytes] of nft_data.rules) {
if(!set) {
continue;
};
table_rules.append(
E('tr', { 'class': 'tr' }, [
E('td',{
'class' : 'td left',
'data-title': _('Match-set'),
}, set + ' (' + set.replace(/^c/, 'CIDR').replace(/^i/, 'IP').replace(/^d/, 'dnsmasq') + ')'),
}, set + ((set.length == 1) ? (' (' + set.replace(/^c/, 'CIDR').replace(/^i/, 'IP').replace(/^d/, 'dnsmasq') + ')') : '')),
E('td', {
'class' : 'td left',
'id' : 'rules.' + set,
@@ -249,6 +249,17 @@ return view.extend({
bllist_module.value('', _('disabled'));
bllist_module.depends({ bllist_preset: new RegExp('^($|' + tools.appName + ')'), '!reverse': true });
// BYPASS_IP_MODE
o = s.taboption('blacklist_tab', form.Flag, 'bypass_ip_mode',
_('Enable IP exclusion list'), _("List of IP addresses that are excluded from block bypass (always available directly)"));
o.rmempty = false;
o.default = 0;
// BYPASS_IP_LIST
o = s.taboption('blacklist_tab', form.DynamicList, 'bypass_ip_list',
_('IP exclusion list'));
o.datatype = "ip4addr";
Object.entries(this.parsers).forEach(
e => bllist_module.value(e[1], e[0]));