diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-02-26 10:37:17 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-02-26 10:37:17 +0000 |
commit | 4fa3fad1139c72acd5051bc562161db06e259f32 (patch) | |
tree | fc533cf79aa846deff71c25b6dfd91af193f0196 /tinydns-config-html.lsp | |
parent | 122904f71112023b7257ac48239271e05b92fe81 (diff) | |
download | acf-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-config-html.lsp')
-rwxr-xr-x | tinydns-config-html.lsp | 82 |
1 files changed, 51 insertions, 31 deletions
diff --git a/tinydns-config-html.lsp b/tinydns-config-html.lsp index b3f9053..49cfa8c 100755 --- a/tinydns-config-html.lsp +++ b/tinydns-config-html.lsp @@ -43,53 +43,73 @@ displayinfo(myform,tags,"viewonly") <H2>General settings</H2> <? local myform = form.config -local tags = { "listen", } +local tags = { "listen","cmdeditlisten", } displayinfo(myform,tags) ?> <H2>Locations</H2> -<? -local v = "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] - io.write("\t<DT") - if (#val.errtxt > 0) then - val.class = "error" - io.write(" class='error'") - end - io.write(">" .. val.label .. "</DT>\n") - +<? +local tags = { "locations","cmdeditlocations", "cmdnewlocations", } +displayinfo(myform,tags) +?> - 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") - end - io.write("<BR>") - 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 -io.write("</DL>") +<H2>Records</H2> +<H3><? io.write(tostring(form.config.nsourdomain.label) or "NS record") ?></H3> +<? +local tags = { "nsourdomain","cmdeditnsourdomain", } +displayinfo(myform,tags) ?> +<H3><? io.write(tostring(form.config.nsdomain.label) or "NS record") ?></H3> +<? +local tags = { "nsdomain","cmdeditnsdomain", } +displayinfo(myform,tags) +?> +<H3><? io.write(tostring(form.config.host.label) or "Hosts record") ?></H3> +<? +local tags = { "host","cmdedithost", } +displayinfo(myform,tags) +?> +<H3><? io.write(tostring(form.config.alias.label) or "Alias record") ?></H3> +<? +local tags = { "alias","cmdeditalias", } +displayinfo(myform,tags) +?> +<H3><? io.write(tostring(form.config.mx.label) or "MX record") ?></H3> +<? +local tags = { "mx","cmdeditmx", } +displayinfo(myform,tags) +?> +<H3><? io.write(tostring(form.config.ptr.label) or "PTR record") ?></H3> +<? +local tags = { "ptr","cmdeditptr", } +displayinfo(myform,tags) +?> +<H3><? io.write(tostring(form.config.cname.label) or "CNAME record") ?></H3> +<? +local tags = { "cname","cmdeditcname", } +displayinfo(myform,tags) +?> +<H3><? io.write(tostring(form.config.soa.label) or "SOA record") ?></H3> +<? +local tags = { "soa","cmdeditsoa", } +displayinfo(myform,tags) +?> +<H3><? io.write(tostring(form.config.generic.label) or "GENERIC record") ?></H3> +<? +local tags = { "generic","cmdeditgeneric", } +displayinfo(myform,tags) +?> - -<? ---[[ ?> +<? --[[ ?> <H1>DEGUGGING</H1> <? local myform = form.debug |