summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openvpn-logfile-html.lsp6
-rw-r--r--openvpn-model.lua7
2 files changed, 11 insertions, 2 deletions
diff --git a/openvpn-logfile-html.lsp b/openvpn-logfile-html.lsp
index 16c583a..edb3867 100644
--- a/openvpn-logfile-html.lsp
+++ b/openvpn-logfile-html.lsp
@@ -2,5 +2,9 @@
%>
<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {filename=data.value})
+ local clientdata = {}
+ for n,v in pairs(data.value) do
+ clientdata[n] = v.value
+ end
+ viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", clientdata)
end %>
diff --git a/openvpn-model.lua b/openvpn-model.lua
index b85c4d9..adaee27 100644
--- a/openvpn-model.lua
+++ b/openvpn-model.lua
@@ -188,7 +188,12 @@ end
function mymodule.get_logfile(f)
local config = config_content(configfile)
- return cfe({ value=config.log or "", label="Log file" })
+ local value = {}
+ value.filename = cfe({value=config.log or "/var/log/messages", label="File name"})
+ if not config.log then
+ value.grep = cfe({ value="openvpn", label="Grep" })
+ end
+ return cfe({ value=value, label="Log file" })
end
function mymodule.get_filecontent()