summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dnsmasq-controller.lua4
-rw-r--r--dnsmasq-logfile-html.lsp7
-rw-r--r--dnsmasq-model.lua4
l---------dnsmasq-viewleases-html.lsp1
-rw-r--r--dnsmasq.menu3
-rw-r--r--dnsmasq.roles4
6 files changed, 20 insertions, 3 deletions
diff --git a/dnsmasq-controller.lua b/dnsmasq-controller.lua
index c2b2e7e..c2eaa5d 100644
--- a/dnsmasq-controller.lua
+++ b/dnsmasq-controller.lua
@@ -21,3 +21,7 @@ function expert(self)
return controllerfunctions.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Config File", "Configuration File Set")
end
+function viewleases(self)
+ return self.model.getleases()
+end
+
diff --git a/dnsmasq-logfile-html.lsp b/dnsmasq-logfile-html.lsp
new file mode 100644
index 0000000..099d6ae
--- /dev/null
+++ b/dnsmasq-logfile-html.lsp
@@ -0,0 +1,7 @@
+<% local data, viewlibrary = ...
+require("viewfunctions")
+%>
+
+<% if viewlibrary and viewlibrary.dispatch_component then
+ viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {name="/var/log/messages", grep="dnsmasq"})
+end %>
diff --git a/dnsmasq-model.lua b/dnsmasq-model.lua
index dbd600a..519fa89 100644
--- a/dnsmasq-model.lua
+++ b/dnsmasq-model.lua
@@ -10,6 +10,7 @@ require("validator")
local configfile = "/etc/dnsmasq.conf"
local processname = "dnsmasq"
local packagename = "dnsmasq"
+local leasefile = "/var/lib/misc/dnsmasq.leases"
-- ################################################################################
-- LOCAL FUNCTIONS
@@ -231,3 +232,6 @@ function setconfigfile(filedetails)
return modelfunctions.setfiledetails(filedetails, {configfile})
end
+function getleases()
+ return modelfunctions.getfiledetails(leasefile)
+end
diff --git a/dnsmasq-viewleases-html.lsp b/dnsmasq-viewleases-html.lsp
new file mode 120000
index 0000000..15b1930
--- /dev/null
+++ b/dnsmasq-viewleases-html.lsp
@@ -0,0 +1 @@
+../filedetails-html.lsp \ No newline at end of file
diff --git a/dnsmasq.menu b/dnsmasq.menu
index a4f1ca9..a754507 100644
--- a/dnsmasq.menu
+++ b/dnsmasq.menu
@@ -1,5 +1,6 @@
#CAT GROUP/DESC TAB ACTION
Networking 13DNSmasq Status status
Networking 13DNSmasq Config config
+Networking 13DNSmasq View_Leases viewleases
Networking 13DNSmasq Expert expert
-
+Networking 13DNSmasq Logfile logfile
diff --git a/dnsmasq.roles b/dnsmasq.roles
index 53ac32e..1a44c99 100644
--- a/dnsmasq.roles
+++ b/dnsmasq.roles
@@ -1,4 +1,4 @@
-USER=dnsmasq:status,dnsmasq:startstop
+USER=dnsmasq:status,dnsmasq:startstop,dnsmasq:viewleases,dnsmasq:logfile
EDITOR=dnsmasq:config
EXPERT=dnsmasq:expert
-ADMIN=dnsmasq:status,dnsmasq:startstop,dnsmasq:config,dnsmasq:expert
+ADMIN=dnsmasq:status,dnsmasq:startstop,dnsmasq:viewleases,dnsmasq:logfile,dnsmasq:config,dnsmasq:expert