luci-app-adblock: support new workflow

* adapt Adblock to support the new cbi apply workflow
* tested successfully with old & new workflow

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken 2018-05-05 08:16:40 +02:00
parent fa2975d7c5
commit 3aae6ce82e

View file

@ -24,8 +24,9 @@ m = Map("adblock", translate("Adblock"),
.. translatef("For further information "
.. "<a href=\"%s\" target=\"_blank\">"
.. "check the online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md"))
m.apply_on_parse = true
function m.on_after_commit(self)
function m.on_apply(self)
luci.sys.call("/etc/init.d/adblock reload >/dev/null 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock"))
end