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 282aba8..afd00f8 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 @@ -191,6 +191,51 @@ return view.extend({ add_param(s, 'NFQWS_OPT_DESYNC_QUIC6'); add_delim(s); add_param(s, 'NFQWS_OPT_DESYNC_QUIC6_SUFFIX'); + + /* AutoHostList settings */ + + tabname = 'autohostlist_tab'; + s.tab(tabname, _('AutoHostList')); + + o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_RETRANS_THRESHOLD', _('RETRANS_THRESHOLD')); + o.rmempty = false; + o.datatype = 'uinteger'; + + o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_FAIL_THRESHOLD', _('FAIL_THRESHOLD')); + o.rmempty = false; + o.datatype = 'uinteger'; + + o = s.taboption(tabname, form.Value, 'AUTOHOSTLIST_FAIL_TIME', _('FAIL_TIME')); + o.rmempty = false; + o.datatype = 'uinteger'; + + o = s.taboption(tabname, form.Button, '_auto_host_btn', _('Auto host list entries')); + o.inputtitle = _('Edit'); + o.inputstyle = 'edit btn'; + o.description = tools.autoHostListFN; + o.onclick = () => new tools.fileEditDialog( + tools.autoHostListFN, + _('Auto host list'), + '', + '', + 15 + ).show(); + + o = s.taboption(tabname, form.Flag, 'AUTOHOSTLIST_DEBUGLOG', _('DEBUGLOG')); + o.rmempty = false; + o.default = 0; + + o = s.taboption(tabname, form.Button, '_auto_host_debug_btn', _('Auto host debug list entries')); + o.inputtitle = _('Edit'); + o.inputstyle = 'edit btn'; + o.description = tools.autoHostListDbgFN; + o.onclick = () => new tools.fileEditDialog( + tools.autoHostListDbgFN, + _('Auto host debug list'), + '', + '', + 15 + ).show(); /* Blacklist settings */ 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 aa52f16..51e88e8 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 @@ -47,6 +47,9 @@ return baseclass.extend({ custFileMax : 4, custFileTemplate : '/opt/zapret/ipset/cust%s.txt', + autoHostListFN : '/opt/zapret/ipset/zapret-hosts-auto.txt', + autoHostListDbgFN : '/opt/zapret/ipset/zapret-hosts-auto-debug.log', + infoLabelRunning : '' + _('Running') + '', infoLabelStarting : '' + _('Starting') + '', infoLabelStopped : '' + _('Stopped') + '', diff --git a/zapret/sync_config.sh b/zapret/sync_config.sh index 7e377d8..462e686 100755 --- a/zapret/sync_config.sh +++ b/zapret/sync_config.sh @@ -110,3 +110,7 @@ sync_param NFQWS_OPT_DESYNC_QUIC_SUFFIX str sync_param NFQWS_OPT_DESYNC_QUIC6 str sync_param NFQWS_OPT_DESYNC_QUIC6_SUFFIX str +sync_param AUTOHOSTLIST_RETRANS_THRESHOLD +sync_param AUTOHOSTLIST_FAIL_THRESHOLD +sync_param AUTOHOSTLIST_FAIL_TIME +sync_param AUTOHOSTLIST_DEBUGLOG diff --git a/zapret/uci-def-cfg.sh b/zapret/uci-def-cfg.sh index 7e64625..fcda5df 100755 --- a/zapret/uci-def-cfg.sh +++ b/zapret/uci-def-cfg.sh @@ -52,6 +52,10 @@ function set_default_values set $cfgname.config.NFQWS_OPT_DESYNC_QUIC_SUFFIX="$TAB" set $cfgname.config.NFQWS_OPT_DESYNC_QUIC6="$TAB" set $cfgname.config.NFQWS_OPT_DESYNC_QUIC6_SUFFIX="$TAB" + set $cfgname.config.AUTOHOSTLIST_RETRANS_THRESHOLD='3' + set $cfgname.config.AUTOHOSTLIST_FAIL_THRESHOLD='3' + set $cfgname.config.AUTOHOSTLIST_FAIL_TIME='60' + set $cfgname.config.AUTOHOSTLIST_DEBUGLOG='0' commit $cfgname EOF return 0