summaryrefslogtreecommitdiffstats
path: root/syslog-status-html.lsp
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-02-01 13:41:30 +0000
committerMika Havela <mika.havela@gmail.com>2008-02-01 13:41:30 +0000
commit1889fca8b509381c749d7e418e92cf809ec8d5ce (patch)
treefba8af3c48ce4792539ab7c9767b2f0624f8486d /syslog-status-html.lsp
parent28ef684f79089fdb764163a02029bab21387c004 (diff)
downloadacf-alpine-baselayout-1889fca8b509381c749d7e418e92cf809ec8d5ce.tar.bz2
acf-alpine-baselayout-1889fca8b509381c749d7e418e92cf809ec8d5ce.tar.xz
Many changes (mostly to use cfe's when sending/receiving things from model/controller/view).
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@676 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'syslog-status-html.lsp')
-rw-r--r--syslog-status-html.lsp54
1 files changed, 23 insertions, 31 deletions
diff --git a/syslog-status-html.lsp b/syslog-status-html.lsp
index d6f5ced..50889f8 100644
--- a/syslog-status-html.lsp
+++ b/syslog-status-html.lsp
@@ -6,47 +6,39 @@ io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
?>
+<?
+function informationform(myform,tags)
+ io.write("<DL>")
+ for k,v in pairs(tags) do
+ if (myform[v]) then
+ local val = myform[v]
+ io.write("\t<DT")
+ if (#val.errtxt > 0) then io.write(" class='error'") end
+ io.write(">" .. val.label .. "</DT>\n")
+
+ io.write("\t\t<DD>" .. val.value .. "\n")
+ if (val.descr) and (#val.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(val.descr, "\n", "<BR>") .. "</P>\n") end
+ if (#val.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(val.errtxt, "\n", "<BR>") .. "</P>\n") end
+ io.write("\t\t</DD>\n")
+ end
+ end
+ io.write("</DL>")
+end
+?>
<H1>SYSTEM INFO</H1>
-<DL>
<?
local myform = form.status
local tags = { "status", "version", }
-
-for k,v in pairs(tags) do
- local val = myform[v]
- io.write("\t<DT")
- if (#val.errtxt > 0) then io.write(" class='error'") end
- io.write(">" .. val.label .. "</DT>\n")
-
- io.write("\t\t<DD>" .. val.value .. "\n")
- if (val.descr) and (#val.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. val.descr .. "</P>\n") end
- if (#val.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. val.errtxt .. "</P>\n") end
- io.write("\t\t</DD>\n")
-
-end ?>
-</DL>
+informationform(myform,tags)
+?>
<H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2>
-<DL>
<?
local myform = form.status
local tags = { "logfile", "remotelogging", }
-
-for k,v in pairs(tags) do
- if (myform[v]) then
- local val = myform[v]
- io.write("\t<DT")
- if (#val.errtxt > 0) then io.write(" class='error'") end
- io.write(">" .. val.label .. "</DT>\n")
-
- io.write("\t\t<DD>" .. val.value .. "\n")
- if (val.descr) and (#val.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. val.descr .. "</P>\n") end
- if (#val.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. val.errtxt .. "</P>\n") end
- io.write("\t\t</DD>\n")
- end
-end ?>
-</DL>
+informationform(myform,tags)
+?>