Add snapshot button in tree view dialog window and center image in snapshot window #90

This commit is contained in:
enriquecd 2016-12-07 17:08:32 +01:00
parent 0b1454f0e8
commit adf7cc07f9
2 changed files with 38 additions and 2 deletions

View File

@ -248,6 +248,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 = '<a href="javascript:' . $link . '">' .
html_print_image('images/default_list.png', true,
array('border' => '0',
'alt' => '',
'title' => __('Snapshot view'))) . '</a> &nbsp;&nbsp;';
}
else {
$salida = '<a href="javascript:' . $link . '">' .
html_print_image('images/photo.png', true,
array('border' => '0',
'alt' => '',
'title' => __('Snapshot view'))) . '</a> &nbsp;&nbsp;';
}
}
$last_data_str .= $salida;
}
else {
$last_data_str = '<i>' . __('No data') . '</i>';

View File

@ -62,14 +62,14 @@ $label = get_parameter ("label");
FROM tagente_estado
WHERE id_agente_modulo = $id");
echo "<h2 id='title_snapshot_view'>";
echo "<h2 style='text-align:center;' id='title_snapshot_view'>";
echo __("Current data at");
echo " ";
echo $row["timestamp"];
echo "</h2>";
$datos = io_safe_output($row["datos"]);
if (is_image_data($datos)) {
echo '<img src="' . $datos . '" alt="image"/>';
echo '<center><img src="' . $datos . '" alt="image"/></center>';
}
else {
$datos = preg_replace ('/</', '&lt;', $datos);