ltb-project / service-desk

Application for support team who need to check and reset user passwords
https://service-desk.readthedocs.io/
GNU General Public License v3.0
49 stars 19 forks source link

Problem sorting bytes columns in dashboards #122

Open flesueur opened 1 month ago

flesueur commented 1 month ago

Hi,

We have a custom dashboard showing storage usage in a table.

As you can see in the screenshot, when sorted, the column with the storage is in lexicographical order rather than sorted numerically 2024-05-21_17-02

Same issue appears when typing as bytes : 2024-05-21_17-12

It would be nice if we could have some improved sorting, or are we missing something ?

Cheers, François

coudot commented 1 month ago

We should maybe look at https://datatables.net/reference/option/columns.type

coudot commented 1 month ago

Tried several things this moring but did not succeed.

I think the first step will be to use a more recent version of datatables, then we could use this plugin: https://datatables.net/plug-ins/sorting/file-size