Better Device Sorting (Devices → Overview)

I am trying to optimise the sorting of devices on the overview page (https://<base_url>/devices). As of now devices registered by their IP-Adress are sorted by the leading digit of each segment. I would like to do the following.

Now:               Fixed:
192.168.1.1        192.168.1.1
192.168.1.100      192.168.1.2
192.168.1.2        192.168.1.100
192.168.1.200      192.168.1.200

My problem is, that I can not find the matching template files within the repository. Can someone point me in the right direction?
My research shows, that PHP has a ip2long() function that could be of use.

Thank you for your help!
Lucas

1 Like

includes/html/pages/devices.inc.php - I found that with grep -R 'Up/Down Time' . as a unique element.

I tried the debugbar, but across it all I can’t find any reference to that and see it’s using the LegacyController - so guessing it hasn’t been converted over to laravel blades and not going to be able to dig much via that. I know very little about that world though.

1 Like

That seems to be the right page. I’ll try to wrap my head around the table generation. TBH I expected the sorting to be handled by JS, but it seems to be done by php on loading…

Okay, the table content is returned by an Ajax request to https://<base_url>/ajax/table/device. I was not able to locate the corresponding script just yet.

I’m no wiser on it really, but have a look at:

app/Http/Controllers/Table/DeviceController.php
app/Http/Controllers/Ajax/DeviceSearchController.php

They smell relevant to me, but I don’t know how they are called and what magic is going on to leverage them.

1 Like

I notice this also, but I’d also love to be able to sort by DisplayName vs. hostname for cases where DNS is not used.