Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix host address sorting (put .2 above .11) #2

Closed
jvedman opened this issue May 13, 2024 · 2 comments
Closed

Fix host address sorting (put .2 above .11) #2

jvedman opened this issue May 13, 2024 · 2 comments

Comments

@jvedman
Copy link

jvedman commented May 13, 2024

First, this is an awesome project, so many <3s. That said, there is an issue with host IP sorting. I am happy to do some of the lifting here, but definitely need to make Host - Address sorts go in proper order (.x.2 should be above .x.11, .2.x should be above .11.x, etc.). I'll start poking, but if you can give me a pointer of where to look that would be awesome.

@l4rm4nd
Copy link
Member

l4rm4nd commented Jul 20, 2024

Hey @jvedman ,

so sorry for the late response. I've overseen your issue totally.

I will have a look at the sorting too. Basically, those tables are Bootstrap datatables, which are initialized by JavaScript.

The IPs are considered strings, therefore sorting does not properly work. We have to create a custom sorting algorithm in JS and use it to initialize the datatables.

The relevant JS is located at the end of the nmap-boostrap.xsl file if you want to have a look at it too.

@l4rm4nd
Copy link
Member

l4rm4nd commented Jul 20, 2024

I've added https://datatables.net/plug-ins/sorting/ip-address, which solves the IP address sorting problem.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants