luci-app-adblock: support new workflow 1780/head
authorDirk Brenken <dev@brenken.org>
Sat, 5 May 2018 06:16:40 +0000 (08:16 +0200)
committerDirk Brenken <dev@brenken.org>
Wed, 9 May 2018 11:35:49 +0000 (13:35 +0200)
* adapt Adblock to support the new cbi apply workflow
* tested successfully with old & new workflow

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-adblock/luasrc/model/cbi/adblock/overview_tab.lua

index 3786c7a4e4121375dbe254264f7080ea1925eaa3..ec5a75cefcb8c8a558eeac505e2c74e5c0b57be0 100644 (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