From 1a0827a2fcd4aa16176ebc7ecd593305ab70088e Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Sat, 8 Mar 2008 11:42:14 +0000 Subject: Saving work for today. Hide [New] objects because they don't work for the moment. When selecting a record and edit it, you get to see the whole record (still not editable). git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@830 ab2d0c66-481e-0410-8bed-d214d4d58bed --- tinydns-model.lua | 60 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 16 deletions(-) (limited to 'tinydns-model.lua') diff --git a/tinydns-model.lua b/tinydns-model.lua index 3b5f445..2d57d7d 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -186,19 +186,45 @@ end function check_signs(sign) local output = {} local output = {prefix={ - ['.']="Name server for your domain", - ['&']="Name server", - ['=']="Host", - ['+']="Alias", - ['@']="Mail exchanger", - ['=']="Host", - ['^']="PTR record", - ['C']="Canonical Name", - ['Z']="SOA record", - [':']="Generic record", - ['%']="Client location", - }} - output = output[sign] + ['.']="Name server for your domain", + ['&']="Name server", + ['=']="Host", + ['+']="Alias", + ['@']="Mail exchanger", + ['^']="PTR record", + ['C']="Canonical Name", + ['Z']="SOA record", + [':']="Generic record", + ['%']="Client location", + }, + reverse={ + ['nsourdomain']=".", + ['nsdomain']="&", + ['host']="=", + ['alias']="+", + ['mx']="@", + ['ptr']="^", + ['cname']="C", + ['soa']="Z", + [':']=":", + ['locations']="%", + }, + fieldlabels={ + ['.']={"Prefix", "Domain", "IP address", "Name server", "Time to live", "Timestamp", "Location", }, + ['&']={"Prefix", "Domain", "IP address", "Name server", "Time to live", "Timestamp", "Location", }, + ['=']={"Prefix", "Host", "IP address", "Time to live", "Timestamp", "Location", }, + ['+']={"Prefix", "Alias", "IP address", "Time to live", "Timestamp", "Location", }, + ['@']={"Prefix", "Domain", "IP address", "Mail exchanger", "Distance", "Time to live", "Timestamp", "Location", }, + ['^']={"Prefix", "PTR", "Domain name", "Time to live", "Timestamp", "Location", }, + ['C']={"Prefix", "Domain name", "Canonical name", "Time to live", "Timestamp", "Location", }, + ['Z']={"Prefix", "Unknown", "Primary name server", "Contact address", "Serial number", "Refresh time", "Retry time", "Expire time", "Minimum time", "Time to live", "Timestamp", "Location",}, + [':']={"Prefix", "Unknown", "Type of record", "Rdata", "Time to live", "Timestamp", "Location", }, + ['%']={"Prefix", "Location", "IP prefix", }, + }, + } + if (sign) then + output = output[sign] + end return output end @@ -321,9 +347,9 @@ local function filter_table(t1,domains_filtered,filter) for k1,v1 in pairs(t1) do for k2,v2 in pairs(v1) do if (v2.label) then - if ( string.find(filter,v2.label) ) then - table.insert(domains_filtered, v2) - end + if ( string.find(filter,v2.label) ) then + table.insert(domains_filtered, v2) + end end end end @@ -342,6 +368,7 @@ function getconfigobjects(self,filter_type, filter_levels) for kk,vv in pairs(filecontent) do local domaindetails = {} local filecontent_table = split_config_items(vv) + filecontent_table["orgrecord"] = vv -- Create domain information tables local domain @@ -549,6 +576,7 @@ function getconfigobjects(self,filter_type, filter_levels) name=filecontent_table[2], label=filecontent_table[2], option=domainoptions, + orgrecordtable=filecontent_table, }) end -- cgit v1.2.3