summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-10-31 19:04:15 +0000
committerTed Trask <ttrask01@yahoo.com>2015-10-31 19:04:15 +0000
commit0de33748d6b213e319fd21bd72732fa8a73be61d (patch)
treea95fda3b2b60786295d3c470ecff72135cd94f02
parent3e0ed6b2b499898a7898bca42471c7b81bc39872 (diff)
downloadacf-openntpd-0de33748d6b213e319fd21bd72732fa8a73be61d.tar.bz2
acf-openntpd-0de33748d6b213e319fd21bd72732fa8a73be61d.tar.xz
Modify logfile to use common view
-rw-r--r--openntpd-controller.lua4
l---------[-rw-r--r--]openntpd-logfile-html.lsp7
-rw-r--r--openntpd-model.lua9
3 files changed, 14 insertions, 6 deletions
diff --git a/openntpd-controller.lua b/openntpd-controller.lua
index e1b7ca3..9391df0 100644
--- a/openntpd-controller.lua
+++ b/openntpd-controller.lua
@@ -22,4 +22,8 @@ function mymodule.startstop(self)
return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata)
end
+function mymodule.logfile(self)
+ return self.model.get_logfile(self, self.clientdata)
+end
+
return mymodule
diff --git a/openntpd-logfile-html.lsp b/openntpd-logfile-html.lsp
index 57e315b..ac8854f 100644..120000
--- a/openntpd-logfile-html.lsp
+++ b/openntpd-logfile-html.lsp
@@ -1,6 +1 @@
-<% local data, viewlibrary = ...
-%>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {filename="/var/log/messages", grep="ntpd"})
-end %>
+../logfile-html.lsp \ No newline at end of file
diff --git a/openntpd-model.lua b/openntpd-model.lua
index f5607f5..5aec085 100644
--- a/openntpd-model.lua
+++ b/openntpd-model.lua
@@ -16,6 +16,8 @@ local processname = "ntpd"
local function last_time_change()
local cmdoutput = "(Have no data on updates)"
+ -- This works for busybox syslog, which always logs to /var/log/messages
+ -- FIXME to work with other syslog options
local mess = fs.read_file_as_array("/var/log/messages")
for i=table.maxn(mess),1,-1 do
if string.find(mess[i], "ntpd.*adjusting") then
@@ -162,4 +164,11 @@ function mymodule.update_filedetails(self, filedetails)
return modelfunctions.setfiledetails(self, filedetails, {configfile})
end
+function mymodule.get_logfile(self, clientdata)
+ local retval = cfe({ type="group", value={}, label="Log File Configuration" })
+ retval.value.facility = cfe({value="daemon", label="Syslog Facility"})
+ retval.value.grep = cfe({ value="ntpd", label="Grep" })
+ return retval
+end
+
return mymodule