From 4fa3fad1139c72acd5051bc562161db06e259f32 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Tue, 26 Feb 2008 10:37:17 +0000 Subject: 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 --- tinydns-status-html.lsp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'tinydns-status-html.lsp') 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 0) then --- val.class = "error" io.write(" class='error'") end io.write(">" .. val.label .. "") @@ -65,7 +64,7 @@ if (myform) and (myform.value) then for k,v in pairs(myform.value) do io.write(" " .. tostring(k) .. "") for kk,vv in pairs(v) do - io.write(tostring("
" .. vv .. "\n")) + io.write(tostring("
" .. vv .. "\n")) end io.write("
") end @@ -74,7 +73,6 @@ if (myform) and (myform.value) then if (#val.errtxt > 0) then io.write("\n\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

") end io.write("\n\t\t") end ---end io.write("") ?> @@ -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 ".. tostring(v["label"]) .. "
") - 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 " .. tostring(v.label) .. "
") io.write("\n\t\t\t") - for i=1,#v do - if (type(v[i]["label"]) == "string") then - io.write("\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t") + for k1,v1 in pairs(v.option) do + if (v1.label) then + io.write("\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t") end end io.write("\n\t\t\t
".. tostring(v[i]["label"]) .. ":".. tostring(v[i]["value"]) .."
".. tostring(v1.label) .. + ":".. tostring(v1.value) .."
") - end +-- end else io.write("\n\t\t\t ".. - tostring(k) .. "
") + tostring(table[k].label) .. "
") recurseoutput(v,cnt) end + end end end ?> -- cgit v1.2.3