Closed djsekops closed 2 years ago
Thanks @Kalaratri! Can you confirm that IP addresses are sorted in ascending order if you treat the entire IP address as a single number? For example, 234.0.0.1
displays in the Node list before 24.0.0.12
because “234001” < “240012". If so, this is something that we're adding to the technical team's list to look into and resolve! Stay tuned here for updates.
Yes, that's correct! Also for example: 10.11.1.129 10.11.1.14 10.11.1.141
+1. It would be very helpful for us to have Dradis export nodes in ascending order by IP address/alphabetically in Word reports as well. We are currently having to run macros to sort things by IP and it's causing a fair number of headaches.
I am running a Dradis fork with default node order (https://github.com/dradis/dradis-ce/blob/master/app/models/node.rb#L18) changed to INET_ATON
for MySQL and an initializer to remiplement this function for SQLite using: https://www.rubydoc.info/gems/sqlite3/1.3.13/SQLite3/Database:create_function.
This approach does not require reordering records outside of the model in pure Ruby. The drawback is that only two databases are supported. If that's acceptable I can add some tests and submit a pull request.
The idea is interesting, but I am not sure on the "per database" approach.
Maybe the pure ruby solution is easier to maintain.
For reference, something similar was attempted here: https://github.com/dradis/dradis-ce/pull/431
And this could also help: https://github.com/dradis/dradis-ce/blob/6d4b4988c86fa5414dbe060ea57bbbaba83f9a3d/app/models/issue.rb#L101-L104
Closing due to inactivity. This is noted but not on our roadmap to address. Feel free to re-open with new/additional info.
Steps to reproduce
View nodes
Expected behavior
Ideally IP addresses of nodes should be sorted in a logical order
Actual behavior
Sort order logic is counter intuitive, or not sorted...?
System configuration
3.6
Ruby version:
OS version: