From 76b0d74e7bf922b06749927eaca7dafbdd19f8d3 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 8 Dec 2008 16:18:55 +0000 Subject: Modified dnsmasq to add viewleases and logfile. git-svn-id: svn://svn.alpinelinux.org/acf/dnsmasq/trunk@1627 ab2d0c66-481e-0410-8bed-d214d4d58bed --- dnsmasq-controller.lua | 4 ++++ dnsmasq-logfile-html.lsp | 7 +++++++ dnsmasq-model.lua | 4 ++++ dnsmasq-viewleases-html.lsp | 1 + dnsmasq.menu | 3 ++- dnsmasq.roles | 4 ++-- 6 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 dnsmasq-logfile-html.lsp create mode 120000 dnsmasq-viewleases-html.lsp 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 -- cgit v1.2.3