diff options
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | shorewall-controller.lua | 3 | ||||
-rw-r--r-- | shorewall-logfile-html.lsp | 21 | ||||
-rw-r--r-- | shorewall-model.lua | 11 |
4 files changed, 37 insertions, 1 deletions
@@ -1,12 +1,13 @@ APP_NAME=shorewall PACKAGE=acf-$(APP_NAME) -VERSION=0.1 +VERSION=0.2 APP_DIST=\ shorewall-advanced-html.lsp \ shorewall-check-html.lsp \ shorewall-controller.lua \ shorewall-edit-html.lsp \ + shorewall-logfile-html.lsp \ shorewall-model.lua \ shorewall-read-html.lsp \ shorewall.menu diff --git a/shorewall-controller.lua b/shorewall-controller.lua index febbf12..9e16912 100644 --- a/shorewall-controller.lua +++ b/shorewall-controller.lua @@ -16,6 +16,9 @@ mvc.on_load = function(self, parent) end end +logfile = function (self) + return ( {logfile = self.model:get_logfile(), url = url } ) +end check = function(self) if self.clientdata.cmd == "restart" then diff --git a/shorewall-logfile-html.lsp b/shorewall-logfile-html.lsp new file mode 100644 index 0000000..748bd09 --- /dev/null +++ b/shorewall-logfile-html.lsp @@ -0,0 +1,21 @@ +<? local view = ... ?> +<html> +<body> +<h1>LOGFILE</h1> + +<h2>Details</h2> + +<dt>Logfile</dt> +<dd><?= view.logfile.cmd ?></dd> + +<h2>Content</h2> +<textarea name="" style="width:100%;height:450px;"><? io.write(view.logfile.value) ?></textarea> +</body> +</html> + +<? +--[[ DEBUG INFORMATION +require("debugs") +io.write(debugs.variables(view)) +--]] +?> diff --git a/shorewall-model.lua b/shorewall-model.lua index 10a8092..e97fc4e 100644 --- a/shorewall-model.lua +++ b/shorewall-model.lua @@ -92,6 +92,17 @@ function get_filecontent (self, name) return file_content end +function get_logfile () + local me = {} + local cmdtxt = "cat /var/log/messages | grep Shorewall" + local cmd, error = io.popen(cmdtxt ,r) + local cmdoutput = cmd:read("*a") + cmd:close() + me.value = cmdoutput + me.cmd = cmdtxt + return me +end + function update_filecontent (self, name, modifications) path = baseurl .. name local available_files = get_filelist() |