diff --git a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js index 46a0ac4..173328c 100644 --- a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js +++ b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/settings.js @@ -197,6 +197,32 @@ return view.extend({ 15 ).show(); + o = s.taboption(tabname, form.Button, '_user_excluded_entries_btn', _('User excluded hostname entries')); + o.inputtitle = _('Edit'); + o.inputstyle = 'edit btn'; + o.description = tools.hostsUserExcludeFN; + o.onclick = () => new tools.fileEditDialog( + tools.hostsUserExcludeFN, + _('User excluded entries'), + _('One hostname per line.
Examples:'), + 'domain.net
sub.domain.com
googlevideo.com
', + 15 + ).show(); + + add_delim(s); + + o = s.taboption(tabname, form.Button, '_ip_exclude_filter_btn', _('Excluded IP entries')); + o.inputtitle = _('Edit'); + o.inputstyle = 'edit btn'; + o.description = tools.iplstExcludeFN; + o.onclick = () => new tools.fileEditDialog( + tools.iplstExcludeFN, + _('Excluded IP filter'), + _('Patterns can be strings or regular expressions. Each pattern in a separate line
Examples:'), + '128.199.0.0/16
34.217.90.52
162.13.190.77
', + 15 + ).show(); + o = s.taboption(tabname, form.Button, '_user_ip_filter_btn', _('User IP entries')); o.inputtitle = _('Edit'); o.inputstyle = 'edit btn'; @@ -209,6 +235,18 @@ return view.extend({ 15 ).show(); + o = s.taboption(tabname, form.Button, '_user_excluded_ip_filter_btn', _('User excluded IP entries')); + o.inputtitle = _('Edit'); + o.inputstyle = 'edit btn'; + o.description = tools.iplstUserExcludeFN; + o.onclick = () => new tools.fileEditDialog( + tools.iplstUserExcludeFN, + _('User excluded IP filter'), + _('Patterns can be strings or regular expressions. Each pattern in a separate line
Examples:'), + '128.199.0.0/16
34.217.90.52
162.13.190.77
', + 15 + ).show(); + let map_promise = m.render(); map_promise.then(node => node.classList.add('fade-in')); return map_promise; diff --git a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js index 57d75c5..61756b1 100644 --- a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js +++ b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js @@ -38,7 +38,10 @@ return baseclass.extend({ appName : 'zapret', execPath : '/opt/zapret/init.d/openwrt/zapret', hostsUserFN : '/opt/zapret/ipset/zapret-hosts-user.txt', + hostsUserExcludeFN: '/opt/zapret/ipset/zapret-hosts-user-exclude.txt', + iplstExcludeFN : '/opt/zapret/ipset/zapret-ip-exclude.txt', iplstUserFN : '/opt/zapret/ipset/zapret-ip-user.txt', + iplstUserExcludeFN: '/opt/zapret/ipset/zapret-ip-user-exclude.txt', infoLabelStarting : '' + _('Starting') + '', infoLabelRunning : '' + _('Enabled') + '',