diff options
-rw-r--r-- | tinydns-edit-html.lsp | 21 | ||||
-rw-r--r-- | tinydns-listfiles-html.lsp | 11 | ||||
-rw-r--r-- | tinydns-model.lua | 4 |
3 files changed, 17 insertions, 19 deletions
diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index 785589a..4361b8f 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -9,6 +9,9 @@ <a href="javascript:;"><img src="/skins/static/tango/16x16/actions/list-remove.png" width="16" height="16" title="Remove record"></a> \ <a href="javascript:;"><img src="/skins/static/tango/16x16/actions/document-properties.png" width="16" height="16" title="Edit record"></a> \ </td>'; + var addEntry = '<tr><td> \ + <a href="javascript:;"><img src="/skins/static/tango/16x16/actions/list-add.png" width="16" height="16" title="Insert record"></a> \ + </td></tr>'; function Entry(entryType,descr,num,descr0,descr1,descr2,descr3,descr4,descr5,descr6,descr7,descr8,descr9,descr10){ this.entryType=entryType; @@ -17,7 +20,7 @@ this.descriptions[0]=descr0;this.descriptions[1]=descr1;this.descriptions[2]=descr2;this.descriptions[3]=descr3;this.descriptions[4]=descr4;this.descriptions[5]=descr5;this.descriptions[6]=descr6;this.descriptions[7]=descr7;this.descriptions[8]=descr8;this.descriptions[9]=descr9;this.descriptions[10]=descr10; } - var entryTypes = new Array(12); + var entryTypes = new Array(14); entryTypes[0]=new Entry("","Comment line",1,"Comment"); entryTypes[1]=new Entry(".","Name server",6,"Domain","IP address","Name server","Time to live","Timestamp","Location"); entryTypes[2]=new Entry("&","Delegate subdomain",6,"Domain","IP address","Name server","Time to live","Timestamp","Location"); @@ -30,6 +33,8 @@ entryTypes[9]=new Entry("Z","SOA record",11,"Domain","Primary name server","Contact address","Serial number","Refresh time","Retry time","Expire time","Minimum time","Time to live","Timestamp","Location"); entryTypes[10]=new Entry(":","Generic record",6,"Domain","Record type","Record data","Time to live","Timestamp","Location"); entryTypes[11]=new Entry("%","Client location",2,"Location","IP prefix"); + entryTypes[12]=new Entry("S","Service location",8,"Domain", "IP address", "X", "Port", "Weight", "Priority", "Time to live", "Timestamp"); + entryTypes[13]=new Entry("N","Naming authority pointer",9,"Domain", "Order", "Preference", "Flags", "Service", "Regular expression", "Replacement", "Time to live", "Timestamp"); function finishForm(entry){ var entrytext = entry.find("select").val() + entry.find("input:not(.submit)").map(function(){ @@ -50,7 +55,7 @@ var form = '<select>'; var typechar = entrytext.charAt(0); if (typechar === null) { typechar = ""; } - for (i=0; i<12; i++) { + for (i=0; i<14; i++) { form = form + '<option '; if (typechar == entryTypes[i].entryType){ entryType=entryTypes[i]; @@ -74,7 +79,6 @@ else form = form + '<dt>' + entryType.descriptions[i] + '</dt><dd><input type="text" value="' + entries[i] + '"></dd>'; } - form = form + '\n<DT></DT><DD><input class="submit" type="submit" value="<%= html.html_escape(form.option) %>"></DD>'; form = form + "\n</dl>"; entry.empty().append(form); entry.find("select").change(function(){ @@ -128,6 +132,7 @@ $(function(){ addLinks($("#entries").find("tr")); + $("#entries").append(addEntry).find("a").click(addLine); $("input.submit").click(submitFile); <% if form.value.filecontent.linenumber then %> $("#entries tr:eq(<%= form.value.filecontent.linenumber - 1 %>)").find("a:eq(2)").click(); @@ -137,14 +142,6 @@ }); </script> -<% ---[[ 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>") ---]] -%> - <H1>Configuration</H1> <H2>Expert Configuration</H2> <H3>File Details</H3> @@ -160,7 +157,7 @@ displayitem(form.value.mtime) <% if form.descr then %><P CLASS='descr'><%= string.gsub(html.html_escape(form.descr), "\n", "<BR>") %></P><% end %> <% if form.errtxt then %><P CLASS='error'><%= string.gsub(html.html_escape(form.errtxt), "\n", "<BR>") %></P><% end %> <TABLE id="entries"> -<% for line in string.gmatch(html.html_escape(form.value.filecontent.value).."\n", "([^\n]*)\n") do %> +<% for line in string.gmatch(html.html_escape(form.value.filecontent.value), "([^\n]*)\n?") do %> <TR> <TD><%= line %></TD> </TR> diff --git a/tinydns-listfiles-html.lsp b/tinydns-listfiles-html.lsp index 14f8419..8cf7656 100644 --- a/tinydns-listfiles-html.lsp +++ b/tinydns-listfiles-html.lsp @@ -1,13 +1,6 @@ <% local form, viewlibrary, page_info, session = ... require("viewfunctions") %> -<% ---[[ 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>") ---]] -%> <% displaycommandresults({"delete", "edit", "editfile"}, session) %> <% displaycommandresults({"newfile"}, session, true) %> @@ -45,3 +38,7 @@ io.write("</span>") newfileform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/newfile" displayform(newfileform) end %> + +<% if viewlibrary and viewlibrary.dispatch_component and session.permissions[page_info.controller].startstop then + viewlibrary.dispatch_component("startstop") +end %> diff --git a/tinydns-model.lua b/tinydns-model.lua index 2f40d98..8e10466 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -29,6 +29,8 @@ local descr = { ['Z']="SOA record (SOA)", [':']="Generic record", ['%']="Client location", + ['S']="Service location", + ['N']="Naming authority pointer", }, fieldlabels={ ['.']={"Domain", "IP address", "Name server", "Time to live", "Timestamp", "Location", }, @@ -42,6 +44,8 @@ local descr = { ['Z']={"Domain", "Primary name server", "Contact address", "Serial number", "Refresh time", "Retry time", "Expire time", "Minimum time", "Time to live", "Timestamp", "Location",}, [':']={"Domain", "Record type", "Record data", "Time to live", "Timestamp", "Location", }, ['%']={"Location", "IP prefix", }, + ['S']={"Domain", "IP address", "X", "Port", "Weight", "Priority", "Time to live", "Timestamp", }, + ['N']={"Domain", "Order", "Preference", "Flags", "Service", "Regular expression", "Replacement", "Time to live", "Timestamp", }, }, } |