changes in treeview

This commit is contained in:
alejandro-campos 2020-11-25 17:00:37 +01:00
parent b6e142a442
commit 448cc253b4
5 changed files with 29 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

View File

@ -689,9 +689,24 @@ class Tree
);
}
// Alerts fired image
$module_alerts = alerts_get_alerts_agent_module($module['id']);
$module_alert_triggered = false;
foreach ($module_alerts as $module_alert) {
if ($module_alert['times_fired'] > 0) {
$module_alert_triggered = true;
}
}
// Module has alerts.
if ((bool) $module['alerts']) {
$module['alertsImageHTML'] = html_print_image('images/bell.png', true, ['title' => __('Module alerts')]);
// Module has alerts triggered.
if ($module_alert_triggered === true) {
$module['alertsImageHTML'] = html_print_image('images/bell_orange.png', true, ['title' => __('Module alerts')]);
} else {
$module['alertsImageHTML'] = html_print_image('images/bell_green.png', true, ['title' => __('Module alerts')]);
}
}
}
@ -813,7 +828,7 @@ class Tree
// Quiet image
if (isset($agent['quiet']) && $agent['quiet']) {
$agent['quietImageHTML'] = html_print_image('/images/dot_blue.png', true, ['title' => __('Quiet')]);
$agent['statusImageHTML'] = ui_print_status_sets('agent_no_monitors_ball.png', __('Quiet'), 1, ['class' => 'status_balls', 'style' => 'background: '.COL_QUIET.';'], '', false);
}
// Children

View File

@ -153,6 +153,7 @@ define('COL_MINOR', '#F099A2');
define('COL_MAJOR', '#C97A4A');
define('COL_INFORMATIONAL', '#4a83f3');
define('COL_MAINTENANCE', '#E4E4E4');
define('COL_QUIET', '#5AB7E5');
define('COL_GRAPH1', '#C397F2');
define('COL_GRAPH2', '#FFE66C');

View File

@ -2821,7 +2821,8 @@ function ui_print_status_sets(
$title='',
$return=false,
$options=false,
$extra_info=''
$extra_info='',
$get_status_color=true
) {
global $config;
@ -2830,9 +2831,13 @@ function ui_print_status_sets(
}
if (isset($options['style'])) {
$options['style'] .= ' background: '.modules_get_color_status($status).'; display: inline-block;';
$options['style'] .= ' display: inline-block;';
} else {
$options['style'] = 'background: '.modules_get_color_status($status).'; display: inline-block;';
$options['style'] = 'display: inline-block;';
}
if ($get_status_color === true) {
$options['style'] .= ' background: '.modules_get_color_status($status).';';
}
if (isset($options['class'])) {
@ -5699,7 +5704,7 @@ function ui_print_module_string_value(
$title_dialog = modules_get_agentmodule_agent_alias($id_agente_module).' / '.$module_name;
$salida = '<div '."id='hidden_value_module_".$id_agente_module."'
style='display: none; width: 100%; height: 100%; overflow: auto; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left' title='".$title_dialog."'>".$value.'</div><span '."id='value_module_".$id_agente_module."'
style='white-space: nowrap;'>".'<span id="value_module_text_'.$id_agente_module.'">'.$sub_string.'</span> '."<a href='javascript: toggle_full_value(".$id_agente_module.")'>".html_print_image('images/zoom.png', true).'</a></span>';
style='white-space: nowrap;'>".'<span id="value_module_text_'.$id_agente_module.'">'.$sub_string.'</span> '."<a href='javascript: toggle_full_value(".$id_agente_module.")'>".html_print_image('images/zoom.png', true, ['style' => 'max-height: 20px; vertical-align: middle;']).'</a></span>';
}
}
}
@ -5820,6 +5825,7 @@ function ui_get_snapshot_image($link, $is_image)
'border' => '0',
'alt' => '',
'title' => __('Snapshot view'),
'style' => 'max-height: 20px; vertical-align: middle;',
]
).'</a>';