summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dovecot-controller.lua2
l---------[-rw-r--r--]dovecot-logfile-html.lsp9
-rw-r--r--dovecot-model.lua16
3 files changed, 12 insertions, 15 deletions
diff --git a/dovecot-controller.lua b/dovecot-controller.lua
index de36937..8412cb6 100644
--- a/dovecot-controller.lua
+++ b/dovecot-controller.lua
@@ -19,7 +19,7 @@ function mymodule.expert(self)
end
function mymodule.logfile(self)
- return self.model.get_logfile()
+ return self.model.get_logfile(self, self.clientdata)
end
return mymodule
diff --git a/dovecot-logfile-html.lsp b/dovecot-logfile-html.lsp
index d718396..ac8854f 100644..120000
--- a/dovecot-logfile-html.lsp
+++ b/dovecot-logfile-html.lsp
@@ -1,8 +1 @@
-<% local data, viewlibrary = ...
-%>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- for i,logfile in ipairs(data.value) do
- viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {filename=logfile.path, grep=logfile.grep})
- end
-end %>
+../logfile-html.lsp \ No newline at end of file
diff --git a/dovecot-model.lua b/dovecot-model.lua
index 74aff69..e2cd0f0 100644
--- a/dovecot-model.lua
+++ b/dovecot-model.lua
@@ -46,18 +46,22 @@ function mymodule.get_logfile(f)
config = config or format.parse_ini_file(fs.read_file(configfile) or "", "")
local files = {}
if config and config.log_path then
- files[#files+1] = {path = config.log_path}
+ files[#files+1] = {filename = config.log_path}
end
if config and config.info_log_path then
- files[#files+1] = {path = config.info_log_path}
+ files[#files+1] = {filename = config.info_log_path}
end
- if config and config.log_path then
- files[#files+1] = {path = config.debug_log_path}
+ if config and config.debug_log_path then
+ files[#files+1] = {filename = config.debug_log_path}
end
if 0 == #files then
- files[#files+1] = {path = "/var/log/messages", grep = "dovecot"}
+ if config and config.syslog_facility then
+ files[#files+1] = {facility = config.syslog_facility, grep = "dovecot"}
+ else
+ files[#files+1] = {facility = "mail", grep = "dovecot"}
+ end
end
- return cfe({ value=files, label="DoveCot Log Files" })
+ return cfe({ type="structure", value=files, label="DoveCot Log Files" })
end
return mymodule