diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-10-31 19:21:40 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-10-31 19:21:40 +0000 |
commit | 27c58808249d14a89dc336294d846ded95b3d262 (patch) | |
tree | b6f23750000ce5ee9381c1dc915b530442a35c27 | |
parent | b1712a70f888a4cf2f766a9c1d051274f9a2a81d (diff) | |
download | acf-postfix-27c58808249d14a89dc336294d846ded95b3d262.tar.bz2 acf-postfix-27c58808249d14a89dc336294d846ded95b3d262.tar.xz |
Modify logfile to get logging info from the config and use common view
-rw-r--r-- | postfix-controller.lua | 4 | ||||
l---------[-rw-r--r--] | postfix-logfile-html.lsp | 7 | ||||
-rw-r--r-- | postfix-model.lua | 16 |
3 files changed, 21 insertions, 6 deletions
diff --git a/postfix-controller.lua b/postfix-controller.lua index 30dc8c9..b96faed 100644 --- a/postfix-controller.lua +++ b/postfix-controller.lua @@ -42,4 +42,8 @@ function mymodule.flushqueue(self) return self.handle_form(self, self.model.getflushqueue, self.model.flushqueue, self.clientdata, "Flush", "Flush Queue") end +function mymodule.logfile(self) + return self.model.get_logfile(self, self.clientdata) +end + return mymodule diff --git a/postfix-logfile-html.lsp b/postfix-logfile-html.lsp index e67975c..ac8854f 100644..120000 --- a/postfix-logfile-html.lsp +++ b/postfix-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="postfix"}) -end %> +../logfile-html.lsp
\ No newline at end of file diff --git a/postfix-model.lua b/postfix-model.lua index 1c71401..8708263 100644 --- a/postfix-model.lua +++ b/postfix-model.lua @@ -193,4 +193,20 @@ function mymodule.flushqueue(self, flush) return flush end +function mymodule.get_logfile(self, clientdata) + local retval = cfe({ type="group", value={}, label="Log File Configuration" }) + retval.value.facility = cfe({value="mail", label="Syslog Facility"}) + retval.value.grep = cfe({ value="postfix", label="Grep" }) + + local config = getconfig() + if config["syslog_facility"] then + retval.value.facility.value = string.lower(config["syslog_facility"]) + end + if config["syslog_name"] then + retval.value.grep.value = config["syslog_name"] + end + + return retval +end + return mymodule |