summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-adblock/luasrc/controller
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2016-02-16 22:28:46 +0200
committerHannu Nyman <hannu.nyman@iki.fi>2016-02-16 22:28:46 +0200
commit21bf16ce04adaaa28811f96f4b29d6dc74c36ae6 (patch)
tree7ada9d18d8f3190e0859c6ee51bf9814dd8f22c0 /applications/luci-app-adblock/luasrc/controller
parenta860de860ad8c15d1717f317c91c2e9168260a4f (diff)
luci-app-adblock: User interface for the 'adblock' package
Simple user interface for the 'adblock' package from packages feed. Adds 'Adblock' item to the Services menu in LuCI. Allows enabling/disabling the service and selecting blocklists. Configuration of the blocklist URLs and selection of Shalla categories needs to be done manually to the config file, if needed. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'applications/luci-app-adblock/luasrc/controller')
-rw-r--r--applications/luci-app-adblock/luasrc/controller/adblock.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua
new file mode 100644
index 0000000000..d8b471814f
--- /dev/null
+++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua
@@ -0,0 +1,12 @@
+-- Copyright 2016 Openwrt.org
+-- Licensed to the public under the Apache License 2.0.
+
+module("luci.controller.adblock", package.seeall)
+
+function index()
+ if not nixio.fs.access("/etc/config/adblock") then
+ return
+ end
+
+ entry({"admin", "services", "adblock"}, cbi("adblock"), _("Adblock"), 40)
+end