Auto take effect ADWhitelist

This commit is contained in:
sbwml 2022-04-09 17:50:17 +08:00
parent 6dad70aaa8
commit 08359466a7
2 changed files with 5 additions and 11 deletions

View File

@ -4,11 +4,6 @@ s = m:section(TypedSection, "mosdns", translate("ADblock whitelist"))
s.addremove = false
s.anonymous = true
reload_service = s:option( Button, "_reload", translate("Reload Service"), translate("Reload service to apply ADblock whitelist"))
reload_service.write = function()
luci.sys.exec("/etc/init.d/mosdns reload")
end
config = s:option(TextValue, "whitelist")
config.description = translate("<font color=\"ff0000\"><strong>ADblock whitelist only apply to 'Def Config' profiles.</strong></font>")
config.template = "cbi/tvalue"
@ -23,4 +18,9 @@ function config.write(self, section, value)
nixio.fs.writefile("/etc/mosdns/whitelist.txt", value)
end
local apply = luci.http.formvalue("cbi.apply")
if apply then
luci.sys.exec("/etc/init.d/mosdns reload")
end
return m

View File

@ -40,12 +40,6 @@ msgstr "<font color=\"ff0000\"><strong>注意!广告过滤白名单仅当 'Mos
msgid "ADblock whitelist"
msgstr "广告白名单"
msgid "Reload Service"
msgstr "重载 MosDNS"
msgid "Reload service to apply ADblock whitelist"
msgstr "重载 MosDNS 服务生效白名单"
msgid "Geodata Update"
msgstr "数据库更新"