2013-04-22 Miguel de Dios <miguel.dedios@artica.es>

* mobile/operation/events.php, mobile/operation/module_graph.php,
	mobile/operation/modules.php, mobile/operation/agent.php,
	mobile/include/ui.class.php: some fixes.
	
	* include/functions_reporting.php, include/functions_groups.php,
	include/functions_graph.php: some fixes.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8025 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-22 15:51:37 +00:00
parent 8579aed0a8
commit 185a0a67aa
9 changed files with 66 additions and 46 deletions

View File

@ -1,3 +1,12 @@
2013-04-22 Miguel de Dios <miguel.dedios@artica.es>
* mobile/operation/events.php, mobile/operation/module_graph.php,
mobile/operation/modules.php, mobile/operation/agent.php,
mobile/include/ui.class.php: some fixes.
* include/functions_reporting.php, include/functions_groups.php,
include/functions_graph.php: some fixes.
2013-04-22 Sergio Martin <sergio.martin@artica.es>
* include/styles/pandora.css

View File

@ -2372,7 +2372,7 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
for ($i = 0; $i < $interval; $i++) {
$bottom = $datelimit + ($periodtime * $i);
if (! $graphic_type) {
if($config['flash_charts']) {
if ($config['flash_charts']) {
$name = date('H:i', $bottom);
}
else {
@ -2409,7 +2409,7 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
break;
}
}
else{
else {
$data[$cont]['utimestamp'] = $periodtime;
$data[$cont]['data'] = 1;
}
@ -2434,7 +2434,7 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
}
}
if($return) {
if ($return) {
return $out;
}
else {
@ -3829,7 +3829,7 @@ function grafico_modulo_log4x_format_x_axis ( $number , $decimals=2, $dec_point=
function grafico_modulo_log4x_format_y_axis ( $number , $decimals=2, $dec_point=".", $thousands_sep=",")
{
switch($number) {
switch ($number) {
case 6:
return "FATAL";
break;
@ -3855,13 +3855,18 @@ function grafico_modulo_log4x_format_y_axis ( $number , $decimals=2, $dec_point=
}
function graph_nodata_image($width = 300, $height = 110, $type = 'area') {
$image = ui_get_full_url('images/image_problem_' . $type . '.png', false, false, false);
$image = ui_get_full_url('images/image_problem_' . $type . '.png',
false, false, false);
$text_div = '<div class="nodata_text">' . __('No data to show') . '</div>';
$text_div = '<div class="nodata_text">' .
__('No data to show') . '</div>';
$image_div = '<div class="nodata_container" style="background-image: url(\'' . $image . '\');">' . $text_div . '</div>';
$image_div = '<div class="nodata_container" style="background-image: url(\'' . $image . '\');">' .
$text_div . '</div>';
$div = '<div style="width:' . $width . 'px; height:' . $height . 'px;">' .
$image_div . '</div>';
$div = '<div style="width:' . $width . 'px; height:' . $height . 'px;">' . $image_div . '</div>';
return $div;
}
?>

View File

@ -703,6 +703,10 @@ function groups_get_group_row_data($id_group, $group_all, $group, &$printed_grou
$row['group_icon'] = html_print_image("images/groups_small/" . $icon . ".png",
true, false, true);
if (!isset($html)) {
$html = false;
}
//Update network group
if ($html) {
echo "<td class='group_view_data' style='text-align: center; vertica-align: middle;'>";

View File

@ -1038,7 +1038,7 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
$table_mbs->rowclass[] = '';
$table_mbs->data[] = $tdata;
if($data["monitor_checks"] > 0) {
if ($data["monitor_checks"] > 0) {
$tdata = array();
$table_mbs->colspan[count($table_mbs->data)][0] = 4;
$table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;';
@ -1078,13 +1078,13 @@ function reporting_get_stats_summary($data, $graph_width, $graph_height) {
$table_sum->cellstyle[count($table_sum->data)][0] = 'text-align: center;';
$table_sum->cellstyle[count($table_sum->data)][2] = 'text-align: center;';
if($data["monitor_checks"] > 0) {
if ($data["monitor_checks"] > 0) {
$tdata[0] = '<div style="margin: auto; width: ' . $graph_width . 'px;">' . graph_agent_status (false, $graph_width, $graph_height, true, true) . '</div>';
}
else {
$tdata[2] = html_print_image('images/image_problem.png', true, array('width' => $graph_width));
}
if($data["monitor_alerts"] > 0) {
if ($data["monitor_alerts"] > 0) {
$tdata[2] = '<div style="margin: auto; width: ' . $graph_width . 'px;">' . graph_alert_status ($data["monitor_alerts"], $data["monitor_alerts_fired"], $graph_width, $graph_height, true, true) . '</div>';
}
else {
@ -1155,7 +1155,7 @@ function reporting_get_stats_users($data) {
if (check_acl ($config['id_user'], 0, "UM")) {
$urls['defined_users'] = "index.php?sec=gusuarios&amp;sec2=godmode/users/user_list";
}
else{
else {
$urls['defined_users'] = 'javascript:';
}

View File

@ -827,8 +827,8 @@ class Table {
$html .= "</tr>\n";
}
$html .= "</table>\n";
$html .= "</tbody>\n";
$html .= "</table>\n";
return $html;
}

View File

@ -89,7 +89,7 @@ class Agent {
if ($this->agent['disabled']) {
$agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true);
}
else if ($agent['quiet']) {
else if ($this->agent['quiet']) {
$agent_name = "<em>" . $agent_name . "&nbsp;" . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
}
else {
@ -98,7 +98,7 @@ class Agent {
$addresses = agents_get_addresses($this->id);
$address = agents_get_address($id_agente);
$address = agents_get_address($this->id);
foreach ($addresses as $k => $add) {
if($add == $address) {
unset($addresses[$k]);
@ -111,7 +111,7 @@ class Agent {
}
$last_contant = '<b>' . __('Last contact') . ' / ' . __('Remote') . '</b>&nbsp;'
.ui_print_timestamp ($agent["ultimo_contacto"], true);
.ui_print_timestamp ($this->agent["ultimo_contacto"], true);
$description =
empty($agent["comentarios"]) ? '<em>' . __('N/A') . '</em>' : $this->agent["comentarios"];
@ -130,7 +130,7 @@ class Agent {
$graph_js = ob_get_clean();
$html = $graph_js . $html;
$html .= "<b>" . __('Events (24h)') . "</b><br />";
$html .= graph_graphic_agentevents ($id_agente, 250, 15, 86400, '', true);
$html .= graph_graphic_agentevents ($this->id, 250, 15, 86400, '', true);
$ui->contentGridAddCell($html);
$ui->contentEndGrid();

View File

@ -212,16 +212,17 @@ class Events {
"width" => 12,
"height" => 12,
"title" => $event_criticity));
$event["criticity"] .= ' '.$event_criticity;
$event["criticity"] .= ' ' . $event_criticity;
if ($event['estado'] == 1) {
$user_ack = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
if(empty($user_ack)) {
if (empty($user_ack)) {
$user_ack = $event['id_usuario'];
}
$date_ack = date ($system->getConfig("date_format"), $event['ack_utimestamp']);
$event["acknowledged_by"] = $user_ack.' ('.$date_ack.')';
$event["acknowledged_by"] = $user_ack .
' (' . $date_ack . ')';
}
else {
$event["acknowledged_by"] = '<i>'.__('N/A').'</i>';
@ -277,7 +278,7 @@ class Events {
public function disabledColumns($columns = null) {
if (!empty($columns)) {
foreach ($columns as $column) {
unset($this->columns[$column]);
$this->columns[$column] = 1;
}
}
}
@ -650,8 +651,8 @@ class Events {
$sql_post = " AND id_grupo = " . $this->group;
}
if ($this->id_agente > 0) {
$sql_post = " AND id_agente = " . $this->id_agente;
if ($this->id_agent > 0) {
$sql_post = " AND id_agente = " . $this->id_agent;
}
//--------------------------------------------------------------
@ -1006,7 +1007,7 @@ class Events {
if (!empty($this->status))
$status = events_get_status($this->status);
$type = "";
if (!empty($this->empty))
if (!empty($this->type))
$type = get_event_types($this->type);
$severity = "";
if ($this->severity != -1)

View File

@ -116,6 +116,7 @@ class ModuleGraph {
$urlImage = ui_get_full_url(false);
$time_compare = false;
if ($this->time_compare_separated) {
$time_compare = 'separated';
}
@ -177,7 +178,7 @@ class ModuleGraph {
}
break;
case 'log4x':
$graph .= grafico_modulo_log4x ($this->id,
$graph = grafico_modulo_log4x ($this->id,
$this->period, $this->draw_events,
$this->width, $this->height,
$label, $unit_name, $this->draw_alerts,

View File

@ -90,7 +90,7 @@ class Modules {
public function disabledColumns($columns = null) {
if (!empty($columns)) {
foreach ($columns as $column) {
unset($this->columns[$column]);
$this->columns[$column] = 0;
}
}
}
@ -532,7 +532,7 @@ class Modules {
$ui->contentAddHtml($table->getHTML());
}
else {
$html .= $table->getHTML();
$html = $table->getHTML();
return $html;
}