Merge branch 'ent-10946-enlaces-filtrando-por-estado-en-widget-general-group-status' into 'develop'
Ent 10946 enlaces filtrando por estado en widget general group status See merge request artica/pandorafms!6225
This commit is contained in:
commit
4b10cd4216
|
@ -122,10 +122,11 @@ class Tree
|
||||||
public function setFilter($filter)
|
public function setFilter($filter)
|
||||||
{
|
{
|
||||||
// There is not module filter in metaconsole.
|
// There is not module filter in metaconsole.
|
||||||
if (is_metaconsole()) {
|
/*
|
||||||
|
if (is_metaconsole()) {
|
||||||
$filter['searchModule'] = '';
|
$filter['searchModule'] = '';
|
||||||
$filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS;
|
$filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
$this->filter = $filter;
|
$this->filter = $filter;
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,6 +340,7 @@ class GroupsStatusWidget extends Widget
|
||||||
|
|
||||||
// Head agents.
|
// Head agents.
|
||||||
$table->data[0][0] = '<span>';
|
$table->data[0][0] = '<span>';
|
||||||
|
|
||||||
$table->data[0][0] .= html_print_image(
|
$table->data[0][0] .= html_print_image(
|
||||||
'images/agent.png',
|
'images/agent.png',
|
||||||
true,
|
true,
|
||||||
|
@ -359,38 +360,70 @@ class GroupsStatusWidget extends Widget
|
||||||
$table->data[0][1] .= '</span>';
|
$table->data[0][1] .= '</span>';
|
||||||
|
|
||||||
if ($stats['total_agents'] !== 0) {
|
if ($stats['total_agents'] !== 0) {
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$agentdetail_url = $url.'&statusAgent=';
|
||||||
|
} else {
|
||||||
|
$agentdetail_url = $url.'&status=';
|
||||||
|
}
|
||||||
|
|
||||||
// Agent Critical.
|
// Agent Critical.
|
||||||
$table->data[1][0] = $this->getCellCounter(
|
$agent_url = '';
|
||||||
|
$agent_url .= $agentdetail_url.'1';
|
||||||
|
$agent_data = '<a href="'.$agent_url.'">';
|
||||||
|
$agent_data .= $this->getCellCounter(
|
||||||
$stats['agent_critical'],
|
$stats['agent_critical'],
|
||||||
'',
|
'',
|
||||||
'bg_ff5'
|
'bg_ff5'
|
||||||
);
|
);
|
||||||
|
$agent_data .= '</a>';
|
||||||
|
|
||||||
|
$table->data[1][0] = $agent_data;
|
||||||
|
|
||||||
// Agent Warning.
|
// Agent Warning.
|
||||||
$table->data[2][0] = $this->getCellCounter(
|
$agent_url = '';
|
||||||
|
$agent_url .= $agentdetail_url.'2';
|
||||||
|
$agent_data = '<a href="'.$agent_url.'">';
|
||||||
|
$agent_data .= $this->getCellCounter(
|
||||||
$stats['agent_warning'],
|
$stats['agent_warning'],
|
||||||
'',
|
'',
|
||||||
'bg_ffd'
|
'bg_ffd'
|
||||||
);
|
);
|
||||||
|
$agent_data .= '</a>';
|
||||||
|
$table->data[2][0] = $agent_data;
|
||||||
|
|
||||||
// Agent OK.
|
// Agent OK.
|
||||||
$table->data[3][0] = $this->getCellCounter(
|
$agent_url = '';
|
||||||
|
$agent_url .= $agentdetail_url.'0';
|
||||||
|
$agent_data = '<a href="'.$agent_url.'">';
|
||||||
|
$agent_data .= $this->getCellCounter(
|
||||||
$stats['agent_ok'],
|
$stats['agent_ok'],
|
||||||
'',
|
'',
|
||||||
'bg_82B92E'
|
'bg_82B92E'
|
||||||
);
|
);
|
||||||
|
$agent_data .= '</a>';
|
||||||
|
$table->data[3][0] = $agent_data;
|
||||||
|
|
||||||
// Agent Unknown.
|
// Agent Unknown.
|
||||||
$table->data[1][1] = $this->getCellCounter(
|
$agent_url = '';
|
||||||
|
$agent_url .= $agentdetail_url.'3';
|
||||||
|
$agent_data = '<a href="'.$agent_url.'">';
|
||||||
|
$agent_data .= $this->getCellCounter(
|
||||||
$stats['agent_unknown'],
|
$stats['agent_unknown'],
|
||||||
'#B2B2B2'
|
'#B2B2B2'
|
||||||
);
|
);
|
||||||
|
$agent_data .= '</a>';
|
||||||
|
$table->data[1][1] = $agent_data;
|
||||||
|
|
||||||
// Agent Not Init.
|
// Agent Not Init.
|
||||||
$table->data[2][1] = $this->getCellCounter(
|
$agent_url = '';
|
||||||
|
$agent_url .= $agentdetail_url.'5';
|
||||||
|
$agent_data = '<a href="'.$agent_url.'">';
|
||||||
|
$agent_data .= $this->getCellCounter(
|
||||||
$stats['agent_not_init'],
|
$stats['agent_not_init'],
|
||||||
'#4a83f3'
|
'#4a83f3'
|
||||||
);
|
);
|
||||||
|
$agent_data .= '</a>';
|
||||||
|
$table->data[2][1] = $agent_data;
|
||||||
|
|
||||||
$data .= html_print_table($table, true);
|
$data .= html_print_table($table, true);
|
||||||
$data .= '</div>';
|
$data .= '</div>';
|
||||||
|
@ -436,38 +469,69 @@ class GroupsStatusWidget extends Widget
|
||||||
$table->data[0][1] .= '</b>';
|
$table->data[0][1] .= '</b>';
|
||||||
$table->data[0][1] .= '</span>';
|
$table->data[0][1] .= '</span>';
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$monitordetail_url = $url.'&statusModule=';
|
||||||
|
} else {
|
||||||
|
$monitordetail_url = 'index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group='.$this->values['groupId'].'&status=';
|
||||||
|
}
|
||||||
|
|
||||||
// Modules Critical.
|
// Modules Critical.
|
||||||
$table->data[1][0] = $this->getCellCounter(
|
$module_url = '';
|
||||||
|
$module_url .= $monitordetail_url.'1';
|
||||||
|
$module_data = '<a href="'.$module_url.'">';
|
||||||
|
$module_data .= $this->getCellCounter(
|
||||||
$stats['monitor_critical'],
|
$stats['monitor_critical'],
|
||||||
'',
|
'',
|
||||||
'bg_ff5'
|
'bg_ff5'
|
||||||
);
|
);
|
||||||
|
$module_data .= '</a>';
|
||||||
|
$table->data[1][0] = $module_data;
|
||||||
|
|
||||||
// Modules Warning.
|
// Modules Warning.
|
||||||
$table->data[2][0] = $this->getCellCounter(
|
$module_url = '';
|
||||||
|
$module_url .= $monitordetail_url.'2';
|
||||||
|
$module_data = '<a href="'.$module_url.'">';
|
||||||
|
$module_data .= $this->getCellCounter(
|
||||||
$stats['monitor_warning'],
|
$stats['monitor_warning'],
|
||||||
'',
|
'',
|
||||||
'bg_ffd'
|
'bg_ffd'
|
||||||
);
|
);
|
||||||
|
$module_data .= '</a>';
|
||||||
|
$table->data[2][0] = $module_data;
|
||||||
|
|
||||||
// Modules OK.
|
// Modules OK.
|
||||||
$table->data[3][0] = $this->getCellCounter(
|
$module_url = '';
|
||||||
|
$module_url .= $monitordetail_url.'0';
|
||||||
|
$module_data = '<a href="'.$module_url.'">';
|
||||||
|
$module_data .= $this->getCellCounter(
|
||||||
$stats['monitor_ok'],
|
$stats['monitor_ok'],
|
||||||
'',
|
'',
|
||||||
'bg_82B92E'
|
'bg_82B92E'
|
||||||
);
|
);
|
||||||
|
$module_data .= '</a>';
|
||||||
|
$table->data[3][0] = $module_data;
|
||||||
|
|
||||||
// Modules Unknown.
|
// Modules Unknown.
|
||||||
$table->data[1][1] = $this->getCellCounter(
|
$module_url = '';
|
||||||
|
$module_url .= $monitordetail_url.'3';
|
||||||
|
$module_data = '<a href="'.$module_url.'">';
|
||||||
|
$module_data .= $this->getCellCounter(
|
||||||
$stats['monitor_unknown'],
|
$stats['monitor_unknown'],
|
||||||
'#B2B2B2'
|
'#B2B2B2'
|
||||||
);
|
);
|
||||||
|
$module_data .= '</a>';
|
||||||
|
$table->data[1][1] = $module_data;
|
||||||
|
|
||||||
// Modules Not Init.
|
// Modules Not Init.
|
||||||
$table->data[2][1] = $this->getCellCounter(
|
$module_url = '';
|
||||||
|
$module_url .= $monitordetail_url.'5';
|
||||||
|
$module_data = '<a href="'.$module_url.'">';
|
||||||
|
$module_data .= $this->getCellCounter(
|
||||||
$stats['monitor_not_init'],
|
$stats['monitor_not_init'],
|
||||||
'#4a83f3'
|
'#4a83f3'
|
||||||
);
|
);
|
||||||
|
$module_data .= '</a>';
|
||||||
|
$table->data[2][1] = $module_data;
|
||||||
|
|
||||||
$data .= html_print_table($table, true);
|
$data .= html_print_table($table, true);
|
||||||
$data .= '</div>';
|
$data .= '</div>';
|
||||||
|
|
|
@ -291,47 +291,46 @@ if (is_metaconsole() === true) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
// if (is_metaconsole() === false) {
|
||||||
// Module filter.
|
// Module filter.
|
||||||
$module_status_arr = [];
|
$module_status_arr = [];
|
||||||
$module_status_arr[-1] = __('All');
|
$module_status_arr[-1] = __('All');
|
||||||
// Default.
|
// Default.
|
||||||
$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
||||||
$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
|
$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
|
||||||
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
|
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
|
||||||
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
|
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
|
||||||
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
|
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
|
||||||
$module_status_arr['fired'] = __('Fired alerts');
|
$module_status_arr['fired'] = __('Fired alerts');
|
||||||
|
|
||||||
$table->data['last_row'][] = html_print_label_input_block(
|
$table->data['last_row'][] = html_print_label_input_block(
|
||||||
__('Search module'),
|
__('Search module'),
|
||||||
html_print_input_text('search_module', $search_module, '', 25, 30, true)
|
html_print_input_text('search_module', $search_module, '', 25, 30, true)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data['last_row'][] = html_print_label_input_block(
|
$table->data['last_row'][] = html_print_label_input_block(
|
||||||
__('Show not init modules'),
|
__('Show not init modules'),
|
||||||
html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true)
|
html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data['last_row'][] = html_print_label_input_block(
|
|
||||||
__('Module status'),
|
|
||||||
html_print_select(
|
|
||||||
$module_status_arr,
|
|
||||||
'status_module',
|
|
||||||
$status_module,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'width:100%'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$table->data['last_row'][] = html_print_label_input_block(
|
||||||
|
__('Module status'),
|
||||||
|
html_print_select(
|
||||||
|
$module_status_arr,
|
||||||
|
'status_module',
|
||||||
|
$status_module,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'width:100%'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
// }
|
||||||
$form_html = '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$tab.'&pure='.$config['pure'].'">';
|
$form_html = '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$tab.'&pure='.$config['pure'].'">';
|
||||||
$form_html .= html_print_table($table, true);
|
$form_html .= html_print_table($table, true);
|
||||||
$form_html .= html_print_div(
|
$form_html .= html_print_div(
|
||||||
|
|
Loading…
Reference in New Issue