From 117c45a25e649eaec131dfc1718ee1b8d598290b Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 7 Dec 2016 17:08:32 +0100 Subject: [PATCH] Add snapshot button in tree view dialog window and center image in snapshot window #90 (cherry picked from commit adf7cc07f9f51bab5eeb5e95ec3803b3b4ab09d4) --- .../include/functions_treeview.php | 36 +++++++++++++++++++ .../operation/agentes/snapshot_view.php | 4 +-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index f0fd393824..f2387cc26d 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -247,6 +247,42 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head = $last_data_str .= " "; $last_data_str .= html_print_image('images/clock2.png', true, array('title' => $last_data["timestamp"], 'width' => '18px')); + + $is_snapshot = is_snapshot_data ( $last_data["datos"] ); + + if (($config['command_snapshot']) && ($is_snapshot)) { + $handle = 'snapshot_' . $module['id_agente_modulo']; + $url = 'include/procesos.php?agente=' . $row['id_agente_modulo']; + $win_handle = dechex(crc32($handle)); + if (! defined ('METACONSOLE')) { + $link = "winopeng_var('operation/agentes/snapshot_view.php?" . + "id=" . $module['id_agente_modulo'] . + "&refr=" . $module['current_interval'] . + "&label=" . rawurlencode(urlencode(io_safe_output($module['module_name']))) . "','" . $win_handle . "', 700,480)"; + } + else{ + $link = "winopeng_var('$last_data[datos]','',700,480)"; + + } + + if(!is_image_data($last_data["datos"])){ + $salida = '' . + html_print_image('images/default_list.png', true, + array('border' => '0', + 'alt' => '', + 'title' => __('Snapshot view'))) . '   '; + } + else { + $salida = '' . + html_print_image('images/photo.png', true, + array('border' => '0', + 'alt' => '', + 'title' => __('Snapshot view'))) . '   '; + } + } + + + $last_data_str .= $salida; } else { $last_data_str = '' . __('No data') . ''; diff --git a/pandora_console/operation/agentes/snapshot_view.php b/pandora_console/operation/agentes/snapshot_view.php index b6de2a821e..1c986e25ed 100644 --- a/pandora_console/operation/agentes/snapshot_view.php +++ b/pandora_console/operation/agentes/snapshot_view.php @@ -62,14 +62,14 @@ $label = get_parameter ("label"); FROM tagente_estado WHERE id_agente_modulo = $id"); - echo "

"; + echo "

"; echo __("Current data at"); echo " "; echo $row["timestamp"]; echo "

"; $datos = io_safe_output($row["datos"]); if (is_image_data($datos)) { - echo 'image'; + echo '
image
'; } else { $datos = preg_replace ('/