Wrong sorting on DNS page

v7

(Rolf Bakker) #1

Hi
I’ve found a small cosmetic bug:
NethServer release 7.4.1708
on the admin-panel, section configuration, item DNS, tab hosts.
wrong behavior:
when I click the column header “IP address” the table is sorted on the IP column alphanumerical, so 192.168.1.22 comes before 192.168.1.3:

  • 192.168.1.1
  • 192.168.1.22
  • 192.168.1.3

expected behaviour:
when I click the column header “IP address” the table is sorted on the IP column numerical, so 192.168.1.3 comes before 192.168.1.22:

  • 192.168.1.1
  • 192.168.1.3
  • 192.168.1.22

Small bug, hopefully it can be fixed in a upcoming release.
(NB: maybe the same error is present in other sections/tables, I haven’t searched for it. When someone notices the same behaviour on other places, please report here.)


(Michael Träumner) #2

I think the variable is a string, but it’s more work than only converting it to an integer. I think you have to split it to

integer1=192
integer2=168
integer3=1
integer4=1 or 3 or 22

In my opinion you have to sort it one by one with an algorithm, first you have to look for integer1, for example 191<192>193, after that you have to look for integer2, then integer3 and at least integer4. At last step you can sort it by first integer1, than integer2 and so on and do the output like this

integer1.integer2.integer3.integer4

I think an other easier way could be if you have always 3 digits at a block, like this:

192.168.001.001
192.168.001.003
192.168.001.022

so it’s sorted automatically at the right way.


(Rolf Bakker) #3

unfortunately, that’s not regarded a valid IP address when entering in the web-interface…


(Giacomo Sanchietti) #4

The data are sorted as strings, it’s the behavior of jQuery data-table plugin.

You need to get your hands dirty with JavaScript to get this fixed. :open_mouth: