Add reload service button to ad whitelist
This commit is contained in:
parent
ec749c2373
commit
c988036cad
@ -2,12 +2,17 @@ m = Map("mosdns")
|
|||||||
m.title = translate("MosDNS")
|
m.title = translate("MosDNS")
|
||||||
m.description = translate("MosDNS is a 'programmable' DNS forwarder.")
|
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.addremove = false
|
||||||
s.anonymous = true
|
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 = 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.template = "cbi/tvalue"
|
||||||
config.rows = 25
|
config.rows = 25
|
||||||
|
|
||||||
|
@ -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>"
|
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>"
|
msgstr "<font color=\"ff0000\"><strong>注意!此页的更改仅当 'MosDNS 配置文件选择' 为 '自定义配置' 时才会生效</strong></font>"
|
||||||
|
|
||||||
msgid "<font color=\"ff0000\"><strong>ADblock whitelist.</strong></font>"
|
msgid "<font color=\"ff0000\"><strong>ADblock whitelist only apply to 'Def Config' profiles</strong></font>"
|
||||||
msgstr "<font color=\"ff0000\"><strong>广告过滤白名单</strong></font>"
|
msgstr "<font color=\"ff0000\"><strong>注意!广告过滤白名单仅当 'MosDNS 配置文件选择' 为 '内置预设' 时才会生效</strong></font>"
|
||||||
|
|
||||||
msgid "ADblock whitelist"
|
msgid "ADblock whitelist"
|
||||||
msgstr "白名单"
|
msgstr "白名单"
|
||||||
|
|
||||||
|
msgid "ADblock Whitelist"
|
||||||
|
msgstr "广告过滤白名单"
|
||||||
|
|
||||||
|
msgid "Reload Service"
|
||||||
|
msgstr "重载 MosDNS"
|
||||||
|
|
||||||
|
msgid "Reload service to apply ADblock whitelist"
|
||||||
|
msgstr "重载 MosDNS 服务生效白名单"
|
||||||
|
|
||||||
msgid "Geodata Update"
|
msgid "Geodata Update"
|
||||||
msgstr "数据库更新"
|
msgstr "数据库更新"
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ reload_others() {
|
|||||||
|
|
||||||
reload_service() {
|
reload_service() {
|
||||||
stop
|
stop
|
||||||
sleep 2s
|
sleep 1
|
||||||
echo "MosDNS is restarted!"
|
echo "MosDNS is restarted!"
|
||||||
start
|
start
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user