Pandora FMS community forums

Full Version: numaric sort for monitor detail page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,

I think ascending and descending sort in data column in "Monitor Details" should be numaric sort.because most of the time we received numeric values as data and numeric sort has greater importance than string sort in this case.so i changed few lines in code to get that and it is working fine i guess.

Code:
551c551,552
<                               $order = array('field' => 'tagente_estado.datos', 'order' => 'ASC');
---
>                               // $order = array('field' => 'tagente_estado.datos', 'order' => 'ASC');
>                               $order = array('field' => 'CAST(tagente_estado.datos AS DECIMAL(12,2))', 'order' => 'ASC');
555c556,557
<                               $order = array('field' => 'tagente_estado.datos', 'order' => 'DESC');
---
>                               // $order = array('field' => 'tagente_estado.datos', 'order' => 'DESC');
>                               $order = array('field' => 'CAST(tagente_estado.datos AS DECIMAL(12,2))', 'order' => 'DESC');

Regards