diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-02-22 10:52:11 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-02-22 10:52:11 +0000 |
commit | 9c87ef46027f223be76d19ba0339f37c35ce23a5 (patch) | |
tree | 553ef372b50bff370866387c5a3f8d2b27816c1b /tinydns-status-html.lsp | |
parent | 335d503c6f8c54ab66a02fc8454525b628bb9255 (diff) | |
download | acf-tinydns-9c87ef46027f223be76d19ba0339f37c35ce23a5.tar.bz2 acf-tinydns-9c87ef46027f223be76d19ba0339f37c35ce23a5.tar.xz |
Temporary save. Things are far from working
git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@764 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'tinydns-status-html.lsp')
-rw-r--r-- | tinydns-status-html.lsp | 130 |
1 files changed, 102 insertions, 28 deletions
diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp index 27fe91a..5d5bd1d 100644 --- a/tinydns-status-html.lsp +++ b/tinydns-status-html.lsp @@ -1,6 +1,6 @@ <? local form = ... ?> <? ---[[ DEBUG INFORMATION +---[[ DEBUG INFORMATION io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") io.write(html.cfe_unpack(form)) io.write("</span>") @@ -41,25 +41,25 @@ displayinfo(myform,tags,"viewonly") <H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2> <? -local v = "locations" +local myform = form.status.locations --displayinfo(myform,tags) io.write("<DL>") --for k,v in pairs(tags) do -if (myform[v]) and (myform[v]["value"]) then - local val = myform[v] +if (myform) and (myform.value) then + local val = myform io.write("\t<DT") if (#val.errtxt > 0) then - val.class = "error" +-- val.class = "error" io.write(" class='error'") end io.write(">" .. val.label .. "</DT>\n") io.write("\t\t<DD>\n") - for k,v in pairs(myform[v]["value"]) do + 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.option[3]).. "\n") + io.write(tostring("<BR>" .. vv .. "\n")) end io.write("<BR>") end @@ -72,37 +72,111 @@ end io.write("</DL>") ?> + <? -local v = "types" ---displayinfo(myform,tags) -io.write("<DL>") ---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'") +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) == "string") then + io.write("<IMG SRC='/static/tango/16x16/devices/computer.png' width='16' height='16' alt STYLE='margin-left:"..cnt.."0px'> ".. + tostring(v) .. "</SPAN><BR>") + else + io.write("<SPAN STYLE='margin-left:"..cnt.."0px;font-wegith:strong;'> ".. + tostring(k) .. "</SPAN><BR>") + recurseoutput(v,cnt) + end end - io.write(">" .. val.label .. "</DT>\n") - +end +?> +<? +local myform = form.status.domains +if (myform) and (myform.value) then + io.write("\t<DT") + io.write(">" .. myform.label .. "</DT>\n") io.write("\t\t<DD>\n") - for k,v in pairs(myform[v]["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.option[3]).. "\n") + + for k,v in pairs(myform.value) do + recurseoutput(v) + end + +--[[ +local function recursedir(path, filearray) + local k,v + for k,v in pairs(posix.dir(path) or {}) do + -- Ignore files that begins with a '.' + if not string.match(v, "^%.") then + local f = path .. "/" .. v + -- If subfolder exists, list files in this subfolder + if (posix.stat(f).type == "directory") then + recursedir(f, filearray) + else + table.insert(filearray, f) + end end - io.write("<BR>") end +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") +--[[ + local output = k + io.write("<SPAN STYLE='margin-left:10px;font-weight:bold;'>".. k .. "</SPAN><BR>") + if (#v == 0) then + for k1,v1 in pairs(v) do + output = k1 .. "." .. output + io.write("<SPAN STYLE='margin-left:20px;font-weight:normal;font-weight:bold;'>".. output .. "</SPAN><BR>") + if (#v1 == 0) then + for k2,v2 in pairs(v1) do + output = k2 .. "." .. output + io.write("<SPAN STYLE='margin-left:30px;font-weight:normal;font-weight:bold;'>".. output .. "</SPAN><BR>") + if (#v2 == 0) then + for k3,v3 in pairs(v2) do + output = k3 .. "." .. output + io.write("<SPAN STYLE='margin-left:40px;font-weight:normal;font-weight:bold;'>".. output .. "</SPAN><BR>") + if (#v3 == 0) then + for k4,v4 in pairs(v3) do + output = k4 .. "." .. output + io.write("<SPAN STYLE='margin-left:50px;font-weight:normal;font-weight:bold;'>".. output .. "</SPAN><BR>") + if (#v4 == 0) then + for k5,v5 in pairs(v4) do + output = k5 .. "." .. output + io.write("<SPAN STYLE='margin-left:60px;font-weight:normal;font-weight:bold;'>".. output .. "</SPAN><BR>") + if (#v5 == 0) then + for k6,v6 in pairs(v5) do + output = k6 .. "." .. output + io.write("<SPAN STYLE='margin-left:70px;font-weight:normal;font-weight:bold;'>".. output .. "</SPAN><BR>") + end + else + computer(output,7) + end + end + else + computer(output,6) + end + end + else + computer(output,5) + end + end + else + computer(output,5) + end + end + else + computer(output,5) + end + end + else + computer(output,4) + end + end + --]] end ---end io.write("</DL>") +--]==] ?> + <? --[[ DEBUG INFORMATION io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") |