diff --git a/luasrc/model/cbi/mosdns/whitelist.lua b/luasrc/model/cbi/mosdns/whitelist.lua index 645e297..8478051 100644 --- a/luasrc/model/cbi/mosdns/whitelist.lua +++ b/luasrc/model/cbi/mosdns/whitelist.lua @@ -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("ADblock whitelist only apply to 'Def Config' profiles.") 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 diff --git a/po/zh-cn/mosdns.po b/po/zh-cn/mosdns.po index 1fe90d9..a3ba814 100644 --- a/po/zh-cn/mosdns.po +++ b/po/zh-cn/mosdns.po @@ -40,12 +40,6 @@ msgstr "注意!广告过滤白名单仅当 'Mos msgid "ADblock whitelist" msgstr "广告白名单" -msgid "Reload Service" -msgstr "重载 MosDNS" - -msgid "Reload service to apply ADblock whitelist" -msgstr "重载 MosDNS 服务生效白名单" - msgid "Geodata Update" msgstr "数据库更新"