update 05-02 07:46:17

This commit is contained in:
github-actions[bot] 2022-05-02 07:46:17 +08:00
parent 1aee447574
commit 48b94570c8
6 changed files with 8 additions and 19 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-dnsfilter
PKG_VERSION:=1.0
PKG_RELEASE:=12
PKG_RELEASE:=13
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=small_5 kiddin9

View File

@ -1,4 +1,4 @@
module("luci.controller.dnsfilter",package.seeall)
module("luci.controller.dnsfilter", package.seeall)
function index()
if not nixio.fs.access("/etc/config/dnsfilter") then

View File

@ -52,24 +52,24 @@ o.description = translate("Should be enabled when rules addresses are slow to do
o.rmempty = false
o.default = 0
if tmp_rule==1 then
if tmp_rule == 1 then
o = s:option(Button, "delete", translate("Delete All Subscribe Rules"))
o.inputstyle = "reset"
o.description = translate("Delete rules files and delete the subscription link<br/>There is no need to click for modify the subscription link,The script will automatically replace the old rule file")
o.write = function()
SYS.exec("[ -d /etc/dnsfilter/rules ] && rm -rf /etc/dnsfilter/rules")
SYS.exec("grep -wq 'list url' /etc/config/dnsfilter && sed -i '/list url/d' /etc/config/dnsfilter && /etc/init.d/dnsfilter restart 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin","services","dnsfilter","base"))
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "dnsfilter", "base"))
end
end
if luci.sys.call("[ -h /tmp/dnsfilter/url ] || exit 9")==9 then
if luci.sys.call("[ -h /tmp/dnsfilter/url ] || exit 9") == 9 then
if nixio.fs.access("/etc/dnsfilter/rules") then
o = s:option(Button, "delete_1", translate("Delete Subscribe Rules On The Flash"))
o.inputstyle = "reset"
o.write = function()
SYS.exec("rm -rf /etc/dnsfilter/rules")
luci.http.redirect(luci.dispatcher.build_url("admin","services","dnsfilter","base"))
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "dnsfilter", "base"))
end
end
end

View File

@ -4,7 +4,7 @@ local conffile = "/etc/dnsfilter/black.list"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows=13
t.rows = 13
t.description = translate("Will Always block these Domain")
function t.cfgvalue()

View File

@ -4,7 +4,7 @@ local conffile = "/etc/dnsfilter/ip.list"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows=13
t.rows = 13
t.description = translate("Will Always block these IP")
function t.cfgvalue()

View File

@ -1,11 +0,0 @@
{
"luci-app-dnsfilter": {
"description": "Grant UCI access for luci-app-dnsfilter",
"read": {
"uci": [ "dnsfilter" ]
},
"write": {
"uci": [ "dnsfilter" ]
}
}
}