2014-05-27 Miguel de Dios <miguel.dedios@artica.es>

* extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
	godmode/reporting/visual_console_builder.editor.js,
	include/functions_custom_graphs.php,
	include/ajax/visual_console_builder.ajax.php,
	include/functions_graph.php, include/functions_visual_map.php,
	include/functions_visual_map_editor.php, pandoradb.sql,
	pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
	operation/reporting/graph_viewer.php, pandoradb_data.sql: added the
	custom graphs into the visualmaps.
	
	Incident: #367




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10018 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-05-27 12:59:56 +00:00
parent a79f029a4a
commit 449e24969c
15 changed files with 317 additions and 109 deletions

View File

@ -1,3 +1,19 @@
2014-05-27 Miguel de Dios <miguel.dedios@artica.es>
* extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
godmode/reporting/visual_console_builder.editor.js,
include/functions_custom_graphs.php,
include/ajax/visual_console_builder.ajax.php,
include/functions_graph.php, include/functions_visual_map.php,
include/functions_visual_map_editor.php, pandoradb.sql,
pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
operation/reporting/graph_viewer.php, pandoradb_data.sql: added the
custom graphs into the visualmaps.
Incident: #367
2014-05-27 Ramon Novoa <rnovoa@artica.es>
* godmode/agentes/module_manager_editor_network.php,

View File

@ -97,6 +97,7 @@ ALTER TABLE `tnetwork_map` ADD COLUMN `l2_network` tinyint(1) unsigned NOT NULL
-- Table `tlayout_data`
-- ---------------------------------------------------------------------
ALTER TABLE `tlayout_data` ADD COLUMN `id_group` INTEGER UNSIGNED NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `talert_snmp`

View File

@ -90,6 +90,7 @@ ALTER TABLE tnetwork_map ADD (l2_network NUMBER(1, 0) default 0 NOT NULL);
-- Table `tlayout_data`
-- ---------------------------------------------------------------------
ALTER TABLE `tlayout_data` ADD COLUMN id_group NUMBER(10, 0) default 0 NOT NULL;
ALTER TABLE `tlayout_data` ADD COLUMN id_custom_graph NUMBER(10, 0) default 0 NOT NULL;
-- ---------------------------------------------------------------------
-- Table `talert_snmp`

View File

@ -87,6 +87,7 @@ ALTER TABLE "tnetwork_map" ADD COLUMN "l2_network" SMALLINT NOT NULL default 0;
-- Table `tlayout_data`
-- ---------------------------------------------------------------------
ALTER TABLE "tlayout_data" ADD COLUMN "id_group" INTEGER NOT NULL default 0;
ALTER TABLE "tlayout_data" ADD COLUMN "id_custom_graph" INTEGER NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table talert_snmp_action

View File

@ -53,6 +53,21 @@ function visual_map_main() {
draw_lines(lines, 'background', true);
}
);
$("input[name='radio_choice']").on('change', function() {
var radio_value = $("input[name='radio_choice']:checked").val();
if (radio_value == "module_graph") {
$("#custom_graph_row").css('display', 'none');
$("#agent_row").css('display', '');
$("#module_row").css('display', '');
}
else {
$("#custom_graph_row").css('display', '');
$("#agent_row").css('display', 'none');
$("#module_row").css('display', 'none');
}
});
}
function cancel_button_palette_callback() {
@ -221,6 +236,8 @@ function readFields() {
values['value_show'] = $("input[name=value_show]:checked").val();
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
values['id_group'] = $("select[name=group]").val();
values['id_custom_graph'] = parseInt(
$("#custom_graph option:selected").val());
if (metaconsole != 0) {
values['metaconsole'] = 1;
@ -286,6 +303,7 @@ function create_button_palette_callback() {
}
break;
case 'module_graph':
if (values['id_custom_graph'] == 0) {
if ((values['agent'] == '')) {
alert($("#message_alert_no_agent").html());
validate = false;
@ -298,6 +316,7 @@ function create_button_palette_callback() {
alert($("#message_alert_no_period").html());
validate = false;
}
}
break;
case 'simple_value':
if ((values['agent'] == '')) {
@ -369,6 +388,9 @@ function toggle_item_palette() {
enterprise_activeToolboxButton(false);
}
if (creationItem != null) {
//Create a item
@ -394,6 +416,8 @@ function toggle_item_palette() {
hiddenFields(item);
$("#properties_panel").show("fast");
}
}
@ -422,9 +446,11 @@ function loadFieldsFromDB(item) {
}
parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "page",
value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "load"});
parameter.push ({name: "id_visual_console", value: id_visual_console});
parameter.push ({name: "id_visual_console",
value: id_visual_console});
parameter.push ({name: "type", value: item});
parameter.push ({name: "id_element", value: idItem});
@ -441,11 +467,13 @@ function loadFieldsFromDB(item) {
var moduleId = 0;
fill_parent_select(idItem);
console.log(data);
jQuery.each(data, function(key, val) {
if (key == 'background') $("#background_image").val(val);
if (key == 'background')
$("#background_image").val(val);
if (key == 'width') $("input[name=width]").val(val);
if (key == 'height') $("input[name=height]").val(val);
if (key == 'height')
$("input[name=height]").val(val);
if (key == 'label') {
tinymce.get('text-label')
@ -548,6 +576,15 @@ function loadFieldsFromDB(item) {
$("select[name=group]").val(val);
}
if (key == 'id_custom_graph') {
$("input[name='radio_choice'][value='custom_graph']")
.prop('checked', true);
$("input[name='radio_choice']").trigger('change');
$("#custom_graph option[value=" + val + "]")
.prop("selected", true);
}
if (metaconsole != 0) {
if (key == 'id_agent') {
$("#hidden-agent").val(val);
@ -561,6 +598,9 @@ function loadFieldsFromDB(item) {
if (typeof(enterprise_loadFieldsFromDB) == 'function') {
enterprise_loadFieldsFromDB(data);
}
}
});
}
@ -695,6 +735,14 @@ function hiddenFields(item) {
$("#module_graph_size_row").css('display', 'none');
$("#module_graph_size_row." + item).css('display', '');
$("#radio_choice_graph").css('display', 'none');
$("#radio_choice_graph." + item).css('display', '');
$("#custom_graph_row").css('display', 'none');
$("#custom_graph_row." + item).css('display', '');
$("input[name='radio_choice']").trigger('change');
if (typeof(enterprise_hiddenFields) == 'function') {
enterprise_hiddenFields(item);
}
@ -731,7 +779,19 @@ function cleanFields(item) {
fill_parent_select();
var anyText = $("#any_text").html(); //Trick for catch the translate text.
$("#module").empty().append($('<option value="0" selected="selected">' + anyText + '</option></select>'));
$("#module")
.empty()
.append($('<option value="0" selected="selected">' + anyText + '</option></select>'));
//Code for the graphs
$("input[name='radio_choice'][value='module_graph']")
.prop('checked', true);
$("input[name='radio_choice']").trigger('change');
//Select none custom graph
$("#custom_graph option[value=0]")
.prop('selected', true);
}
function getModuleGraph(id_data) {
@ -744,7 +804,8 @@ function getModuleGraph(id_data) {
var parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "page",
value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_layout_data"});
parameter.push ({name: "id_element", value: id_data});
jQuery.ajax({
@ -756,6 +817,7 @@ function getModuleGraph(id_data) {
success: function (data)
{
id_agente_modulo = data['id_agente_modulo'];
id_custom_graph = data['id_custom_graph'];
label = data['label'];
height = data['height'];
width = data['width'];
@ -769,9 +831,11 @@ function getModuleGraph(id_data) {
//Cleaned array
parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "page",
value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_image_sparse"});
parameter.push ({name: "id_agent_module", value: id_agente_modulo});
parameter.push ({name: "id_custom_graph", value: id_custom_graph});
if (metaconsole != 0) {
parameter.push ({name: "id_metaconsole", value: id_metaconsole});
}
@ -1457,9 +1521,11 @@ function updateDB(type, idElement , values, event) {
}
parameter = Array();
parameter.push({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push({name: "page",
value: "include/ajax/visual_console_builder.ajax"});
parameter.push({name: "action", value: action});
parameter.push({name: "id_visual_console", value: id_visual_console});
parameter.push({name: "id_visual_console",
value: id_visual_console});
parameter.push({name: "type", value: type});
parameter.push({name: "id_element", value: idElement});

View File

@ -33,6 +33,7 @@ $ajax = true;
require_once('include/functions_visual_map.php');
require_once($config['homedir'] . "/include/functions_agents.php");
require_once($config['homedir'] . '/include/functions_graph.php');
require_once($config['homedir'] . '/include/functions_custom_graphs.php');
enterprise_include_once('include/functions_visual_map.php');
$action = get_parameter('action');
@ -69,6 +70,7 @@ $server_id = (int)get_parameter('server_id', 0);
$id_agent = get_parameter('id_agent', null);
$id_metaconsole = get_parameter('id_metaconsole', null);
$id_group = (int)get_parameter('id_group', 0);
$id_custom_graph = get_parameter('id_custom_graph', null);
$get_element_status = get_parameter('get_element_status', 0);
$get_image_path_status = get_parameter('get_image_path_status', 0);
@ -95,9 +97,16 @@ switch ($action) {
}
}
if ($id_custom_graph != 0) {
$img = custom_graphs_print(
$id_custom_graph, $height, $width, $period,
true, true, 0, true);
}
else {
$img = grafico_modulo_sparse($id_agent_module,
$period, false, $width, $height, '', null, false, 1, false, 0, '', 0, 0,
true, true);
$period, false, $width, $height, '', null, false, 1,
false, 0, '', 0, 0, true, true);
}
//Restore db connection
if (!empty($id_metaconsole)) {
@ -380,6 +389,9 @@ switch ($action) {
if ($period !== null) {
$values['period'] = $period;
}
if ($id_custom_graph !== null) {
$values['id_custom_graph'] = $id_custom_graph;
}
break;
case 'percentile_item':
case 'percentile_bar':
@ -584,6 +596,8 @@ switch ($action) {
$values['no_link_color'] = 1;
$values['enable_link'] = $enable_link;
$values['id_custom_graph'] = $id_custom_graph;
switch ($type) {
case 'module_graph':
$values['type'] = MODULE_GRAPH;

View File

@ -70,7 +70,9 @@ function custom_graphs_get_user ($id_user = 0, $only_names = false, $returnAllGr
}
else {
$graphs[$graph['id_graph']] = $graph;
$graphsCount = db_get_value_sql("SELECT COUNT(id_gs) FROM tgraph_source WHERE id_graph = " . $graph['id_graph']);
$graphsCount = db_get_value_sql("SELECT COUNT(id_gs)
FROM tgraph_source
WHERE id_graph = " . $graph['id_graph']);
$graphs[$graph['id_graph']]['graphs_count'] = $graphsCount;
}
}
@ -90,15 +92,17 @@ function custom_graphs_get_user ($id_user = 0, $only_names = false, $returnAllGr
* @param $date Date to start printing the graph
*/
function custom_graphs_print ($id_graph, $height, $width, $period, $stacked, $return = false, $date = 0) {
function custom_graphs_print($id_graph, $height, $width, $period,
$stacked, $return = false, $date = 0, $only_image = false) {
global $config;
$sources = db_get_all_rows_field_filter ('tgraph_source', 'id_graph', $id_graph);
$sources = db_get_all_rows_field_filter('tgraph_source', 'id_graph',
$id_graph);
$modules = array ();
$weights = array ();
if($sources === false) {
echo "<div class='nf'>".__('Empty graph')."</div>";
if ($sources === false) {
echo "<div class='nf'>" . __('Empty graph') . "</div>";
return;
}
@ -107,8 +111,8 @@ function custom_graphs_print ($id_graph, $height, $width, $period, $stacked, $re
array_push ($weights, $source['weight']);
}
$output = graphic_combined_module($modules, $weights, $period, $width, $height,
'', '', 0, 0, 0, $stacked, $date);
$output = graphic_combined_module($modules, $weights, $period,
$width, $height, '', '', 0, 0, 0, $stacked, $date, $only_image);
if ($return)
return $output;

View File

@ -857,9 +857,12 @@ function graph_get_formatted_date($timestamp, $format1, $format2) {
*
* @return Mixed
*/
function graphic_combined_module ($module_list, $weight_list, $period, $width, $height,
$title, $unit_name, $show_events = 0, $show_alerts = 0, $pure = 0,
$stacked = 0, $date = 0, $only_image = false, $homeurl = '', $ttl = 1, $projection = false, $prediction_period = false) {
function graphic_combined_module ($module_list, $weight_list, $period,
$width, $height, $title, $unit_name, $show_events = 0,
$show_alerts = 0, $pure = 0, $stacked = 0, $date = 0,
$only_image = false, $homeurl = '', $ttl = 1, $projection = false,
$prediction_period = false) {
global $config;
global $graphic_type;
@ -1204,8 +1207,12 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
$last = $graph_stats['last'];
$units = modules_get_unit($agent_module_id);
if ($projection == false or ($projection != false and $i == 0)){
$module_name_list[$i] .= ": ".__('Last').": $last $units; ".__("Max").": $max $units; ".__("Min").": $min $units; ". __("Avg").": $avg";
if ($projection == false or ($projection != false and $i == 0)) {
$module_name_list[$i] .= ": " .
__('Last') . ": $last $units; " .
__("Max") . ": $max $units; " .
__("Min") . ": $min $units; " .
__("Avg") . ": $avg";
}
if ($weight_list[$i] != 1) {
@ -1253,21 +1260,36 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
$color = array();
$color[0] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
$color[1] = array('border' => '#000000', 'color' => $config['graph_color2'], 'alpha' => 50);
$color[2] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
$color[3] = array('border' => '#000000', 'color' => $config['graph_color4'], 'alpha' => 50);
$color[4] = array('border' => '#000000', 'color' => $config['graph_color5'], 'alpha' => 50);
$color[5] = array('border' => '#000000', 'color' => $config['graph_color6'], 'alpha' => 50);
$color[6] = array('border' => '#000000', 'color' => $config['graph_color7'], 'alpha' => 50);
$color[7] = array('border' => '#000000', 'color' => $config['graph_color8'], 'alpha' => 50);
$color[8] = array('border' => '#000000', 'color' => $config['graph_color9'], 'alpha' => 50);
$color[9] = array('border' => '#000000', 'color' => $config['graph_color10'], 'alpha' => 50);
$color[11] = array('border' => '#000000', 'color' => COL_GRAPH9, 'alpha' => 50);
$color[12] = array('border' => '#000000', 'color' => COL_GRAPH10, 'alpha' => 50);
$color[13] = array('border' => '#000000', 'color' => COL_GRAPH11, 'alpha' => 50);
$color[14] = array('border' => '#000000', 'color' => COL_GRAPH12, 'alpha' => 50);
$color[15] = array('border' => '#000000', 'color' => COL_GRAPH13, 'alpha' => 50);
$color[0] = array('border' => '#000000',
'color' => $config['graph_color1'], 'alpha' => 50);
$color[1] = array('border' => '#000000',
'color' => $config['graph_color2'], 'alpha' => 50);
$color[2] = array('border' => '#000000',
'color' => $config['graph_color3'], 'alpha' => 50);
$color[3] = array('border' => '#000000',
'color' => $config['graph_color4'], 'alpha' => 50);
$color[4] = array('border' => '#000000',
'color' => $config['graph_color5'], 'alpha' => 50);
$color[5] = array('border' => '#000000',
'color' => $config['graph_color6'], 'alpha' => 50);
$color[6] = array('border' => '#000000',
'color' => $config['graph_color7'], 'alpha' => 50);
$color[7] = array('border' => '#000000',
'color' => $config['graph_color8'], 'alpha' => 50);
$color[8] = array('border' => '#000000',
'color' => $config['graph_color9'], 'alpha' => 50);
$color[9] = array('border' => '#000000',
'color' => $config['graph_color10'], 'alpha' => 50);
$color[11] = array('border' => '#000000',
'color' => COL_GRAPH9, 'alpha' => 50);
$color[12] = array('border' => '#000000',
'color' => COL_GRAPH10, 'alpha' => 50);
$color[13] = array('border' => '#000000',
'color' => COL_GRAPH11, 'alpha' => 50);
$color[14] = array('border' => '#000000',
'color' => COL_GRAPH12, 'alpha' => 50);
$color[15] = array('border' => '#000000',
'color' => COL_GRAPH13, 'alpha' => 50);
switch ($stacked) {
case GRAPH_AREA:

View File

@ -51,6 +51,7 @@ function visual_map_print_item($layoutData) {
global $config;
require_once ($config["homedir"] . '/include/functions_graph.php');
require_once ($config["homedir"] . '/include/functions_custom_graphs.php');
$width = $layoutData['width'];
$height = $max_percentile = $layoutData['height'];
@ -215,8 +216,15 @@ function visual_map_print_item($layoutData) {
}
}
if ($layoutData['id_custom_graph'] != 0) {
$img = custom_graphs_print(
$layoutData['id_custom_graph'], $height, $width,
$period, true, true, 0, true);
}
else {
$img = grafico_modulo_sparse($id_module, $period, 0, $width,
$height, '', null, false, 1, false, 0, '', 0, 0, true, true);
}
//Restore db connection
if ($layoutData['id_metaconsole'] != 0) {
@ -1029,6 +1037,8 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
enterprise_include_once("meta/include/functions_ui_meta.php");
require_once ($config["homedir"] . '/include/functions_custom_graphs.php');
$layout = db_get_row ('tlayout', 'id', $id_layout);
if (empty($layout)) {
@ -1939,11 +1949,11 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
$url = ui_meta_get_url_console_child(
$layout_data['id_metaconsole'],
"estado", 'operation/agentes/ver_agente&amp;id_agente='.$layout_data["id_agent"].'&amp;tab=data');
}
echo '<a href="' . $url . '">';
}
}
}
}
else {
// Link to a map
if (empty($layout_data['id_metaconsole'])) {
@ -1969,10 +1979,20 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
// ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work
// resulting fault image links :(
if ($layout_data['id_custom_graph'] != 0) {
custom_graphs_print(
$layout_data['id_custom_graph'],
$layout_data['height'],
$layout_data['width'],
$layout_data['period'], true, false, 0, true);
}
else {
echo grafico_modulo_sparse ($layout_data['id_agente_modulo'], $layout_data['period'],
false, $layout_data['width'], $layout_data['height'],
'', null, false, 1, false, 0, '', 0, 0, true, true, $home_url, 1);
}
//Restore db connection
if ($layout_data['id_metaconsole'] != 0) {
metaconsole_restore_db();

View File

@ -53,8 +53,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'background' => __('Background'),
'static_graph' => __('Static Graph'),
'percentile_item' => __('Percentile Item'),
'module_graph' => __('Module Graph'),
'module_graph' => __('Module Graph'),
'module_graph' => __('Graph'),
'simple_value' => __('Simple value'),
'label' => __('Label'),
'icon' => __('Icon'));
@ -86,8 +85,10 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'datos',
'icon',
'group_item');
$form_items['label_row']['html'] = '<td align="left" valign="top" style="">' . __('Label') .'</td>
<td align="left" style="">'. html_print_input_text ('label', '', '', 20, 200, true) .'</td>';
$form_items['label_row']['html'] =
'<td align="left" valign="top" style="">' . __('Label') . '</td>
<td align="left" style="">' .
html_print_input_text('label', '', '', 20, 200, true) . '</td>';
$form_items['image_row'] = array();
@ -95,8 +96,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'icon',
'datos',
'group_item');
$form_items['image_row']['html'] = '<td align="left">' . __('Image') . '</td>
<td align="left">'. html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '', true) .'</td>';
$form_items['image_row']['html'] =
'<td align="left">' . __('Image') . '</td>
<td align="left">' .
html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '', true) .
'</td>';
$form_items['enable_link_row'] = array();
@ -109,22 +113,56 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'datos',
'icon',
'group_item');
$form_items['enable_link_row']['html'] = '<td align="left" style="">' . __('Enable link') .'</td>
<td align="left" style="">'. html_print_checkbox('enable_link', '', 'enable_link', true) .'</td>';
$form_items['enable_link_row']['html'] =
'<td align="left" style="">' . __('Enable link') . '</td>
<td align="left" style="">' .
html_print_checkbox('enable_link', '', 'enable_link', true) . '</td>';
$form_items['preview_row'] = array();
$form_items['preview_row']['items'] = array('static_graph',
'datos icon',
'group_item');
$form_items['preview_row']['html'] = '<td align="left" colspan="2" style="text-align: right;"><div id="preview" style="text-align: right;"></div></td>';
$form_items['preview_row']['html'] =
'<td align="left" colspan="2" style="text-align: right;">' .
'<div id="preview" style="text-align: right;"></div></td>';
$form_items['radio_choice_graph'] = array();
$form_items['radio_choice_graph']['items'] = array(
'module_graph',
'datos');
$form_items['radio_choice_graph']['html'] =
'<td align="left" style=""></td>
<td align="left" style="">' .
html_print_radio_button('radio_choice',
'module_graph', __('Module graph'), 'module_graph',
true) .
html_print_radio_button('radio_choice',
'custom_graph', __('Custom graph'), 'module_graph',
true) .
'</td>';
$form_items['custom_graph_row'] = array();
$form_items['custom_graph_row']['items'] = array(
'module_graph',
'datos');
$form_items['custom_graph_row']['html'] =
'<td align="left" style="">' . __('Custom graph') . '</td>
<td align="left" style="">' .
html_print_select_from_sql(
"SELECT id_graph, name FROM tgraph", 'custom_graph',
'', '', __('None'), 0, true) .
'</td>';
$form_items['agent_row'] = array();
$form_items['agent_row']['items'] = array('static_graph',
'percentile_bar', 'percentile_item', 'module_graph',
'simple_value', 'datos');
$form_items['agent_row']['html'] = '<td align="left">' . __('Agent') . '</td>';
$form_items['agent_row']['html'] = '<td align="left">' .
__('Agent') . '</td>';
$params = array();
$params['return'] = true;
$params['show_helptip'] = true;
@ -156,8 +194,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['module_row']['items'] = array('static_graph',
'percentile_bar', 'percentile_item', 'module_graph',
'simple_value', 'datos');
$form_items['module_row']['html'] = '<td align="left">' . __('Module') . '</td>
<td align="left">' . html_print_select (array(), 'module', '', '', __('Any'), 0, true) . '</td>';
$form_items['module_row']['html'] = '<td align="left">' .
__('Module') . '</td>
<td align="left">' .
html_print_select(array(), 'module', '', '', __('Any'), 0, true) .
'</td>';
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "PM"))
@ -178,7 +219,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['process_value_row'] = array();
$form_items['process_value_row']['items'] = array('simple_value', 'datos');
$form_items['process_value_row']['html'] = '<td align="left"><span>' . __('Process') . '</span></td>
$form_items['process_value_row']['html'] = '<td align="left"><span>' .
__('Process') . '</span></td>
<td align="left">'. html_print_select (
array (PROCESS_VALUE_MIN => __('Min value'),
PROCESS_VALUE_MAX => __('Max value'),
@ -188,19 +230,22 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['background_row_1'] = array();
$form_items['background_row_1']['items'] = array('background', 'datos');
$form_items['background_row_1']['html'] = '<td align="left">' . __('Background') . '</td>
$form_items['background_row_1']['html'] = '<td align="left">' .
__('Background') . '</td>
<td align="left">' . html_print_select($backgrounds_list, 'background_image', $background, '', 'None', '', true) . '</td>';
$form_items['background_row_2'] = array();
$form_items['background_row_2']['items'] = array('background', 'datos');
$form_items['background_row_2']['html'] = '<td align="left">' . __('Original Size') . '</td>
$form_items['background_row_2']['html'] = '<td align="left">' .
__('Original Size') . '</td>
<td align="left">' . html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub"', true) . '</td>';
$form_items['background_row_3'] = array();
$form_items['background_row_3']['items'] = array('background', 'datos');
$form_items['background_row_3']['html'] = '<td align="left">' . __('Aspect ratio') . '</td>
$form_items['background_row_3']['html'] = '<td align="left">' .
__('Aspect ratio') . '</td>
<td align="left">' . html_print_button(__('Width proportional'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub"', true) . '</td>';
@ -212,19 +257,22 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['percentile_bar_row_1'] = array();
$form_items['percentile_bar_row_1']['items'] = array('percentile_bar', 'percentile_item', 'datos');
$form_items['percentile_bar_row_1']['html'] = '<td align="left">' . __('Width') . '</td>
$form_items['percentile_bar_row_1']['html'] = '<td align="left">' .
__('Width') . '</td>
<td align="left">' . html_print_input_text('width_percentile', 0, '', 3, 5, true) . '</td>';
$form_items['percentile_bar_row_2'] = array();
$form_items['percentile_bar_row_2']['items'] = array('percentile_bar', 'percentile_item', 'datos');
$form_items['percentile_bar_row_2']['html'] = '<td align="left">' . __('Max value') . '</td>
$form_items['percentile_bar_row_2']['html'] = '<td align="left">' .
__('Max value') . '</td>
<td align="left">' . html_print_input_text('max_percentile', 0, '', 3, 5, true) . '</td>';
$form_items['percentile_item_row_3'] = array();
$form_items['percentile_item_row_3']['items'] = array('percentile_bar', 'percentile_item', 'datos');
$form_items['percentile_item_row_3']['html'] = '<td align="left">' . __('Type') . '</td>
$form_items['percentile_item_row_3']['html'] = '<td align="left">' .
__('Type') . '</td>
<td align="left">' .
html_print_radio_button_extended('type_percentile', 'percentile', ('Percentile'), 'percentile', false, '', 'style="float: left;"', true) .
html_print_radio_button_extended('type_percentile', 'bubble', ('Bubble'), 'percentile', false, '', 'style="float: left;"', true) .
@ -417,17 +465,28 @@ function visual_map_editor_print_hack_translate_strings() {
echo '<span id="ip_text" style="display: none;">' . __('IP') . '</span>';
//Hack to translate messages in javascript
echo '<span style="display: none" id="message_alert_no_label_no_image">' . __('No image or name defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_label">' . __('No label defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_image">' . __('No image defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_process">' . __('No process defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_max_percentile">' . __('No Max value defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_width_percentile">' . __('No width defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_period">' . __('No period defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_agent">' . __('No agent defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_module">' . __('No module defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_label_no_image">' .
__('No image or name defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_label">' .
__('No label defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_image">' .
__('No image defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_process">' .
__('No process defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_max_percentile">' .
__('No Max value defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_width_percentile">' .
__('No width defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_period">' .
__('No period defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_agent">' .
__('No agent defined.') .'</span>';
echo '<span style="display: none" id="message_alert_no_module">' .
__('No module defined.') .'</span>';
echo '<span style="display: none" id="hack_translation_correct_save">' . __('Successfully save the changes.') .'</span>';
echo '<span style="display: none" id="hack_translation_incorrect_save">' . __('Could not be save') .'</span>';
echo '<span style="display: none" id="hack_translation_correct_save">' .
__('Successfully save the changes.') .'</span>';
echo '<span style="display: none" id="hack_translation_incorrect_save">' .
__('Could not be save') .'</span>';
}
?>

View File

@ -144,7 +144,8 @@ if ($view_graph) {
echo "<table class='databox_frame' cellpadding='0' cellspacing='0' width='98%'>";
echo "<tr><td>";
custom_graphs_print ($id_graph, $height, $width, $period, $stacked, false, $unixdate);
custom_graphs_print($id_graph, $height, $width, $period, $stacked,
false, $unixdate);
echo "</td></tr></table>";
$period_label = human_time_description_raw ($period);
echo "<form method='POST' action='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=$id_graph'>";

View File

@ -1244,7 +1244,8 @@ CREATE TABLE tlayout_data (
no_link_color NUMBER(5, 0) default 0 NOT NULL,
enable_link NUMBER(5, 0) default 1 NOT NULL,
id_metaconsole NUMBER(10, 0) default 0 NOT NULL,
id_group NUMBER(10, 0) default 0 NOT NULL
id_group NUMBER(10, 0) default 0 NOT NULL,
id_custom_graph NUMBER(10, 0) default 0 NOT NULL
);
CREATE SEQUENCE tlayout_data_s INCREMENT BY 1 START WITH 1;
CREATE OR REPLACE TRIGGER tlayout_data_inc BEFORE INSERT ON tlayout_data REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tlayout_data_s.nextval INTO :NEW.ID FROM dual; END tlayout_data_inc;;

View File

@ -1095,7 +1095,8 @@ CREATE TABLE "tlayout_data" (
"no_link_color" SMALLINT NOT NULL default 0,
"enable_link" SMALLINT NOT NULL default 1,
"id_metaconsole" INTEGER NOT NULL default 0,
"id_group" INTEGER NOT NULL default 0
"id_group" INTEGER NOT NULL default 0,
"id_custom_graph" INTEGER NOT NULL default 0
);
-- ---------------------------------------------------------------------

View File

@ -24,9 +24,9 @@
-- Priority : 3 - Warning (yellow)
-- Priority : 4 - Critical (red)
-- ----------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Table `taddress`
-- ----------------------------------------------------------------------
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `taddress` (
`id_a` int(10) unsigned NOT NULL auto_increment,
`ip` varchar(60) NOT NULL default '',
@ -35,9 +35,9 @@ CREATE TABLE IF NOT EXISTS `taddress` (
KEY `ip` (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Table `taddress_agent`
-- ----------------------------------------------------------------------
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `taddress_agent` (
`id_ag` bigint(20) unsigned NOT NULL auto_increment,
`id_a` bigint(20) unsigned NOT NULL default '0',
@ -45,9 +45,9 @@ CREATE TABLE IF NOT EXISTS `taddress_agent` (
PRIMARY KEY (`id_ag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Table `tagente`
-- ----------------------------------------------------------------------
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagente` (
`id_agente` int(10) unsigned NOT NULL auto_increment,
`nombre` varchar(600) BINARY NOT NULL default '',
@ -87,9 +87,9 @@ CREATE TABLE IF NOT EXISTS `tagente` (
KEY `id_grupo` (`id_grupo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
-- -----------------------------------------------------
-- ---------------------------------------------------------------------
-- Table `tagente_datos`
-- -----------------------------------------------------
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagente_datos` (
`id_agente_modulo` int(10) unsigned NOT NULL default '0',
`datos` double(22,2) default NULL,
@ -98,9 +98,9 @@ CREATE TABLE IF NOT EXISTS `tagente_datos` (
KEY `idx_utimestamp` USING BTREE (`utimestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
-- -----------------------------------------------------
-- ---------------------------------------------------------------------
-- Table `tagente_datos_inc`
-- -----------------------------------------------------
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagente_datos_inc` (
`id_agente_modulo` int(10) unsigned NOT NULL default '0',
`datos` double(22,2) default NULL,
@ -108,9 +108,9 @@ CREATE TABLE IF NOT EXISTS `tagente_datos_inc` (
KEY `data_inc_index_1` (`id_agente_modulo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- ---------------------------------------------------------------------
-- Table `tagente_datos_string`
-- -----------------------------------------------------
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagente_datos_string` (
`id_agente_modulo` int(10) unsigned NOT NULL default '0',
`datos` text NOT NULL,
@ -1185,6 +1185,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
`enable_link` tinyint(1) UNSIGNED NOT NULL default 1,
`id_metaconsole` int(10) NOT NULL default 0,
`id_group` INTEGER UNSIGNED NOT NULL default 0,
`id_custom_graph` INTEGER UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -37,7 +37,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('graph_res','5'),
('step_compact','1'),
('db_scheme_version','5.1dev'),
('db_scheme_build','PD140527'),
('db_scheme_build','PD140526'),
('show_unknown','0'),
('show_lastalerts','1'),
('style','pandora'),