summaryrefslogtreecommitdiffstats
path: root/tinydns-status-html.lsp
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-02-26 10:37:17 +0000
committerMika Havela <mika.havela@gmail.com>2008-02-26 10:37:17 +0000
commit4fa3fad1139c72acd5051bc562161db06e259f32 (patch)
treefc533cf79aa846deff71c25b6dfd91af193f0196 /tinydns-status-html.lsp
parent122904f71112023b7257ac48239271e05b92fe81 (diff)
downloadacf-tinydns-4fa3fad1139c72acd5051bc562161db06e259f32.tar.bz2
acf-tinydns-4fa3fad1139c72acd5051bc562161db06e259f32.tar.xz
Added functionallity for the config-tab. (Now showing current configs).
Editing config is still not possible. git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@768 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'tinydns-status-html.lsp')
-rw-r--r--tinydns-status-html.lsp25
1 files changed, 13 insertions, 12 deletions
diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp
index 37a7c53..5ceb8ea 100644
--- a/tinydns-status-html.lsp
+++ b/tinydns-status-html.lsp
@@ -55,7 +55,6 @@ if (myform) and (myform.value) then
local val = myform
io.write("\n\t<DT")
if (#val.errtxt > 0) then
--- val.class = "error"
io.write(" class='error'")
end
io.write(">" .. val.label .. "</DT>")
@@ -65,7 +64,7 @@ if (myform) and (myform.value) then
for k,v in pairs(myform.value) do
io.write("<IMG SRC='/static/tango/16x16/places/start-here.png' width='16' height='16' alt> <B>" .. tostring(k) .. "</B>")
for kk,vv in pairs(v) do
- io.write(tostring("<BR>" .. vv .. "\n"))
+ io.write(tostring("<BR><SPAN STYLE='margin-left:30px;'>" .. vv .. "</SPAN>\n"))
end
io.write("<BR>")
end
@@ -74,7 +73,6 @@ if (myform) and (myform.value) then
if (#val.errtxt > 0) then io.write("\n\t\t<P CLASS='error'>" .. string.gsub(val.errtxt, "\n", "<BR>") .. "</P>") end
io.write("\n\t\t</DD>")
end
---end
io.write("</DL>")
?>
@@ -84,23 +82,26 @@ local function recurseoutput(table,cnt)
if not (cnt) then cnt=0 end
cnt = cnt + 1
for k,v in pairs(table or {}) do
- if (type(v["name"]) == "string") then
- io.write("\n\t\t\t<IMG SRC='/static/tango/16x16/devices/computer.png' width='16' height='16' alt STYLE='margin-left:"..cnt..
- "0px'><SPAN STYLE=''> ".. tostring(v["label"]) .. "</SPAN><BR>")
- if (#v > 0) then
+ if (table[k].label) then
+ if not (tonumber(k)) or (v.value) then
+-- if v.label then
+ io.write("\n\t\t\t<IMG SRC='/static/tango/16x16/devices/computer.png' width='16' height='16' alt STYLE='margin-left:"..cnt..
+ "0px'><SPAN STYLE=''> " .. tostring(v.label) .. "</SPAN><BR>")
io.write("\n\t\t\t<TABLE STYLE='margin-left:90px;'>")
- for i=1,#v do
- if (type(v[i]["label"]) == "string") then
- io.write("\n\t\t\t\t<TR>\n\t\t\t\t\t<TD WIDTH='160px' STYLE=''>".. tostring(v[i]["label"]) .. ":</TD>\n\t\t\t\t\t<TD>".. tostring(v[i]["value"]) .."</TD>\n\t\t\t\t</TR>")
+ for k1,v1 in pairs(v.option) do
+ if (v1.label) then
+ io.write("\n\t\t\t\t<TR>\n\t\t\t\t\t<TD WIDTH='160px' STYLE=''>".. tostring(v1.label) ..
+ ":</TD>\n\t\t\t\t\t<TD>".. tostring(v1.value) .."</TD>\n\t\t\t\t</TR>")
end
end
io.write("\n\t\t\t</TABLE>")
- end
+-- end
else
io.write("\n\t\t\t<SPAN STYLE='margin-left:"..cnt.."0px;font-weight:bold;'> "..
- tostring(k) .. "</SPAN><BR>")
+ tostring(table[k].label) .. "</SPAN><BR>")
recurseoutput(v,cnt)
end
+ end
end
end
?>