summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-nextdns/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-nextdns/luasrc')
-rw-r--r--applications/luci-app-nextdns/luasrc/controller/nextdns.lua22
-rw-r--r--applications/luci-app-nextdns/luasrc/model/cbi/overview.lua41
-rw-r--r--applications/luci-app-nextdns/luasrc/view/nextdns/logread.htm46
3 files changed, 2 insertions, 107 deletions
diff --git a/applications/luci-app-nextdns/luasrc/controller/nextdns.lua b/applications/luci-app-nextdns/luasrc/controller/nextdns.lua
index 0552981938..bfa4887b03 100644
--- a/applications/luci-app-nextdns/luasrc/controller/nextdns.lua
+++ b/applications/luci-app-nextdns/luasrc/controller/nextdns.lua
@@ -3,30 +3,12 @@
module("luci.controller.nextdns", package.seeall)
-local util = require("luci.util")
-local i18n = require("luci.i18n")
-local templ = require("luci.template")
-local http = require("luci.http")
-
function index()
if not nixio.fs.access("/etc/config/nextdns") then
return
end
entry({"admin", "services", "nextdns"}, firstchild(), _("NextDNS"), 60).dependent = false
- entry({"admin", "services", "nextdns", "overview"}, cbi("overview", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true
- entry({"admin", "services", "nextdns", "log"}, template("nextdns/logread"), _("Logs"), 30).leaf = true
-
- entry({"admin", "services", "nextdns", "logread"}, call("logread"), nil).leaf = true
-
-end
-
-function logread()
- local content = util.trim(util.exec("logread -e 'nextdns'")) or ""
-
- if content == "" then
- content = "No nextdns related logs yet!"
- end
- http.write(content)
+ entry({"admin", "services", "nextdns", "overview"}, view("nextdns/overview"), _("Overview"), 10).leaf = true
+ entry({"admin", "services", "nextdns", "log"}, view("nextdns/logread"), _("Logs"), 30).leaf = true
end
-
diff --git a/applications/luci-app-nextdns/luasrc/model/cbi/overview.lua b/applications/luci-app-nextdns/luasrc/model/cbi/overview.lua
deleted file mode 100644
index a932a85f89..0000000000
--- a/applications/luci-app-nextdns/luasrc/model/cbi/overview.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-local uci = require("luci.model.uci").cursor()
-
-nextdns = Map("nextdns", translate("NextDNS"),
- translate("NextDNS Configuration.")
- .. "<br>"
- .. translatef("For further information, go to "
- .. "<a href=\"https://nextdns.io\" target=\"_blank\">nextdns.io</a>"))
-
-
-function nextdns.on_after_commit(self)
- luci.sys.call("env -i /etc/init.d/nextdns restart >/dev/null 2>&1")
-end
-
-s = nextdns:section(TypedSection, "nextdns", translate("General"))
-s.anonymous = true
-
-enabled = s:option(Flag, "enabled", translate("Enabled"),
- translate("Enable NextDNS."))
-enabled.rmempty = false
-
-conf = s:option(Value, "config", translate("Configuration ID"),
- translate("The ID of your NextDNS configuration.")
- .. "<br>"
- .. translate("Go to nextdns.io to create a configuration."))
-conf.rmempty = false
-
-report_client_info = s:option(Flag, "report_client_info", translate("Report Client Info"),
- translate("Expose LAN clients information in NextDNS analytics."))
-report_client_info.rmempty = false
-
-hardened_privacy = s:option(Flag, "hardened_privacy", translate("Hardened Privacy"),
- translate("When enabled, use DNS servers located in jurisdictions with strong privacy laws.")
- .. "<br>"
- .. translate("Available locations are: Switzerland, Iceland, Finland, Panama and Hong Kong."))
-hardened_privacy.rmempty = false
-
-log_query = s:option(Flag, "log_query", translate("Log Queries"),
- translate("Log individual queries to system log."))
-log_query.rmempty = false
-
-return nextdns
diff --git a/applications/luci-app-nextdns/luasrc/view/nextdns/logread.htm b/applications/luci-app-nextdns/luasrc/view/nextdns/logread.htm
deleted file mode 100644
index 0a98b2704f..0000000000
--- a/applications/luci-app-nextdns/luasrc/view/nextdns/logread.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<%+header%>
-
-<style type="text/css">
- select[readonly],
- textarea[readonly]
- {
- width: 100% !important;
- height: 450px !important;
- border: 1px solid #cccccc;
- padding: 5px;
- font-size: 12px;
- font-family: monospace;
- resize: none;
- pointer-events: auto;
- cursor: auto;
- }
-</style>
-
-<script type="text/javascript">
-//<![CDATA[
- function log_update()
- {
- XHR.poll(-1, '<%=luci.dispatcher.build_url("admin", "services", "nextdns", "logread")%>', null,
- function(x)
- {
- if (!x)
- {
- return;
- }
- var view = document.getElementById("view_id");
- view.value = x.responseText;
- view.scrollTop = view.scrollHeight;
- });
- }
- window.onload = log_update();
-//]]>
-</script>
-
-<div class="cbi-map">
- <div class="cbi-section">
- <div class="cbi-section-descr"><%:The syslog output, pre-filtered for nextdns related messages only.%></div>
- <textarea id="view_id" readonly="readonly" wrap="off" value=""></textarea>
- </div>
-</div>
-
-<%+footer%>