diff options
author | Mika Havela <mika.havela@gmail.com> | 2007-12-07 11:08:08 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2007-12-07 11:08:08 +0000 |
commit | 58ddd2daabd9aa1cd43338515a3ab173ee459aca (patch) | |
tree | 3e0fb44f5ab7c73c041f2dd4b772b6e8ad9f8297 | |
parent | 12eb382b05e5d6854230ba4beddb1f741fe950b2 (diff) | |
download | acf-shorewall-58ddd2daabd9aa1cd43338515a3ab173ee459aca.tar.bz2 acf-shorewall-58ddd2daabd9aa1cd43338515a3ab173ee459aca.tar.xz |
Added view-logfile.
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@419 ab2d0c66-481e-0410-8bed-d214d4d58bed
-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() |