mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
fix bug when searching non existing agent group in module groups view
This commit is contained in:
parent
420adb4630
commit
5c0f85a4bb
@ -68,17 +68,20 @@ function mainModuleGroups() {
|
|||||||
return preg_match("/$agent_group_search/i", $v['name']);
|
return preg_match("/$agent_group_search/i", $v['name']);
|
||||||
}, ARRAY_FILTER_USE_BOTH);
|
}, ARRAY_FILTER_USE_BOTH);
|
||||||
|
|
||||||
$groups_view = $is_not_paginated
|
if (!empty($info)) {
|
||||||
? $info
|
$groups_view = $is_not_paginated
|
||||||
: array_slice($info, $offset, $config['block_size']);
|
? $info
|
||||||
$agents_counters = array_reduce($groups_view, function($carry, $item){
|
: array_slice($info, $offset, $config['block_size']);
|
||||||
$carry[$item['id']] = $item;
|
$agents_counters = array_reduce($groups_view, function($carry, $item){
|
||||||
return $carry;
|
$carry[$item['id']] = $item;
|
||||||
}, array());
|
return $carry;
|
||||||
|
}, array());
|
||||||
|
|
||||||
$ids_array = array_keys($agents_counters);
|
$ids_array = array_keys($agents_counters);
|
||||||
|
|
||||||
$ids_group = implode(',', $ids_array);
|
$ids_group = implode(',', $ids_array);
|
||||||
|
} else
|
||||||
|
$ids_group = -1;
|
||||||
|
|
||||||
$condition_critical = modules_get_state_condition(AGENT_MODULE_STATUS_CRITICAL_ALERT);
|
$condition_critical = modules_get_state_condition(AGENT_MODULE_STATUS_CRITICAL_ALERT);
|
||||||
$condition_warning = modules_get_state_condition(AGENT_MODULE_STATUS_WARNING_ALERT);
|
$condition_warning = modules_get_state_condition(AGENT_MODULE_STATUS_WARNING_ALERT);
|
||||||
@ -199,7 +202,7 @@ $sql =
|
|||||||
echo "<td>";
|
echo "<td>";
|
||||||
echo "</tr></table>";
|
echo "</tr></table>";
|
||||||
|
|
||||||
if(count($array_for_defect) > 0){
|
if(true){
|
||||||
$table = new StdClass();
|
$table = new StdClass();
|
||||||
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; padding-right: 10px; min-width: 230px;';
|
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; padding-right: 10px; min-width: 230px;';
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user