From 122904f71112023b7257ac48239271e05b92fe81 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Sat, 23 Feb 2008 09:43:19 +0000 Subject: Output can now be filtered in levels (can only be done by modifying in the controller for now). A problem has appeared - We cant sort the output when the tables are constructed as they are. Next commit will/should have changed the table-layout. git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@767 ab2d0c66-481e-0410-8bed-d214d4d58bed --- tinydns-model.lua | 78 +++++++++++++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 46 deletions(-) (limited to 'tinydns-model.lua') diff --git a/tinydns-model.lua b/tinydns-model.lua index 286689f..a073011 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -342,17 +342,21 @@ function getconfigobjects(self,filter_type) end -- Set values and labels for field #4 - local name = "nameserver" - local label = "Name server" + name = "ttl" + label = "Time to live" -- Some configs uses third column in some other way - if (filecontent_table[1] == "=") or (filecontent_table[1] == "+") then - name = "ttl" - label = "Time to live" + if (filecontent_table[1] == ".") or (filecontent_table[1] == "&") then + name = "ns" + label = "Name server" end if (filecontent_table[1] == "@") then name = "mx" label = "Mail exchanger" end + if (filecontent_table[1] == "Z") then + name = "rname" + label = "Contact address" + end if (filecontent_table[4]) and (#filecontent_table[4]> 0) and (name) then table.insert(domaindetails, cfe ({ name=name, @@ -362,21 +366,21 @@ function getconfigobjects(self,filter_type) end -- Set values and labels for field #5 - local name = nil - local label = nil + name = "timestamp" + label = "Time stamp" -- Some configs uses third column in some other way if (filecontent_table[1] == ".") or (filecontent_table[1] == "&") then name = "ttl" label = "Time to live" end - if (filecontent_table[1] == "=") or (filecontent_table[1] == "+") then - name = "timestamp" - label = "Time stamp" - end if (filecontent_table[1] == "@") then name = "dist" label = "Distance" end + if (filecontent_table[1] == "Z") then + name = "ser" + label = "Serial number" + end if (filecontent_table[5]) and (#filecontent_table[5]> 0) and (name) then table.insert(domaindetails, cfe ({ name=name, @@ -386,24 +390,20 @@ function getconfigobjects(self,filter_type) end -- Set values and labels for field #6 - local name = nil - local label = nil + name = "lo" + label = "Location" -- Some configs uses third column in some other way if (filecontent_table[1] == ".") or (filecontent_table[1] == "&") then - name = "ttl" - label = "Time to live" - end - if (filecontent_table[1] == "=") or (filecontent_table[1] == "+") then name = "timestamp" label = "Time stamp" end if (filecontent_table[1] == "@") then - name = "dist" - label = "Distance" + name = "ttl" + label = "Time to live" end if (filecontent_table[1] == "Z") then - name = "ser" - label = "Serial number" + name = "ref" + label = "Refresh time" end if (filecontent_table[6]) and (#filecontent_table[6]> 0) and (name) then @@ -419,22 +419,16 @@ function getconfigobjects(self,filter_type) local label = nil -- Some configs uses third column in some other way if (filecontent_table[1] == ".") or (filecontent_table[1] == "&") then - name = "timestamp" - label = "Time stamp" - end - if (filecontent_table[1] == "=") or (filecontent_table[1] == "+") or - (filecontent_table[1] == "-") or (filecontent_table[1] == "^") or - (filecontent_table[1] == "C") then - name = "location" + name = "lo" label = "Location" end if (filecontent_table[1] == "@") then - name = "ttl" - label = "Time to live" + name = "timestamp" + label = "Timestamp" end if (filecontent_table[1] == "Z") then - name = "ref" - label = "Refresh time" + name = "ret" + label = "Retry time" end if (filecontent_table[7]) and (#filecontent_table[7]> 0) and (name) then table.insert(domaindetails, cfe ({ @@ -448,23 +442,13 @@ function getconfigobjects(self,filter_type) local name = nil local label = nil -- Some configs uses third column in some other way - if (filecontent_table[1] == ".") or (filecontent_table[1] == "&") then - name = "timestamp" - label = "Time stamp" - end - if (filecontent_table[1] == "=") or (filecontent_table[1] == "+") or - (filecontent_table[1] == "-") or (filecontent_table[1] == "^") or - (filecontent_table[1] == "C") then - name = "location" - label = "Location" - end if (filecontent_table[1] == "@") then - name = "ttl" - label = "Time to live" + name = "lo" + label = "Location" end if (filecontent_table[1] == "Z") then - name = "ref" - label = "Refresh time" + name = "exp" + label = "Expire time" end if (filecontent_table[8]) and (#filecontent_table[8]> 0) and (name) then table.insert(domaindetails, cfe ({ @@ -533,6 +517,8 @@ function getconfigobjects(self,filter_type) end -- TODO: Sort the domains table! + -- Sorting is not possible when things is done as they are (se above) + -- problem comese when we use keynames instead of [1], [2], ... return domains end -- cgit v1.2.3