summaryrefslogtreecommitdiffstats
path: root/tinydns-status-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-06-24 15:25:39 +0000
committerTed Trask <ttrask01@yahoo.com>2008-06-24 15:25:39 +0000
commite5b81fd75226b70136264addc95e30cecffce444 (patch)
treecc724394d5202125af7340a256fd5f201af6f6e3 /tinydns-status-html.lsp
parentbc4c53f27f100f3f0280d4d8d5c2d02e4bc3cfd0 (diff)
downloadacf-tinydns-e5b81fd75226b70136264addc95e30cecffce444.tar.bz2
acf-tinydns-e5b81fd75226b70136264addc95e30cecffce444.tar.xz
Updated tinydns as follows: Renames status to view and basicstatus to status. Added ability to view individual config file / domain. Added link from view to edit actual line. Modified view.
Updated jQuery to latest 1.2.6 git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@1253 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'tinydns-status-html.lsp')
-rw-r--r--tinydns-status-html.lsp134
1 files changed, 11 insertions, 123 deletions
diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp
index ca0ddf4..d0eae68 100644
--- a/tinydns-status-html.lsp
+++ b/tinydns-status-html.lsp
@@ -1,128 +1,16 @@
-<? local view, viewlibrary = ...
-require("viewfunctions")
-?>
-
-<script type="text/javascript" src="/js/jquery-latest.js"></script>
-<script type="text/javascript">
- var last_phrase = "";
- function filterPage(){
- var phrase = $("#filter").val();
- if (phrase != last_phrase){
- last_phrase = phrase;
- $("#records li").each(function(){
- var elem = jQuery(this);
- if (elem.text().indexOf(phrase)>=0) {
- elem.show();
- } else {
- elem.hide();
- }
- });
- }
- }
- var filterTimer;
- $(function(){
- $("#filter").keyup(function(){
- window.clearTimeout(filterTimer);
- filterTimer = window.setTimeout("filterPage();",250);
- });
- $("#filter-list").submit(function(){
- return false;
- }).focus();
- });
-</script>
-
-<?
---[[ DEBUG INFORMATION
-io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(view))
-io.write("</span>")
---]]
-?>
-
-<? if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("basicstatus")
-end ?>
+<? local data = ... ?>
+<? require("viewfunctions") ?>
+<? --[[
+io.write(html.cfe_unpack(data))
+--]] ?>
-<H1>PROGRAM SPECIFIC OPTIONS/INFORMATION</H1>
-<H2>Locations</H2>
+<H1>SYSTEM INFO</H1>
<DL>
<?
-if (view) and (view['%']) then
- local val = view['%'] ?>
- <DT<? if (val.errtxt) then io.write(" class='error'") end ?>><?= val.label ?></DT>
-
- <DD>
- <? local currentloc = ""
- for i,loc in ipairs(val) do
- if currentloc ~= loc[1] then ?>
- <IMG SRC='/skins/static/tango/16x16/places/start-here.png' width='16' height='16' alt> <B><?= loc[1] ?></B>
- <? end
- currentloc = loc[1] ?>
- <BR><SPAN STYLE='margin-left:30px;'><?= loc[2] ?></SPAN><BR>
- <? if (loc.errtxt) then ?><P CLASS='error'><?= string.gsub(loc.errtxt, "\n", "<BR>") ?></P><? end ?>
- <? end ?>
- </DD>
-<? end ?>
-</DL>
-
-<?
-local function doListIndents(next, indent)
- local newentry = {}
- for mt in string.gmatch(next, "([^.]+)") do
- table.insert(newentry, mt)
- end
- local revnewentry = {}
- for j=#newentry,1,-1 do
- table.insert(revnewentry, newentry[j])
- end
- local i=1
- while indent[i] and revnewentry[i] == indent[i] do
- i=i+1
- end
- local ending = #indent-(i-1)
- local starting = #newentry-(i-1)
- for j=1,ending do
- io.write("</li></ul>\n")
- end
- for j=1,starting do
- io.write("<ul><li STYLE='margin-left:10px;'><strong>")
- io.write(table.concat(newentry, ".", #newentry-(i+j-2), #newentry))
- io.write("</strong>\n")
- end
- return revnewentry
-end
+displayitem(data.value.status)
+displayitem(data.value.version)
+displayitem(data.value.autostart)
+displayitem(data.value.configdir)
+displayitem(data.value.listen)
?>
-
-<H2>Records</H2>
-<form id="filter-list">Filter: <input name="filter" id="filter" value="" maxlength="30" size="30" type="text"></form>
-<DL id="records">
-<?
-local tags = {".", "&", "=", "+", "@", "'", "^", "C", "Z", ":" }
-for i,entrytype in ipairs(tags) do
- local myview = view[entrytype]
- if (myview) then ?>
- <DT><?= myview.label ?></DT>
- <DD><ul>
- <? local indent = {}
- for j,entry in ipairs(myview) do
- indent = doListIndents(entry[1], indent) ?>
- <ul><li STYLE='margin-left:10px;'><IMG SRC='/skins/static/tango/16x16/devices/computer.png' width='16' height='16'><?= tostring(entry[1]) ?><BR>
- <TABLE STYLE='margin-left:<?= tostring(7-#indent) ?>0px;'>
- <? for k=2,#entry do
- local option = entry[k]
- if (option) and option ~= "" then ?>
- <TR><TD WIDTH='160px' STYLE='border:none;'><?= myview.fieldlabels[k] ?>:</TD>
- <TD STYLE='border:none;'><?= option ?></TD></TR>
- <? end
- end ?>
- </TABLE>
- <? if entry.errtxt then ?>
- <P CLASS='error'><?= string.gsub(entry.errtxt, "\n", "<BR>") ?></P>
- <? end ?>
- </li></ul>
- <? end
- doListIndents("", indent) ?>
- </ul></DD>
- <? end
-end ?>
</DL>