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 116cbda..522e4c7 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 @@ -234,6 +234,18 @@ return view.extend({ tabname = 'blacklist_tab'; s.tab(tabname, _('Blacklist settings')); + o = s.taboption(tabname, form.Button, '_google_entries_btn', _('Google hostname entries')); + o.inputtitle = _('Edit'); + o.inputstyle = 'edit btn'; + o.description = tools.hostsGoogleFN; + o.onclick = () => new tools.fileEditDialog( + tools.hostsGoogleFN, + _('Google hostname entries'), + _('One hostname per line.
Examples:'), + 'youtube.com
googlevideo.com
', + 15 + ).show(); + o = s.taboption(tabname, form.Button, '_user_entries_btn', _('User hostname entries')); o.inputtitle = _('Edit'); o.inputstyle = 'edit btn'; 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 bef477a..b89b033 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 @@ -40,6 +40,7 @@ return baseclass.extend({ syncCfgPath : '/opt/zapret/sync_config.sh', defaultCfgPath : '/opt/zapret/uci-def-cfg.sh', + hostsGoogleFN : '/opt/zapret/ipset/zapret-hosts-google.txt', 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', diff --git a/zapret/Makefile b/zapret/Makefile index 8d82b85..c11debe 100644 --- a/zapret/Makefile +++ b/zapret/Makefile @@ -79,7 +79,7 @@ define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/openwrt/zapret $(1)/etc/init.d/zapret $(INSTALL_CONF) ./config.default $(1)/opt/zapret/config.default - $(INSTALL_CONF) ./ipset/zapret-hosts-user.txt $(1)/opt/zapret/ipset/zapret-hosts-user.txt + $(INSTALL_CONF) ./ipset/zapret-hosts-google.txt $(1)/opt/zapret/ipset/zapret-hosts-google.txt $(INSTALL_CONF) ./ipset/zapret-hosts-user-exclude.txt $(1)/opt/zapret/ipset/zapret-hosts-user-exclude.txt $(INSTALL_CONF) ./ipset/zapret-ip-exclude.txt $(1)/opt/zapret/ipset/zapret-ip-exclude.txt $(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh @@ -126,7 +126,9 @@ if [ -z "$${IPKG_INSTROOT}" ]; then cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}" fi # create empty txt files into ipset directory + [ ! -f "/opt/zapret/ipset/zapret-hosts-google.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-google.txt" #[ ! -f "/opt/zapret/ipset/zapret-hosts-auto.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-auto.txt" + [ ! -f "/opt/zapret/ipset/zapret-hosts-user.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-user.txt" [ ! -f "/opt/zapret/ipset/zapret-hosts-user-ipban.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-user-ipban.txt" #[ ! -f "/opt/zapret/ipset/zapret-ip.txt" ] && touch "/opt/zapret/ipset/zapret-ip.txt" [ ! -f "/opt/zapret/ipset/zapret-ip-user.txt" ] && touch "/opt/zapret/ipset/zapret-ip-user.txt"