mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Fix meta alert datatable order
This commit is contained in:
parent
c177ee2e2e
commit
bc5f1d0dce
@ -900,13 +900,13 @@ if ($get_agent_alerts_datatable === true) {
|
||||
return function ($a, $b) use ($sort, $sortField) {
|
||||
if ($sort === 'asc') {
|
||||
if (is_string($a[$sortField]) === true) {
|
||||
return strcmp($a[$sortField], $b[$sortField]);
|
||||
return strnatcasecmp($a[$sortField], $b[$sortField]);
|
||||
} else {
|
||||
return ($a[$sortField] - $b[$sortField]);
|
||||
}
|
||||
} else {
|
||||
if (is_string($a[$sortField]) === true) {
|
||||
return strcmp($b[$sortField], $a[$sortField]);
|
||||
return strnatcasecmp($b[$sortField], $a[$sortField]);
|
||||
} else {
|
||||
return ($a[$sortField] + $b[$sortField]);
|
||||
}
|
||||
@ -916,7 +916,7 @@ if ($get_agent_alerts_datatable === true) {
|
||||
|
||||
|
||||
usort($alerts['alerts_simple'], arrayOutputSorting($sort, $sortField));
|
||||
$data = array_slice($alerts['alerts_simple'], $start, $length);
|
||||
$alerts['alerts_simple'] = array_slice($alerts['alerts_simple'], $start, $length);
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
@ -1075,7 +1075,7 @@ function ui_format_alert_row(
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if (is_metaconsole() === true && (int) $server_id !== 0) {
|
||||
$server = db_get_row('tmetaconsole_setup', 'id', $alert['server_data']['id']);
|
||||
|
||||
if (metaconsole_connect($server) == NOERR) {
|
||||
|
@ -359,7 +359,7 @@ if ($free_search != '') {
|
||||
],
|
||||
'drawCallback' => 'alerts_table_controls()',
|
||||
'order' => [
|
||||
'field' => 'module_name',
|
||||
'field' => 'agent_module_name',
|
||||
'direction' => 'asc',
|
||||
],
|
||||
'zeroRecords' => __('No alerts found'),
|
||||
@ -400,7 +400,7 @@ if ($free_search != '') {
|
||||
],
|
||||
'drawCallback' => 'alerts_table_controls()',
|
||||
'order' => [
|
||||
'field' => 'module',
|
||||
'field' => 'agent_module_name',
|
||||
'direction' => 'asc',
|
||||
],
|
||||
'zeroRecords' => __('No alerts found'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user