diff options
-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 |