From 58ddd2daabd9aa1cd43338515a3ab173ee459aca Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 7 Dec 2007 11:08:08 +0000 Subject: Added view-logfile. git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@419 ab2d0c66-481e-0410-8bed-d214d4d58bed --- Makefile | 3 ++- shorewall-controller.lua | 3 +++ shorewall-logfile-html.lsp | 21 +++++++++++++++++++++ shorewall-model.lua | 11 +++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 shorewall-logfile-html.lsp diff --git a/Makefile b/Makefile index a1dcfda..fc287e6 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ + + + +

LOGFILE

+ +

Details

+ +
Logfile
+
+ +

Content

+ + + + + 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() -- cgit v1.2.3