summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-10-31 19:18:49 +0000
committerTed Trask <ttrask01@yahoo.com>2015-10-31 19:18:49 +0000
commit24bcb19dff840bbde05d7084c63ca68864c17e00 (patch)
treef23011d6abbf7c4a681ce156836182816f1bf052
parent635346b845020d74a0904dbb45f75557f2f3f7f1 (diff)
downloadacf-openvpn-24bcb19dff840bbde05d7084c63ca68864c17e00.tar.bz2
acf-openvpn-24bcb19dff840bbde05d7084c63ca68864c17e00.tar.xz
Modify logfile to use common view
-rw-r--r--openvpn-controller.lua4
l---------[-rw-r--r--]openvpn-logfile-html.lsp11
-rw-r--r--openvpn-model.lua14
3 files changed, 11 insertions, 18 deletions
diff --git a/openvpn-controller.lua b/openvpn-controller.lua
index 0efa765..96efea9 100644
--- a/openvpn-controller.lua
+++ b/openvpn-controller.lua
@@ -27,8 +27,8 @@ mymodule.statusinfo = function (self)
return self.model.getclientinfo()
end
-mymodule.logfile = function (self)
- return self.model.get_logfile()
+mymodule.logfile = function(self)
+ return self.model.get_logfile(self, self.clientdata)
end
function mymodule.listcerts(self)
diff --git a/openvpn-logfile-html.lsp b/openvpn-logfile-html.lsp
index edb3867..ac8854f 100644..120000
--- a/openvpn-logfile-html.lsp
+++ b/openvpn-logfile-html.lsp
@@ -1,10 +1 @@
-<% local data, viewlibrary = ...
-%>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- local clientdata = {}
- for n,v in pairs(data.value) do
- clientdata[n] = v.value
- end
- viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", clientdata)
-end %>
+../logfile-html.lsp \ No newline at end of file
diff --git a/openvpn-model.lua b/openvpn-model.lua
index 6c9e0c5..7cd780c 100644
--- a/openvpn-model.lua
+++ b/openvpn-model.lua
@@ -186,14 +186,16 @@ function mymodule.get_config()
return cfe({ type="structure", value=config, label="OpenVPN Config" })
end
-function mymodule.get_logfile(f)
+function mymodule.get_logfile(self, clientdata)
+ local retval = cfe({ type="group", value={}, label="Log File Configuration" })
local config = config_content(configfile)
- 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" })
+ if config.log then
+ retval.value.filename = cfe({value=config.log, label="File name"})
+ else
+ retval.value.facility = cfe({value="daemon", label="Syslog Facility"})
+ retval.value.grep = cfe({ value="openvpn", label="Grep" })
end
- return cfe({ type="group", value=value, label="Log file" })
+ return retval
end
function mymodule.get_filecontent()