2014-01-22 Sergio Martin <sergio.martin@artica.es>
* godmode/alerts/alert_view.php: Add exception of field1 in recovery fields to the new alert view * include/functions_reporting.php mobile/operation/agents.php mobile/operation/tactical.php mobile/include/style/main.css: Improve tactical and agents view in mobile console git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9354 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b528f359cd
commit
5a2b1b88b4
|
@ -1,3 +1,14 @@
|
|||
2014-01-22 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* godmode/alerts/alert_view.php: Add exception
|
||||
of field1 in recovery fields to the new alert view
|
||||
|
||||
* include/functions_reporting.php
|
||||
mobile/operation/agents.php
|
||||
mobile/operation/tactical.php
|
||||
mobile/include/style/main.css: Improve tactical and
|
||||
agents view in mobile console
|
||||
|
||||
2014-01-22 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/reporting/reporting_builder.item_editor.php,
|
||||
|
|
|
@ -517,8 +517,14 @@ else {
|
|||
$data[0] .= '<br><span style="font-size: xx-small;font-style:italic;">(' . sprintf(__("Field %s"), $fieldn) . ')</span>';
|
||||
$data[1] = $firing_fields[$kaction]['value'][$field];
|
||||
$data[2] = $template[$field . '_recovery'];
|
||||
$data[3] = empty($template[$field . '_recovery']) && !empty($firing_fields[$kaction]['value'][$field]) ? '[RECOVER]' . $firing_fields[$kaction]['value'][$field] : $template[$field . '_recovery'];
|
||||
|
||||
// Field1 doesnt exist on recovery fields. Will be added on future
|
||||
if($fieldn == 1) {
|
||||
$data[3] = $firing_fields[$kaction]['value'][$field];
|
||||
}
|
||||
else {
|
||||
$data[3] = empty($template[$field . '_recovery']) && !empty($firing_fields[$kaction]['value'][$field]) ? '[RECOVER]' . $firing_fields[$kaction]['value'][$field] : $template[$field . '_recovery'];
|
||||
}
|
||||
$first_level = $firing_fields[$kaction]['value'][$field];
|
||||
$second_level = $template[$field . '_recovery'];
|
||||
if (!empty($second_level) || !empty($first_level)) {
|
||||
|
|
|
@ -1068,7 +1068,7 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
|
|||
$tdata = array();
|
||||
$table_mbs->colspan[count($table_mbs->data)][0] = 4;
|
||||
$table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;';
|
||||
$tdata[0] = '<div style="margin: auto; width: ' . $graph_width . 'px;">' . graph_agent_status (false, $graph_width, $graph_height, true, true) . '</div>';
|
||||
$tdata[0] = '<div id="outter_status_pie" style="height: ' . $graph_height . 'px"><div id="status_pie" style="margin: auto; width: ' . $graph_width . 'px;">' . graph_agent_status (false, $graph_width, $graph_height, true, true) . '</div></div>';
|
||||
$table_mbs->rowclass[] = '';
|
||||
$table_mbs->data[] = $tdata;
|
||||
}
|
||||
|
|
|
@ -29,16 +29,37 @@ label, input, .ui-btn-inner {
|
|||
|
||||
|
||||
/*INIT----------Tactical styles-----------------------------------------*/
|
||||
#tactical * {
|
||||
font-size: 14px !important;
|
||||
#tactical1 *, #tactical2 * {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
#tactical a {
|
||||
font-size: 25px !important;
|
||||
#tactical1 a, #tactical2 a {
|
||||
font-size: 18px !important;
|
||||
}
|
||||
|
||||
legend {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.ui-body-d {
|
||||
border-radius: 0.6em 0.6em 0.6em 0.6em !important;
|
||||
}
|
||||
|
||||
.ui-btn-up-c {
|
||||
font-weight: normal !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
/*END-----------Tactical styles-----------------------------------------*/
|
||||
|
||||
#status_pie {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#outter_status_pie {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*INIT----------Groups styles-----------------------------------------*/
|
||||
.group_view tr {
|
||||
|
@ -370,18 +391,41 @@ table#list_events th {
|
|||
|
||||
/*INIT-----------Agents styles----------------------------------------*/
|
||||
.red, .redb, .redi, .error {
|
||||
color: #CC0000;
|
||||
background: #CC0000 !important;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #5A8629;
|
||||
background: #5A8629 !important;
|
||||
}
|
||||
|
||||
.orange {
|
||||
background: #ffa300 !important;
|
||||
}
|
||||
|
||||
.yellow {
|
||||
background: #F3C500 !important;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #808080;
|
||||
background: #808080 !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.green, .orange, .yellow, .red, .grey, .agents_tiny_stats span {
|
||||
text-shadow: none;
|
||||
color: white !important;
|
||||
padding: 1px 3px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.agents_tiny_stats span {
|
||||
background: #222;
|
||||
}
|
||||
|
||||
.agents_tiny_stats * {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 25em) {
|
||||
#list_agents .cell_2 .ui-table-cell-label,
|
||||
#list_agents .cell_3 .ui-table-cell-label,
|
||||
|
@ -687,6 +731,15 @@ li.ui-btn {
|
|||
.events_agent {
|
||||
min-width: 50%;
|
||||
}
|
||||
|
||||
.untiny {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
.agents_tiny_stats, .agents_last_contact {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 25em)
|
||||
|
@ -703,19 +756,46 @@ li.ui-btn {
|
|||
float: left;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.tiny {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* For mobiles */
|
||||
@media screen and (max-width: 800px)
|
||||
{
|
||||
.ui-content>.ui-btn {
|
||||
margin: 10px 7px;
|
||||
height: 30px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
}
|
||||
/* For tablets */
|
||||
@media screen and (min-width: 800px)
|
||||
{
|
||||
.ui-content>.ui-btn {
|
||||
width: 21%;
|
||||
width: 31%;
|
||||
display: inline-block;
|
||||
margin: 4px 10px;
|
||||
height: 35px;
|
||||
margin: 8px 5px;
|
||||
height: 40px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
table.tactical_bars {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tactical_bar {
|
||||
text-align: center;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.ui-bar, .ui-body {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.events .cell_0 img {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
|
|
@ -266,7 +266,7 @@ class Agents {
|
|||
$img_alert = agents_tree_view_alert_img ($agent["fired_count"]);
|
||||
|
||||
|
||||
$row[0] = $row[__('Agent')] =
|
||||
$row[0] = $row[__('Agent')] = '<span class="tiny" style="margin-right: 5px;">' . $img_status . '</span>' .
|
||||
'<a class="ui-link" data-ajax="false" href="index.php?page=agent&id=' . $agent['id_agente'] . '">' . io_safe_output($agent['nombre']) . '</a>';
|
||||
//~ $row[1] = $row[__('Description')] = '<span class="small">' .
|
||||
//~ ui_print_truncate_text($agent["description"], 'description', false, true) .
|
||||
|
@ -284,24 +284,21 @@ class Agents {
|
|||
$img_alert;
|
||||
|
||||
$row[7] = $row[__('Modules')] =
|
||||
'<span class="show_collapside" style="display: none; vertical-align: top;">' .
|
||||
$img_status . '</span>' . ' ' .
|
||||
'<span class="show_collapside" style="display: none; vertical-align: middle;">' . $img_alert . '</span>' .
|
||||
'<span class="show_collapside" style="vertical-align: 0%; display: none; font-weight: bolder;"> ' . __('M.') . ' </span>' .
|
||||
reporting_tiny_stats($agent, true);
|
||||
'<span class="show_collapside" style="vertical-align: 0%; display: none; font-weight: bolder;">' . __('Modules') . ' </span>' .
|
||||
'<span class="agents_tiny_stats">' . reporting_tiny_stats($agent, true) . ' </span>';
|
||||
|
||||
$last_time = strtotime ($agent["ultimo_contacto"]);
|
||||
$now = time ();
|
||||
$diferencia = $now - $last_time;
|
||||
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt'));
|
||||
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size: 12px; margin-left: 20px;', 'units' => 'tiny'));
|
||||
$style = '';
|
||||
if ($diferencia > ($agent["intervalo"] * 2))
|
||||
$row[8] = $row[__('Last contact')] = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
|
||||
else
|
||||
$row[8] = $row[__('Last contact')] = $time;
|
||||
|
||||
$row[8] = $row[__('Last contact')] = '<span class="show_collapside" style="vertical-align: 0%; display: none; font-weight: bolder;"> ' . __('L.') . ' </span>' .
|
||||
$row[__('Last contact')];
|
||||
$row[8] = $row[__('Last contact')] = '<span class="show_collapside" style="vertical-align: 0%; display: none; font-weight: bolder;">' . __('Last contact') . ' </span>' .
|
||||
'<span class="agents_last_contact">' . $row[__('Last contact')] . '</span>';
|
||||
|
||||
if (!$ajax) {
|
||||
unset($row[0]);
|
||||
|
|
|
@ -61,30 +61,48 @@ class Tactical {
|
|||
$data = reporting_get_group_stats();
|
||||
$data['mobile'] = true;
|
||||
|
||||
$formatted_data = reporting_get_stats_indicators($data, 200, 10, false);
|
||||
$formatted_data = reporting_get_stats_indicators($data, 100, 10, false);
|
||||
$formatted_data_untiny = reporting_get_stats_indicators($data, 140, 15, false);
|
||||
|
||||
$overview = '<table>
|
||||
$overview = '<table class="tactical_bars">
|
||||
<tr>
|
||||
<td>' . $formatted_data['server_health']['title'] . '</td>
|
||||
<td>' . $formatted_data['server_health']['graph'] . '</td>
|
||||
<td class="tiny tactical_bar">' . $formatted_data['server_health']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr class="untiny tactical_bar">
|
||||
<td>' . $formatted_data_untiny['server_health']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $formatted_data['monitor_health']['title'] . '</td>
|
||||
<td>' . $formatted_data['monitor_health']['graph'] . '</td>
|
||||
<td class="tiny tactical_bar">' . $formatted_data['monitor_health']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr class="untiny tactical_bar">
|
||||
<td>' . $formatted_data_untiny['monitor_health']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $formatted_data['module_sanity']['title'] . '</td>
|
||||
<td>' . $formatted_data['module_sanity']['graph'] . '</td>
|
||||
<td class="tiny tactical_bar">' . $formatted_data['module_sanity']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr class="untiny tactical_bar">
|
||||
<td>' . $formatted_data_untiny['module_sanity']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $formatted_data['alert_level']['title'] . '</td>
|
||||
<td>' . $formatted_data['alert_level']['graph'] . '</td>
|
||||
<td class="tiny tactical_bar">' . $formatted_data['alert_level']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr class="untiny tactical_bar">
|
||||
<td>' . $formatted_data_untiny['alert_level']['graph'] . '</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
$agents_monitors = reporting_get_stats_agents_monitors($data);
|
||||
$alerts_stats = reporting_get_stats_alerts($data);
|
||||
|
||||
$overview .= "<br />\n" . $agents_monitors;
|
||||
$overview .= "<br />\n" . $alerts_stats;
|
||||
|
||||
$ui->contentGridAddCell($overview);
|
||||
|
||||
$formatted_data = reporting_get_stats_alerts($data);
|
||||
$ui->contentGridAddCell($overview, 'tactical1');
|
||||
|
||||
ob_start();
|
||||
$links = array();
|
||||
$links['monitor_critical'] = "index.php?page=modules&status=1";
|
||||
|
@ -92,11 +110,15 @@ class Tactical {
|
|||
$links['monitor_ok'] = "index.php?page=modules&status=0";
|
||||
$links['monitor_unknown'] = "index.php?page=modules&status=3";
|
||||
$links['monitor_not_init'] = "index.php?page=modules&status=5";
|
||||
$formatted_data .= reporting_get_stats_modules_status($data, 250, 150, $links) . "<br />\n" .
|
||||
reporting_get_stats_agents_monitors($data);
|
||||
$modules_status_untiny = reporting_get_stats_modules_status($data, 230, 150, $links);
|
||||
$modules_status_tiny = reporting_get_stats_modules_status($data, 175, 100, $links);
|
||||
//$formatted_data = $alerts_stats . "<br />\n";
|
||||
$formatted_data = "<div class='tiny'>" . $modules_status_untiny . "</div>";
|
||||
$formatted_data .= "<div class='untiny'>" . $modules_status_tiny . "</div>";
|
||||
//$formatted_data .= "<br />\n" . $agents_monitors;
|
||||
$graph_js = ob_get_clean();
|
||||
$formatted_data = $graph_js . $formatted_data;
|
||||
$ui->contentGridAddCell($formatted_data, 'tactical');
|
||||
$ui->contentGridAddCell($formatted_data, 'tactical2');
|
||||
$ui->contentEndGrid();
|
||||
|
||||
$this->getLastActivity();
|
||||
|
@ -155,10 +177,9 @@ class Tactical {
|
|||
break;
|
||||
}
|
||||
|
||||
$data[__("User")] = '<strong>' . $session_id_usuario . '</strong>';
|
||||
$data[__("Action")] = ui_print_session_action_icon ($session['accion'], true);
|
||||
$data[__("Action")] .= $session['accion'];
|
||||
$data[__("Date")] = human_time_comparation($session['utimestamp']);
|
||||
$data[__("User")] = $session_id_usuario;
|
||||
$data[__("Date")] = human_time_comparation($session['utimestamp'], 'tiny');
|
||||
$data[__("Source IP")] = $session_ip_origen;
|
||||
$data[__("Description")] = io_safe_output ($session['descripcion']);
|
||||
|
||||
|
|
Loading…
Reference in New Issue