diff options
Diffstat (limited to 'tinydns-expert-html.lsp')
-rw-r--r-- | tinydns-expert-html.lsp | 73 |
1 files changed, 24 insertions, 49 deletions
diff --git a/tinydns-expert-html.lsp b/tinydns-expert-html.lsp index 825267b..93887dd 100644 --- a/tinydns-expert-html.lsp +++ b/tinydns-expert-html.lsp @@ -1,6 +1,5 @@ -<? local form = ... -require("viewfunctions") -?> +<? local form, viewlibrary = ... ?> +<? require("viewfunctions") ?> <? --[[ DEBUG INFORMATION io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") @@ -9,59 +8,35 @@ io.write("</span>") --]] ?> - -<H1>SYSTEM INFO</H1> +<H1>CONFIGURATION</H1> +<H2>EXPERT CONFIGURATION</H2> +<H3>FILE DETAILS</H3> <DL> <? -local myform = form.status -local tags = { "status", "version", "autostart", } -displayinfo(myform,tags,"viewonly") +displayitem(form.value.filename) +displayitem(form.value.filesize) +displayitem(form.value.mtime) ?> </DL> -<h1>CONFIGURATION</h1> -<h2>Expert config</h2> -<h3>Edit/View existing configfiles</h3> -<TABLE> - <TR style="background:#eee;font-weight:bold;"> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD> - <TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD> - </TR> -<? local myform = form.config ?> -<? for i = 1, table.maxn(myform) do ?> - <TR> - <TD style="padding-right:20px;white-space:nowrap;"><? io.write(html.link{value = "edit?name=" .. myform[i].filename.value , label=myform[i].filename.value }) ?></TD> - <TD style="padding-right:20px;white-space:nowrap;"><? io.write(myform[i].filesize.value or "--") ?></TD> - <TD style="white-space:nowrap;" width="90%"><? io.write(myform[i].mtime.value or "--") ?></TD> - </TR> -<? end ?> -</TABLE> +<H3>FILE CONTENT</H3> +<? if form.descr then ?><P CLASS='descr'><?= string.gsub(form.descr, "\n", "<BR>") ?></P><? end ?> +<? if form.errtxt then ?><P CLASS='error'><?= string.gsub(form.errtxt, "\n", "<BR>") ?></P><? end ?> +<form action="" method="POST"> +<input type="hidden" name="filename" value="<?= form.value.filename.value ?>"> +<textarea name="filecontent"> +<?= form.value.filecontent.value ?> +</textarea> +<? if form.value.filecontent.errtxt then ?><P CLASS='error'><?= string.gsub(form.value.filecontent.errtxt, "\n", "<BR>") ?></P><? end ?> -<h3>Create new configfile</h3> -<form action="<?= form.option.script .. "/" .. form.option.prefix .. - form.option.controller .. "/" .. form.option.action .. - (form.option.extra or "") ?>" method="POST"> -<DL> -<? -local myform = form.create -local tags = { "name", "cmdnew", } -displayinfo(myform,tags) -?> -</DL> +<H2>SAVE AND APPLY ABOVE SETTINGS</H2> +<DL><DT>Save/Apply above settings</DT><DD><input class="submit" type="submit" name="<?= form.option ?>" value="Save"></DD></DL> </form> -<form action="<?= form.option.script .. "/" .. form.option.prefix .. - form.option.controller .. "/" .. form.option.action .. - (form.option.extra or "") ?>" method="POST"> <? --- Management buttons -local myform = form.management -local tags = { "start", "stop", "restart" } -if (myform) then - io.write("<H1>MANAGEMENT</H1>\n<DL>") - displaymanagement(myform,tags) - io.write("</DL>") -end +--[[ 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>") +--]] ?> -</form> |