Add reload service button to ad whitelist

This commit is contained in:
sbwml 2022-04-09 11:22:22 +08:00
parent ec749c2373
commit c988036cad
3 changed files with 19 additions and 5 deletions

View File

@ -2,12 +2,17 @@ m = Map("mosdns")
m.title = translate("MosDNS")
m.description = translate("MosDNS is a 'programmable' DNS forwarder.")
s = m:section(TypedSection, "mosdns")
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.</strong></font>")
config.description = translate("<font color=\"ff0000\"><strong>ADblock whitelist only apply to 'Def Config' profiles.</strong></font>")
config.template = "cbi/tvalue"
config.rows = 25

View File

@ -34,12 +34,21 @@ msgstr "启用 DNS 广告过滤"
msgid "<font color=\"ff0000\"><strong>View the Custom YAML Configuration file used by this MosDNS. You can edit it as you own need.</strong></font>"
msgstr "<font color=\"ff0000\"><strong>注意!此页的更改仅当 'MosDNS 配置文件选择' 为 '自定义配置' 时才会生效</strong></font>"
msgid "<font color=\"ff0000\"><strong>ADblock whitelist.</strong></font>"
msgstr "<font color=\"ff0000\"><strong>广告过滤白名单</strong></font>"
msgid "<font color=\"ff0000\"><strong>ADblock whitelist only apply to 'Def Config' profiles</strong></font>"
msgstr "<font color=\"ff0000\"><strong>注意!广告过滤白名单仅当 'MosDNS 配置文件选择' 为 '内置预设' 时才会生效</strong></font>"
msgid "ADblock whitelist"
msgstr "白名单"
msgid "ADblock Whitelist"
msgstr "广告过滤白名单"
msgid "Reload Service"
msgstr "重载 MosDNS"
msgid "Reload service to apply ADblock whitelist"
msgstr "重载 MosDNS 服务生效白名单"
msgid "Geodata Update"
msgstr "数据库更新"

View File

@ -47,7 +47,7 @@ reload_others() {
reload_service() {
stop
sleep 2s
sleep 1
echo "MosDNS is restarted!"
start
}