summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/Makefile4
-rw-r--r--app/logfiles/logfiles-controller.lua33
-rw-r--r--app/logfiles/logfiles-model.lua22
-rw-r--r--app/logfiles/logfiles-read-html.lsp8
-rw-r--r--app/logfiles/logfiles.menu2
-rw-r--r--app/menuhints.menu12
-rw-r--r--www/static/webconf.css18
7 files changed, 93 insertions, 6 deletions
diff --git a/app/Makefile b/app/Makefile
index 4c12bea..0a05980 100644
--- a/app/Makefile
+++ b/app/Makefile
@@ -15,6 +15,10 @@ APP_DIST= acf-util/logon-controller.lua\
welcome-controller.lua\
welcome-html.lsp\
welcome.menu\
+ logfiles/logfiles-controller.lua\
+ logfiles/logfiles-model.lua\
+ logfiles/logfiles-read-html.lsp\
+ logfiles/logfiles.menu\
EXTRA_DIST=README Makefile
DISTFILES=$(APP_DIST) $(EXTRA_DIST)
diff --git a/app/logfiles/logfiles-controller.lua b/app/logfiles/logfiles-controller.lua
new file mode 100644
index 0000000..1770754
--- /dev/null
+++ b/app/logfiles/logfiles-controller.lua
@@ -0,0 +1,33 @@
+module (..., package.seeall)
+
+-- Cause an http redirect to our "read" action
+-- We use the self.conf table because it already has prefix,controller,etc
+-- The redir code is defined in the application error handler (acf-controller)
+local list_redir = function (self)
+ self.conf.action = "read"
+ self.conf.type = "redir"
+ error (self.conf)
+end
+
+mvc={}
+mvc.on_load = function(self, parent)
+ if (self.worker[self.conf.action] == nil ) or ( self.conf.action == "init" ) then
+ self.worker[self.conf.action] = list_redir(self)
+ end
+end
+
+-- Public methods
+
+read = function (self )
+ return ({logfile = self.model:get("/var/log/mini_httpd.log")} )
+end
+
+--update = function (self)
+-- return nil
+--end
+
+--delete = function (self)
+-- return nil
+--end
+
+--create = update
diff --git a/app/logfiles/logfiles-model.lua b/app/logfiles/logfiles-model.lua
new file mode 100644
index 0000000..6198107
--- /dev/null
+++ b/app/logfiles/logfiles-model.lua
@@ -0,0 +1,22 @@
+module (..., package.seeall)
+
+-- no initializer in model - use controller.init for that
+
+local function read_file ( path )
+ local file = io.open(path)
+ if ( file ) then
+ local f = file:read("*a") or "unknown"
+ file:close()
+ return f
+ else
+ return "Cant find '" .. path .. "'"
+ end
+end
+
+get = function (self,path)
+ local file_content = {}
+ file_content = cfe{value=read_file(path), name=path}
+ file_name = cfe{value=path, name=file_name}
+ return file_content, file_name
+end
+
diff --git a/app/logfiles/logfiles-read-html.lsp b/app/logfiles/logfiles-read-html.lsp
new file mode 100644
index 0000000..b8864f8
--- /dev/null
+++ b/app/logfiles/logfiles-read-html.lsp
@@ -0,0 +1,8 @@
+<? local view = ... ?>
+<html>
+<body>
+<h1>Logfile</h1>
+<dt><?= view.logfile.name ?></dt>
+<dd><textarea name="<?= view.logfile.name ?>"><?= view.logfile.value ?></textarea></dd>
+</body>
+</html>
diff --git a/app/logfiles/logfiles.menu b/app/logfiles/logfiles.menu
new file mode 100644
index 0000000..f775cfc
--- /dev/null
+++ b/app/logfiles/logfiles.menu
@@ -0,0 +1,2 @@
+#CAT GROUP/DESC TAB ACTION
+General Logfiles dlogfiles read
diff --git a/app/menuhints.menu b/app/menuhints.menu
index 5d36abb..f145b1f 100644
--- a/app/menuhints.menu
+++ b/app/menuhints.menu
@@ -4,5 +4,13 @@
# That number will override the defaults set here.
# (i.e. Lowest specifically set priority wins)
10Home
-80Setup
-100Test
+
+20Networking
+30Proxies
+40Connectivity
+50Backup/Packages
+60General
+
+100Setup
+110Test
+
diff --git a/www/static/webconf.css b/www/static/webconf.css
index 071d959..e81efe3 100644
--- a/www/static/webconf.css
+++ b/www/static/webconf.css
@@ -83,7 +83,8 @@ pre.code {
color: #33A;
// font-family: Palatino, Times-Roman, Serif;
font-weight: bold;
- margin: 0em 0em 0em 0px;
+ margin: 0px 0px 0px 0px;
+ padding: 0px 0px 0px 0px;
//float: left;
// width: 49%;
}
@@ -276,6 +277,8 @@ pre.code {
font-size: 120%;
text-align: left;
// width: 400px;
+ margin: 0px 0px 0px 0px;
+ padding: 0px 0px 0px 0px;
width: 100%;
background-color: #eee;
border-bottom: 2px solid #aaa;
@@ -338,8 +341,15 @@ pre.code {
#content input, textarea {
float: left;
- background-color: #eee;
- margin-top: -0.3em;
+ width: 600px;
+ background-color: #fff0f0;
+ border: 1px dotted #000;
+// margin-top: 0px;
+ }
+
+#content textarea {
+ height: 300px;
+ border: 1px dotted #000;
}
@@ -364,7 +374,7 @@ pre.code {
border-top: 1px dotted #ccf;
border-bottom: 1px dotted #ccf;
// background-color: #eef;
- width: 20%;
+ width: 150px;
clear: both;
}