2011-11-17 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* godmode/snmpconsole/snmp_alert.php: Fixed bad time description.

	* godmode/reporting/visual_console_builder.editor.php
	 include/functions_visual_map.php: Now it's possible to link icons 
	 in visual console with a web page through the label. 

	* operation/visual_console/index.php
	 operation/visual_console/render_view.php
	 include/functions_config.php	 
	 operation/menu.php
	 godmode/menu.php
	 godmode/setup/setup.php
	 godmode/setup/setup_visuals.php
	 include/config_process.php: Added two new autorefresh 
	 parameters: one global and the other for visual console.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5146 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-11-17 16:55:32 +00:00
parent 3ba0d00794
commit 77c0be4a40
12 changed files with 124 additions and 46 deletions

View File

@ -1,3 +1,21 @@
2011-11-17 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/snmpconsole/snmp_alert.php: Fixed bad time description.
* godmode/reporting/visual_console_builder.editor.php
include/functions_visual_map.php: Now it's possible to link icons
in visual console with a web page through the label.
* operation/visual_console/index.php
operation/visual_console/render_view.php
include/functions_config.php
operation/menu.php
godmode/menu.php
godmode/setup/setup.php
godmode/setup/setup_visuals.php
include/config_process.php: Added two new autorefresh
parameters: one global and the other for visual console.
2011-11-17 Junichi Satoh <junichi@rworks.jp>
* include/help/ja/help_network_map_enterprise.php,

View File

@ -153,7 +153,7 @@ if (check_acl ($config['id_user'], 0, "IW")) {
if ($config['activate_gis']) {
$menu["godgismaps"]["text"] = __('GIS Maps builder');
$menu["godgismaps"]["sec2"] = "godmode/gis_maps/index";
if (isset($config['refr'])){
if (!empty($config['refr'])){
$menu["godgismaps"]["refr"] = $config['refr'];
}
else{
@ -259,7 +259,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
if (array_key_exists('fatherId',$extmenu)) {
if (strlen($extmenu['fatherId']) > 0) {
$menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
if (isset($config['refr'])){
if (!empty($config['refr'])){
$menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr'];
}
else{

View File

@ -116,7 +116,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
<span id="title_panel_span_icon" class="title_panel_span" style="display: none; font-weight: bolder;"><?php echo __('Icon');?></span>
</caption>
<tbody>
<tr id="label_row" style="" class="static_graph percentile_bar module_graph simple_value label datos">
<tr id="label_row" style="" class="static_graph percentile_bar module_graph simple_value label datos icon">
<td style=""><?php echo __('Label');?></td>
<td style=""><?php html_print_input_text ('label', '', '', 20, 200); ?></td>
</tr>

View File

@ -84,12 +84,6 @@ $table->data[1][1] = html_print_input_text ('remote_config', $config["remote_con
$table->data[6][0] = __('Auto login (hash) password');
$table->data[6][1] = html_print_input_text ('loginhash_pwd', $config["loginhash_pwd"], '', 15, 15, true);
$table->data[8][0] = __('Timestamp or time comparation') . ui_print_help_icon ("time_stamp-comparation", true);
$table->data[8][1] = __('Comparation in rollover').' ';
$table->data[8][1] .= html_print_radio_button ('prominent_time', "comparation", '', $config["prominent_time"], true);
$table->data[8][1] .= '<br />'.__('Timestamp in rollover').' ';
$table->data[8][1] .= html_print_radio_button ('prominent_time', "timestamp", '', $config["prominent_time"], true);
$table->data[9][0] = __('Time source') . ui_print_help_icon ("timesource", true);
$sources["system"] = __('System');
$sources["sql"] = __('Database');

View File

@ -48,52 +48,73 @@ $table->data[1][0] = __('Date format string') . ui_print_help_icon("date_format"
$table->data[1][1] = '<em>'.__('Example').'</em> '.date ($config["date_format"]);
$table->data[1][1] .= html_print_input_text ('date_format', $config["date_format"], '', 30, 100, true);
$table->data[2][0] = __('Graph color (min)');
$table->data[2][1] = html_print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
$table->data[2][0] = __('Timestamp or time comparation') . ui_print_help_icon ("time_stamp-comparation", true);
$table->data[2][1] = __('Comparation in rollover').' ';
$table->data[2][1] .= html_print_radio_button ('prominent_time', "comparation", '', $config["prominent_time"], true);
$table->data[2][1] .= '<br />'.__('Timestamp in rollover').' ';
$table->data[2][1] .= html_print_radio_button ('prominent_time', "timestamp", '', $config["prominent_time"], true);
$table->data[3][0] = __('Graph color (avg)');
$table->data[3][1] = html_print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
$table->data[3][0] = __('Graph color (min)');
$table->data[3][1] = html_print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
$table->data[4][0] = __('Graph color (max)');
$table->data[4][1] = html_print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
$table->data[4][0] = __('Graph color (avg)');
$table->data[4][1] = html_print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
$table->data[5][0] = __('Graphic resolution (1-low, 5-high)');
$table->data[5][1] = html_print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
$table->data[5][0] = __('Graph color (max)');
$table->data[5][1] = html_print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
$table->data[6][0] = __('Style template');
$table->data[6][1] = html_print_select (themes_get_css (), 'style', $config["style"].'.css', '', '', '', true);
$table->data[6][0] = __('Graphic resolution (1-low, 5-high)');
$table->data[6][1] = html_print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
$table->data[7][0] = __('Block size for pagination');
$table->data[7][1] = html_print_input_text ('block_size', $config["global_block_size"], '', 5, 5, true);
$table->data[7][0] = __('Style template');
$table->data[7][1] = html_print_select (themes_get_css (), 'style', $config["style"].'.css', '', '', '', true);
$table->data[8][0] = __('Use round corners');
$table->data[8][1] = __('Yes').'&nbsp;'.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).'&nbsp;&nbsp;';
$table->data[8][1] .= __('No').'&nbsp;'.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
$table->data[8][0] = __('Block size for pagination');
$table->data[8][1] = html_print_input_text ('block_size', $config["global_block_size"], '', 5, 5, true);
$table->data[9][0] = __('Status icon set');
$table->data[9][0] = __('Use round corners');
$table->data[9][1] = __('Yes').'&nbsp;'.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).'&nbsp;&nbsp;';
$table->data[9][1] .= __('No').'&nbsp;'.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
$table->data[10][0] = __('Status icon set');
$iconsets["default"] = __('Colors');
$iconsets["faces"] = __('Faces');
$iconsets["color_text"] = __('Colors and text');
$table->data[9][1] = html_print_select ($iconsets, 'status_images_set', $config["status_images_set"], '', '', '', true);
$table->data[10][1] = html_print_select ($iconsets, 'status_images_set', $config["status_images_set"], '', '', '', true);
$table->data[10][0] = __('Font path');
$table->data[11][0] = __('Font path');
$fonts = load_fonts();
$table->data[10][1] = html_print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true);
$table->data[11][1] = html_print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true);
$table->data[11][0] = __('Font size');
$table->data[11][1] = html_print_select(range(1, 15), 'font_size', $config["font_size"], '', '', 0, true);
$table->data[12][0] = __('Font size');
$table->data[12][1] = html_print_select(range(1, 15), 'font_size', $config["font_size"], '', '', 0, true);
$table->data[12][0] = __('Flash charts') . ui_print_help_tip(__('Whether to use Flash charts or static PNG graphs'), true);
$table->data[12][1] = __('Yes').'&nbsp;'.html_print_radio_button ('flash_charts', 1, '', $config["global_flash_charts"], true).'&nbsp;&nbsp;';
$table->data[12][1] .= __('No').'&nbsp;'.html_print_radio_button ('flash_charts', 0, '', $config["global_flash_charts"], true);
$table->data[13][0] = __('Flash charts') . ui_print_help_tip(__('Whether to use Flash charts or static PNG graphs'), true);
$table->data[13][1] = __('Yes').'&nbsp;'.html_print_radio_button ('flash_charts', 1, '', $config["global_flash_charts"], true).'&nbsp;&nbsp;';
$table->data[13][1] .= __('No').'&nbsp;'.html_print_radio_button ('flash_charts', 0, '', $config["global_flash_charts"], true);
if (!defined ('PANDORA_ENTERPRISE')){
$table->data[13][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true);
$table->data[13][1] = html_print_select (list_files ('images/custom_logo', "png", 1, 0), 'custom_logo', $config["custom_logo"], '', '', '', true);
$table->data[14][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true);
$table->data[14][1] = html_print_select (list_files ('images/custom_logo', "png", 1, 0), 'custom_logo', $config["custom_logo"], '', '', '', true);
}
$values = array ();
$values[5] = human_time_description_raw (5);
$values[30] = human_time_description_raw (30);
$values[60] = human_time_description_raw (60);
$values[120] = human_time_description_raw (120);
$values[300] = human_time_description_raw (300);
$values[600] = human_time_description_raw (600);
$values[1800] = human_time_description_raw (1800);
$table->data[15][0] = __('Global default interval for refresh') . ui_print_help_tip(__('This interval will affect all pages'), true);
$table->data[15][1] = html_print_select ($values, 'refr', $config["refr"], '', 'N/A', 0, true, false, false);
$table->data[16][0] = __('Default interval for refresh on Visual Console') . ui_print_help_tip(__('This interval will affect to Visual Console pages'), true);
$table->data[16][1] = html_print_select ($values, 'vc_refr', $config["vc_refr"], '', 'N/A', 0, true, false, false);
echo '<form id="form_setup" method="post">';
html_print_input_hidden ('update_config', 1);
html_print_table ($table);

View File

@ -319,9 +319,9 @@ if (isset ($_GET["update_alert"])) {
$data[4] = $row["description"];
$data[5] = $row["times_fired"];
if ($row["last_fired"] != "01-01-1970 00:00:00") {
$data[6] = $row["last_fired"];
if (($row["last_fired"] != "1970-01-01 00:00:00") and ($row["last_fired"] != "01-01-1970 00:00:00")) {
$data[6] = ui_print_timestamp($row["last_fired"], true);
} else {
$data[6] = __('Never');
}

View File

@ -162,8 +162,8 @@ require_once("include_graph_dependencies.php");
include_graphs_dependencies($config['homedir'].'/');
// Updates autorefresh time
if (isset($_POST['refr'])){
config_update_value ('refr', get_parameter('refr', $config['refr']));
if (isset($_POST['vc_refr'])){
config_update_value ('vc_refr', get_parameter('vc_refr', $config['vc_refr']));
}
?>

View File

@ -243,6 +243,8 @@ function config_update_config () {
config_update_value ('collection_max_size', get_parameter('collection_max_size', $config['collection_max_size']));
config_update_value ('font_size', get_parameter('font_size', $config['font_size']));
config_update_value ('refr', get_parameter('refr', $config['refr']));
config_update_value ('vc_refr', get_parameter('vc_refr', $config['vc_refr']));
$enterprise = enterprise_include_once('include/functions_policies.php');
if ($enterprise !== ENTERPRISE_NOT_HOOK) {
@ -656,6 +658,14 @@ function config_process_config () {
config_update_value ('dbtype', 'mysql');
}
if (!isset ($config['vc_refr'])) {
config_update_value ('vc_refr', 60);
}
if (!isset ($config['refr'])) {
config_update_value ('refr', '');
}
/* Finally, check if any value was overwritten in a form */
config_update_config();
}

View File

@ -187,7 +187,11 @@ function visual_map_print_item($layoutData) {
}
echo '<div id="' . $id . '" class="item icon" style="left: 0px; top: 0px; text-align: center; color: ' . $color . '; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
if ($layoutData['image'] != null) {
// If match with protocol://direction
if (preg_match('/^(http:\/\/)((.)+)$/i', $text)){
echo '<a href="' . $label . '">' . '</a>' . '<br />';
}
if (($width != 0) && ($height != 0))
echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "width" => "$width", "height" => "$height"));
else
@ -724,6 +728,11 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
echo '<a style="' . ($layout_data['label_color'][0] == '#' ? 'color: '.$layout_data['label_color'].';' : '') . '" href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
$endTagA = true;
}
elseif (preg_match('/^(http:\/\/)((.)+)$/i', $layout_data['label'])){
// Link to an URL
echo '<a style="' . ($layout_data['label_color'][0] == '#' ? 'color: '.$layout_data['label_color'].';' : '') . '" href="' . $layout_data['label'] .'">';
$endTagA = true;
}
}
$img_style = array ();

View File

@ -94,9 +94,12 @@ if (check_acl ($config['id_user'], 0, "AR")) {
//Visual console
$menu["visualc"]["text"] = __('Visual console');
$menu["visualc"]["sec2"] = "operation/visual_console/index";
if (isset($config['refr'])){
$menu["visualc"]["refr"] = $config['refr'];
if (!empty($config['vc_refr'])){
$menu["visualc"]["refr"] = $config['vc_refr'];
}
else if (!empty($config['refr'])){
$menu["visualc"]["refr"] = $config['refr'];
}
else{
$menu["visualc"]["refr"] = 60;
}
@ -128,7 +131,10 @@ if (check_acl ($config['id_user'], 0, "AR")) {
}
$sub["operation/visual_console/render_view&amp;id=".$layout["id"]]["text"] = mb_substr ($name, 0, 19);
$sub["operation/visual_console/render_view&amp;id=".$layout["id"]]["title"] = $name;
if (isset($config['refr'])){
if (!empty($config['vc_refr'])){
$sub["operation/visual_console/render_view&amp;id=".$layout["id"]]["refr"] = $config['vc_refr'];
}
elseif (!empty($config['refr'])){
$sub["operation/visual_console/render_view&amp;id=".$layout["id"]]["refr"] = $config['refr'];
}
else{

View File

@ -24,6 +24,8 @@ ui_print_page_header (__("Visual console"), "images/monitor.png", false, "operat
require_once ('include/functions_visual_map.php');
require_once ('include/functions_groups.php');
$refr = get_parameter('refr', $config['vc_refr']);
$layouts = visual_map_get_user_layouts ();
$table->width = "98%";
@ -52,7 +54,7 @@ foreach ($layouts as $layout) {
$data = array ();
$data[0] = '<a href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;id='.
$layout['id'].'">'.$layout['name'].'</a> ';
$layout['id'].'&amp;refr=' . $refr . '">'.$layout['name'].'</a> ';
$data[1] = ui_print_group_icon ($layout["id_group"], true);
$data[2] = db_get_value ('COUNT(*)', 'tlayout_data', 'id_layout', $layout['id']);

View File

@ -20,6 +20,8 @@ require ('include/functions_visual_map.php');
check_login ();
$id_layout = (int) get_parameter ('id');
$refr = (int) get_parameter ('refr', $config['vc_refr']);
$vc_refr = false;
// Get input parameter for layout id
if (! $id_layout) {
@ -90,8 +92,19 @@ $table->data = array ();
$table->style = array ();
$table->style[2] = 'text-align: center';
$table->data[0][0] = __('Autorefresh time');
$table->data[0][1] = html_print_select ($values, 'refr', $config["refr"], '', 'N/A', 0, true, false, false);
if (empty($config["vc_refr"])){
$vc_refr = true;
$config["vc_refr"] = $refr;
}
$table->data[0][1] = html_print_select ($values, 'refr', $config["vc_refr"], '', 'N/A', 0, true, false, false);
$table->data[0][2] = html_print_submit_button (__('Refresh'), '', false, 'class="sub next"', true);
$table->data[0][2] .= html_print_input_hidden ('vc_refr', $config["vc_refr"], true);
if ($vc_refr){
$config["vc_refr"] = 0;
}
echo '<div style="height:30px">&nbsp;</div>';
@ -117,10 +130,15 @@ ui_require_javascript_file ('pandora_visual_console');
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$("#refr").change(function () {
$("#hidden-vc_refr").val($("#refr option:selected").val());
});
<?php if ($config["pure"] && $config["refr"] > 0): ?>
t = new Date();
t.setTime (t.getTime() + <?php echo $config["refr"] * 1000; ?>);
$("#countdown").countdown({until: t, format: 'MS', description: '<?php echo __('Until refresh'); ?>'});
<?php endif; ?>
draw_lines (lines, 'layout_map');
});