From 9e62c361c0fd51809a6fefdf5772768147b310a7 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 10 Nov 2009 18:02:36 +0000 Subject: Added support for SRV and NAPTR records, some UI cleanup. --- tinydns-edit-html.lsp | 21 +++++++++------------ tinydns-listfiles-html.lsp | 11 ++++------- 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 @@ \ \ '; + var addEntry = ' \ + \ + '; 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 = ''; } - form = form + '\n
'; form = form + "\n"; 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 @@ }); -<% ---[[ DEBUG INFORMATION -io.write("

DEBUGGING

DEBUG INFO: CFE

") -io.write(html.cfe_unpack(form)) -io.write("
") ---]] -%> -

Configuration

Expert Configuration

File Details

@@ -160,7 +157,7 @@ displayitem(form.value.mtime) <% if form.descr then %>

<%= string.gsub(html.html_escape(form.descr), "\n", "
") %>

<% end %> <% if form.errtxt then %>

<%= string.gsub(html.html_escape(form.errtxt), "\n", "
") %>

<% end %> -<% 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 %> 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("

DEBUGGING

DEBUG INFO: CFE

") -io.write(html.cfe_unpack(form)) -io.write("
") ---]] -%> <% displaycommandresults({"delete", "edit", "editfile"}, session) %> <% displaycommandresults({"newfile"}, session, true) %> @@ -45,3 +38,7 @@ io.write("") 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", }, }, } -- cgit v1.2.3
<%= line %>