summaryrefslogtreecommitdiffstats
path: root/dhcp-status-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp-status-html.lsp')
-rw-r--r--dhcp-status-html.lsp36
1 files changed, 36 insertions, 0 deletions
diff --git a/dhcp-status-html.lsp b/dhcp-status-html.lsp
new file mode 100644
index 0000000..183b2bb
--- /dev/null
+++ b/dhcp-status-html.lsp
@@ -0,0 +1,36 @@
+<? local form = ... ?>
+
+<?
+function displayinfo(myform,tags,viewonly)
+ for k,v in pairs(tags) do
+ if (myform[v]) and (myform[v]["value"]) then
+ local val = myform[v]
+ io.write("\t<DT")
+ if (#val.errtxt > 0) then
+ val.class = "error"
+ io.write(" class='error'")
+ end
+ io.write(">" .. val.label .. "</DT>\n")
+ if (viewonly) then
+ io.write("\t\t<DD>" .. val.value .. "\n")
+ else
+ io.write("\t\t<DD>" .. html.form[val.type](val) .. "\n")
+ end
+ 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
+end
+?>
+
+<H1>SYSTEM INFO</H1>
+<DL>
+<?
+local myform = form.info
+local tags = { "status", "version", "autostart", }
+displayinfo(myform,tags,"viewonly")
+?>
+</DL>
+
+