pandorafms/pandora_console/include/graphs/fgraph.php

518 lines
17 KiB
PHP
Raw Normal View History

<?php
// Copyright (c) 2011-2011 Ártica Soluciones Tecnológicas
// http://www.artica.es <info@artica.es>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
$ttl = 1;
$homeurl = '';
/*function include_graphs_dependencies($home_url = '', $serialize_ttl = 1) {
global $ttl;
global $homeurl;
$ttl = $serialize_ttl;
$homeurl = $home_url;
include_once($homeurl . 'include/functions.php');
include_once($homeurl . 'include/functions_html.php');
include_once($homeurl . 'include/graphs/functions_fsgraph.php');
include_once($homeurl . 'include/graphs/functions_gd.php');
include_once($homeurl . 'include/graphs/functions_utils.php');
}*/
/*
// If is called from index
if(file_exists('include/functions.php')) {
include_once('include/functions.php');
include_once('include/graphs/functions_fsgraph.php');
include_once('include/graphs/functions_utils.php');
} // If is called through url
else if(file_exists('../functions.php')) {
include_once('../functions.php');
include_once('../functions_html.php');
include_once('functions_fsgraph.php');
include_once('functions_gd.php');
include_once('functions_utils.php');
}
include_once('functions_fsgraph.php');
include_once('functions_utils.php');
*/
if (isset($_GET['homeurl'])) {
$homeurl = $_GET['homeurl'];
}
else $homeurl = '';
if (isset($_GET['ttl'])) {
$ttl = $_GET['ttl'];
}
else $ttl_param = 1;
if (isset($_GET['graph_type'])) {
$graph_type = $_GET['graph_type'];
}
else $graph_type = '';
//$graph_type = get_parameter('graph_type', '');
//$ttl_param = get_parameter('ttl', 1);
//$homeurl_param = get_parameter('homeurl', '');
// Turn on output buffering.
// The entire buffer will be discarded later so that any accidental output
// does not corrupt images generated by fgraph.
ob_start ();
if (!empty($graph_type)) {
include_once($homeurl . 'include/functions.php');
include_once($homeurl . 'include/functions_html.php');
include_once($homeurl . 'include/graphs/functions_gd.php');
include_once($homeurl . 'include/graphs/functions_utils.php');
}
// Clean the output buffer and turn off output buffering
ob_end_clean ();
switch($graph_type) {
case 'histogram':
$width = get_parameter('width');
$height = get_parameter('height');
$font = get_parameter('font');
$data = json_decode(io_safe_output(get_parameter('data')), true);
2012-03-05 Miguel de Dios <miguel.dedios@artica.es> * extensions/update_manager/main.php, general/shortcut_bar.php, godmode/reporting/reporting_builder.item_editor.php, godmode/reporting/reporting_builder.php, godmode/reporting/reporting_builder.preview.php, include/functions_api.php, include/functions_html.php, include/htmlawed.php, include/pchart_graph.php, operation/events/events_list.php, operation/netflow/nf_live_view.php: cleaned source code style. * godmode/menu.php, godmode/agentes/manage_config_remote.php: removed the enterprise feature that have been wrong for years. * general/header.php: changed to load the jquery-ui and jquery javascript library to last version. * extensions/insert_data.php, extensions/snmp_explorer.php, godmode/agentes/agent_manager.php, include/ajax/agent.php, include/javascript/pandora.js, operation/agentes/exportdata.php, operation/events/events.php: changed the unknow plugin autocomplete for the autocomple from jquery-ui. * include/functions_ui.php: cleaned source code style and into the function "ui_process_page_head" added the blacklist hardwrote for to use old jquery. * include/styles/jquery-ui-1.8.17.custom.css, include/javascript/jquery-1.7.1.min.js, include/javascript/jquery.jquery-ui-1.8.17.custom.min.js: added the last version of Jquery and Jquery-ui. Merge from the branch "pandora_4.0" * godmode/reporting/visual_console_builder.constans.php, godmode/reporting/visual_console_builder.editor.js, godmode/reporting/visual_console_builder.editor.php, include/functions_visual_map.php, include/ajax/visual_console_builder.ajax.php, include/javascript/pandora_visual_console.js: changed the unknow plugin autocomplete for the autocomple from jquery-ui and added function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the name "progress_bubble". * images/percentile_item.disabled.png, images/percentile_item.png: added images for button of percentile item (new item in visual map). * include/styles/pandora.css: added the style for the new button percentile item. * include/functions_graph.php, include/graphs/fgraph.php, include/graphs/functions_gd.php: cleaned source code style, and added the params to set text and color in the function "progress_bar" and added function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the name "progress_bubble". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5693 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-03-05 18:56:56 +01:00
$max = get_parameter('max');
$title = get_parameter('title');
$mode = get_parameter ('mode', 1);
gd_histogram ($width, $height, $mode, $data, $max, $font, $title);
break;
case 'progressbar':
$width = get_parameter('width');
$height = get_parameter('height');
$progress = get_parameter('progress');
$out_of_lim_str = get_parameter('out_of_lim_str', false);
$out_of_lim_image = get_parameter('out_of_lim_image', false);
2012-03-05 Miguel de Dios <miguel.dedios@artica.es> * extensions/update_manager/main.php, general/shortcut_bar.php, godmode/reporting/reporting_builder.item_editor.php, godmode/reporting/reporting_builder.php, godmode/reporting/reporting_builder.preview.php, include/functions_api.php, include/functions_html.php, include/htmlawed.php, include/pchart_graph.php, operation/events/events_list.php, operation/netflow/nf_live_view.php: cleaned source code style. * godmode/menu.php, godmode/agentes/manage_config_remote.php: removed the enterprise feature that have been wrong for years. * general/header.php: changed to load the jquery-ui and jquery javascript library to last version. * extensions/insert_data.php, extensions/snmp_explorer.php, godmode/agentes/agent_manager.php, include/ajax/agent.php, include/javascript/pandora.js, operation/agentes/exportdata.php, operation/events/events.php: changed the unknow plugin autocomplete for the autocomple from jquery-ui. * include/functions_ui.php: cleaned source code style and into the function "ui_process_page_head" added the blacklist hardwrote for to use old jquery. * include/styles/jquery-ui-1.8.17.custom.css, include/javascript/jquery-1.7.1.min.js, include/javascript/jquery.jquery-ui-1.8.17.custom.min.js: added the last version of Jquery and Jquery-ui. Merge from the branch "pandora_4.0" * godmode/reporting/visual_console_builder.constans.php, godmode/reporting/visual_console_builder.editor.js, godmode/reporting/visual_console_builder.editor.php, include/functions_visual_map.php, include/ajax/visual_console_builder.ajax.php, include/javascript/pandora_visual_console.js: changed the unknow plugin autocomplete for the autocomple from jquery-ui and added function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the name "progress_bubble". * images/percentile_item.disabled.png, images/percentile_item.png: added images for button of percentile item (new item in visual map). * include/styles/pandora.css: added the style for the new button percentile item. * include/functions_graph.php, include/graphs/fgraph.php, include/graphs/functions_gd.php: cleaned source code style, and added the params to set text and color in the function "progress_bar" and added function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the name "progress_bubble". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5693 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-03-05 18:56:56 +01:00
$font = get_parameter('font');
$title = get_parameter('title');
$mode = get_parameter('mode', 1);
2012-03-05 Miguel de Dios <miguel.dedios@artica.es> * extensions/update_manager/main.php, general/shortcut_bar.php, godmode/reporting/reporting_builder.item_editor.php, godmode/reporting/reporting_builder.php, godmode/reporting/reporting_builder.preview.php, include/functions_api.php, include/functions_html.php, include/htmlawed.php, include/pchart_graph.php, operation/events/events_list.php, operation/netflow/nf_live_view.php: cleaned source code style. * godmode/menu.php, godmode/agentes/manage_config_remote.php: removed the enterprise feature that have been wrong for years. * general/header.php: changed to load the jquery-ui and jquery javascript library to last version. * extensions/insert_data.php, extensions/snmp_explorer.php, godmode/agentes/agent_manager.php, include/ajax/agent.php, include/javascript/pandora.js, operation/agentes/exportdata.php, operation/events/events.php: changed the unknow plugin autocomplete for the autocomple from jquery-ui. * include/functions_ui.php: cleaned source code style and into the function "ui_process_page_head" added the blacklist hardwrote for to use old jquery. * include/styles/jquery-ui-1.8.17.custom.css, include/javascript/jquery-1.7.1.min.js, include/javascript/jquery.jquery-ui-1.8.17.custom.min.js: added the last version of Jquery and Jquery-ui. Merge from the branch "pandora_4.0" * godmode/reporting/visual_console_builder.constans.php, godmode/reporting/visual_console_builder.editor.js, godmode/reporting/visual_console_builder.editor.php, include/functions_visual_map.php, include/ajax/visual_console_builder.ajax.php, include/javascript/pandora_visual_console.js: changed the unknow plugin autocomplete for the autocomple from jquery-ui and added function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the name "progress_bubble". * images/percentile_item.disabled.png, images/percentile_item.png: added images for button of percentile item (new item in visual map). * include/styles/pandora.css: added the style for the new button percentile item. * include/functions_graph.php, include/graphs/fgraph.php, include/graphs/functions_gd.php: cleaned source code style, and added the params to set text and color in the function "progress_bar" and added function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the name "progress_bubble". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5693 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-03-05 18:56:56 +01:00
$fontsize = get_parameter('fontsize', 10);
$value_text = get_parameter('value_text', '');
$colorRGB = get_parameter('colorRGB', '');
gd_progress_bar ($width, $height, $progress, $title, $font,
$out_of_lim_str, $out_of_lim_image, $mode, $fontsize, $value_text, $colorRGB);
break;
case 'progressbubble':
$width = get_parameter('width');
$height = get_parameter('height');
$progress = get_parameter('progress');
$out_of_lim_str = get_parameter('out_of_lim_str', false);
$out_of_lim_image = get_parameter('out_of_lim_image', false);
$font = get_parameter('font');
$title = get_parameter('title');
$mode = get_parameter('mode', 1);
$fontsize = get_parameter('fontsize', 7);
$value_text = get_parameter('value_text', '');
$colorRGB = get_parameter('colorRGB', '');
gd_progress_bubble ($width, $height, $progress, $title, $font,
$out_of_lim_str, $out_of_lim_image, $mode, $fontsize, $value_text, $colorRGB);
break;
}
function histogram($chart_data, $width, $height, $font, $max, $title, $mode, $ttl = 1) {
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['font'] = $font;
$graph['max'] = $max;
$graph['title'] = $title;
$graph['mode'] = $mode;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='include/graphs/functions_gd.php?static_graph=1&graph_type=histogram&ttl=".$ttl."&id_graph=".$id_graph."'>";
}
function progressbar($progress, $width, $height, $title, $font, $mode = 1,
$out_of_lim_str = false, $out_of_lim_image = false, $ttl = 1) {
$graph = array();
$graph['progress'] = $progress;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['out_of_lim_str'] = $out_of_lim_str;
$graph['out_of_lim_image'] = $out_of_lim_image;
$graph['title'] = $title;
$graph['font'] = $font;
$graph['mode'] = $mode;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='include/graphs/functions_gd.php?static_graph=1&graph_type=progressbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
}
function slicesbar_graph($chart_data, $period, $width, $height, $colors, $font,
$round_corner, $home_url = '', $ttl = 1) {
$graph = array();
$graph['data'] = $chart_data;
$graph['period'] = $period;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['font'] = $font;
$graph['round_corner'] = $round_corner;
$graph['color'] = $colors;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='".$home_url."include/graphs/functions_pchart.php?static_graph=1&graph_type=slicebar&ttl=".$ttl."&id_graph=".$id_graph."'>";
}
function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(),
$legend = array(), $xaxisname = "", $yaxisname = "", $homedir="",
$water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1, $reduce_data_columns = false,
$adapt_key = '') {
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
if($flash_chart) {
return flot_vcolumn_chart ($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url, $homedir, $reduce_data_columns, $adapt_key);
}
else {
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['color'] = $color;
$graph['legend'] = $legend;
$graph['xaxisname'] = $xaxisname;
$graph['yaxisname'] = $yaxisname;
$graph['water_mark'] = $water_mark_file;
$graph['font'] = $font;
$graph['font_size'] = $font_size;
$graph['force_steps'] = $force_steps;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=vbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
}
}
// NOT USED ACTUALLY
function threshold_graph($flash_chart, $chart_data, $width, $height, $ttl = 1) {
if ($flash_chart) {
return flot_area_simple_graph($chart_data, $width, $height);
}
else {
echo "<img src='include/graphs/functions_pchart.php?static_graph=1&graph_type=threshold&ttl=".$ttl."&data=".json_encode($chart_data)."&width=".$width."&height=".$height."'>";
}
}
function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
$long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $homeurl="",
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $series_type = array(),
$chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key = '', $force_integer = false,
2013-04-15 Sergio Martin <sergio.martin@artica.es> * include/functions_html.php include/styles/pandora.css include/functions_ui.php include/functions_graph.php include/functions_events.php include/graphs/functions_flot.php include/graphs/flot/pandora.flot.js include/graphs/fgraph.php operation/events/events_list.php operation/agentes/estado_generalagente.php operation/agentes/stat_win.php images/file.png images/collection_col.png images/input_update.disabled.png images/input_wand.disabled.png images/heart_col.png images/calendar_view_day.png images/reporting.png images/input_tick.png images/input_zoom.disabled.png images/input_tick.disabled.png images/input_go.disabled.png images/clock.png images/input_pdf.disabled.png images/tree.png images/groups_small/transmit.png images/groups_small/drive_network.png images/groups_small/eye.png images/groups_small/printer.png images/groups_small/lightning.png images/groups_small/clock.png images/groups_small/bricks.png images/groups_small/chart_organisation.png images/groups_small/world.png images/groups_small/lock.png images/groups_small/network.png images/groups_small/plugin.png images/groups_small/images.png images/groups_small/without_group.png images/groups_small/mail.png images/groups_small/house.png images/groups_small/application_osx_terminal.png images/groups_small/server_database.png images/groups_small/computer.png images/groups_small/database_gear.png images/groups_small/heart.png images/groups_small/firewall.png images/groups_small/applications.png images/input_delete.disabled.png images/input_filter.disabled.png images/category_col.png images/input_cog.disabled.png images/input_add.disabled.png images/input_cross.disabled.png images/recon.png images/pandora_header_logo.png images/dashboard_col.png images/input_config.disabled.png: Change group icons, change more icons and images and fix layout bugs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7981 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-15 13:44:36 +02:00
$series_suffix_str = '', $menu = true) {
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
2013-04-15 Sergio Martin <sergio.martin@artica.es> * include/functions_html.php include/styles/pandora.css include/functions_ui.php include/functions_graph.php include/functions_events.php include/graphs/functions_flot.php include/graphs/flot/pandora.flot.js include/graphs/fgraph.php operation/events/events_list.php operation/agentes/estado_generalagente.php operation/agentes/stat_win.php images/file.png images/collection_col.png images/input_update.disabled.png images/input_wand.disabled.png images/heart_col.png images/calendar_view_day.png images/reporting.png images/input_tick.png images/input_zoom.disabled.png images/input_tick.disabled.png images/input_go.disabled.png images/clock.png images/input_pdf.disabled.png images/tree.png images/groups_small/transmit.png images/groups_small/drive_network.png images/groups_small/eye.png images/groups_small/printer.png images/groups_small/lightning.png images/groups_small/clock.png images/groups_small/bricks.png images/groups_small/chart_organisation.png images/groups_small/world.png images/groups_small/lock.png images/groups_small/network.png images/groups_small/plugin.png images/groups_small/images.png images/groups_small/without_group.png images/groups_small/mail.png images/groups_small/house.png images/groups_small/application_osx_terminal.png images/groups_small/server_database.png images/groups_small/computer.png images/groups_small/database_gear.png images/groups_small/heart.png images/groups_small/firewall.png images/groups_small/applications.png images/input_delete.disabled.png images/input_filter.disabled.png images/category_col.png images/input_cog.disabled.png images/input_add.disabled.png images/input_cross.disabled.png images/recon.png images/pandora_header_logo.png images/dashboard_col.png images/input_config.disabled.png: Change group icons, change more icons and images and fix layout bugs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7981 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-15 13:44:36 +02:00
// ATTENTION: The min size is 110x150
// It's not the same minsize for all graphs, but we are choosed a prudent minsize for all
2013-04-15 Sergio Martin <sergio.martin@artica.es> * include/functions_html.php include/styles/pandora.css include/functions_ui.php include/functions_graph.php include/functions_events.php include/graphs/functions_flot.php include/graphs/flot/pandora.flot.js include/graphs/fgraph.php operation/events/events_list.php operation/agentes/estado_generalagente.php operation/agentes/stat_win.php images/file.png images/collection_col.png images/input_update.disabled.png images/input_wand.disabled.png images/heart_col.png images/calendar_view_day.png images/reporting.png images/input_tick.png images/input_zoom.disabled.png images/input_tick.disabled.png images/input_go.disabled.png images/clock.png images/input_pdf.disabled.png images/tree.png images/groups_small/transmit.png images/groups_small/drive_network.png images/groups_small/eye.png images/groups_small/printer.png images/groups_small/lightning.png images/groups_small/clock.png images/groups_small/bricks.png images/groups_small/chart_organisation.png images/groups_small/world.png images/groups_small/lock.png images/groups_small/network.png images/groups_small/plugin.png images/groups_small/images.png images/groups_small/without_group.png images/groups_small/mail.png images/groups_small/house.png images/groups_small/application_osx_terminal.png images/groups_small/server_database.png images/groups_small/computer.png images/groups_small/database_gear.png images/groups_small/heart.png images/groups_small/firewall.png images/groups_small/applications.png images/input_delete.disabled.png images/input_filter.disabled.png images/category_col.png images/input_cog.disabled.png images/input_add.disabled.png images/input_cross.disabled.png images/recon.png images/pandora_header_logo.png images/dashboard_col.png images/input_config.disabled.png: Change group icons, change more icons and images and fix layout bugs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7981 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-15 13:44:36 +02:00
if ($height <= 110) {
$height = 110;
}
if ($width < 150) {
$width = 150;
}
if (empty($chart_data)) {
2013-05-23 Sergio Martin <sergio.martin@artica.es> * include/functions_html.php include/styles/pandora_minimal.css include/styles/dialog.css include/styles/menu.css include/styles/jquery-ui-1.10.0.custom.css include/functions_events.php operation/events/events_list.php include/functions_snmp_browser.php include/styles/pandora.css: A lot of graphic changes including events form and snmp browser layout * include/ajax/module.php include/functions_ui.php include/functions.php include/functions_agents.php include/functions_graph.php include/graphs/functions_gd.php include/graphs/fgraph.php include/functions_reporting.php include/functions_filemanager.php include/javascript/pandora_snmp_browser.js include/functions_treeview.php include/constants.php index.php extensions/net_tools.php extensions/pandora_logs.php extensions/ssh_gateway.php extensions/update_manager/settings.php extensions/plugin_registration.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/visual_console/render_view.php operation/users/user_edit.php operation/reporting/reporting_viewer.php operation/reporting/graph_viewer.php operation/agentes/datos_agente.php operation/agentes/alerts_status.php operation/agentes/estado_generalagente.php operation/agentes/custom_fields.php operation/agentes/estado_agente.php operation/agentes/estado_monitores.php operation/agentes/agent_fields.php operation/agentes/stat_win.php operation/servers/recon_view.php operation/integria_incidents/incident_detail.php operation/netflow/nf_live_view.php godmode/groups/configure_group.php godmode/groups/configure_modu_group.php godmode/groups/group_list.php godmode/db/db_refine.php godmode/db/db_event.php godmode/agentes/module_manager_editor_common.php godmode/agentes/fields_manager.php godmode/agentes/modificar_agente.php godmode/agentes/module_manager_editor.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/setup/news.php godmode/setup/links.php godmode/setup/gis.php godmode/users/configure_profile.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_profiles.php godmode/modules/module_list.php godmode/reporting/visual_console_builder.php godmode/reporting/map_builder.php godmode/reporting/graphs.php godmode/tag/tag.php godmode/tag/edit_tag.php: Changing the old way of print errors to encapsulated UI function to unify styles * images/status_sets/color_text/agent_no_monitors.png images/status_sets/color_text/agent_no_monitors_ball.pn images/status_sets/color_text/agent_down_ball.png images/status_sets/color_text/agent_down.png images/status_sets/default/agent_no_monitors.png images/status_sets/default/agent_no_monitors_ball.png images/status_sets/default/agent_down_ball.png images/status_sets/default/agent_down.png: Modify some status set images * images/gis_map/icons/star.default.png images/gis_map/icons/cross.warning.png images/gis_map/icons/star.bad.png images/gis_map/icons/cross.ok.png images/gis_map/icons/marker.default.png images/gis_map/icons/square_marker.warning.png images/gis_map/icons/circle.warning.png images/gis_map/icons/marker.bad.png images/gis_map/icons/square_marker.ok.png images/gis_map/icons/circle.ok.png images/gis_map/icons/triangle.warning.png images/gis_map/icons/cross.default.png images/gis_map/icons/star.warning.png images/gis_map/icons/triangle.ok.png images/gis_map/icons/cross.bad.png images/gis_map/icons/star.ok.png images/gis_map/icons/square_marker.default.png images/gis_map/icons/circle.default.png images/gis_map/icons/marker.warning.png images/gis_map/icons/square_marker.bad.png images/gis_map/icons/circle.bad.png images/gis_map/icons/triangle.default.png images/gis_map/icons/marker.ok.png images/gis_map/icons/triangle.bad.png: Change whole the gis icons by new ones * images/os_icons/so_win.png images/os_icons/so_linux.png images/os_icons/so_mac.png images/os_icons/so_cisco.png images/os_icons/so_vmware.png images/os_icons/so_bsd.png images/os_icons/android.png images/os_icons/so_aix.png images/os_icons/so_other.png images/os_icons/so_hpux.png images/os_icons/network.png images/os_icons/embedded.png: Reduce the operating system icons size * images/vnc.png images/op_inventory.png images/refresh_mc.png images/heart.png images/service.png images/go.png images/graphmenu_arrow_hide.png images/submenu_tree_first.png images/config_mc.png images/cross_double.png images/wand.png images/expand.png images/submenu_tree_middle.png images/visual_console.png images/down.png images/chart_curve_threshold.png images/people_1.png images/cancel.png images/graphmenu_arrow.png images/people_2.png images/collapse.png images/camera_mc.png: Improve a lot of icons git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8198 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-05-23 17:42:32 +02:00
return graph_nodata_image($width, $height);
return '<img src="' . $no_data_image . '" />';
}
if ($flash_chart) {
2013-04-15 Sergio Martin <sergio.martin@artica.es> * include/functions_html.php include/styles/pandora.css include/functions_ui.php include/functions_graph.php include/functions_events.php include/graphs/functions_flot.php include/graphs/flot/pandora.flot.js include/graphs/fgraph.php operation/events/events_list.php operation/agentes/estado_generalagente.php operation/agentes/stat_win.php images/file.png images/collection_col.png images/input_update.disabled.png images/input_wand.disabled.png images/heart_col.png images/calendar_view_day.png images/reporting.png images/input_tick.png images/input_zoom.disabled.png images/input_tick.disabled.png images/input_go.disabled.png images/clock.png images/input_pdf.disabled.png images/tree.png images/groups_small/transmit.png images/groups_small/drive_network.png images/groups_small/eye.png images/groups_small/printer.png images/groups_small/lightning.png images/groups_small/clock.png images/groups_small/bricks.png images/groups_small/chart_organisation.png images/groups_small/world.png images/groups_small/lock.png images/groups_small/network.png images/groups_small/plugin.png images/groups_small/images.png images/groups_small/without_group.png images/groups_small/mail.png images/groups_small/house.png images/groups_small/application_osx_terminal.png images/groups_small/server_database.png images/groups_small/computer.png images/groups_small/database_gear.png images/groups_small/heart.png images/groups_small/firewall.png images/groups_small/applications.png images/input_delete.disabled.png images/input_filter.disabled.png images/category_col.png images/input_cog.disabled.png images/input_add.disabled.png images/input_cross.disabled.png images/recon.png images/pandora_header_logo.png images/dashboard_col.png images/input_config.disabled.png: Change group icons, change more icons and images and fix layout bugs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7981 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-15 13:44:36 +02:00
return flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url, $series_type, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, $menu);
}
else {
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['color'] = $color;
$graph['legend'] = $legend;
$graph['xaxisname'] = $xaxisname;
$graph['yaxisname'] = $yaxisname;
$graph['water_mark'] = $water_mark_file;
$graph['font'] = $font;
$graph['font_size'] = $font_size;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='" . ui_get_full_url (false, false, false, false) . "include/graphs/functions_pchart.php?static_graph=1&graph_type=area&ttl=".$ttl."&id_graph=" . $id_graph . "'>";
}
}
function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color,
$legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "",
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '') {
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
if (empty($chart_data)) {
return '<img src="' . $no_data_image . '" />';
}
if($flash_chart) {
return flot_area_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url);
}
else {
//Stack the data
stack_data($chart_data, $legend, $color);
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['color'] = $color;
$graph['legend'] = $legend;
$graph['xaxisname'] = $xaxisname;
$graph['yaxisname'] = $yaxisname;
$graph['water_mark'] = $water_mark_file;
$graph['font'] = $font;
$graph['font_size'] = $font_size;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='" . ui_get_full_url (false, false, false, false) . "include/graphs/functions_pchart.php?static_graph=1&graph_type=stacked_area&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
}
}
function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color,
$legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "",
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '') {
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
if (empty($chart_data)) {
return '<img src="' . $no_data_image . '" />';
}
if($flash_chart) {
return flot_line_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url);
}
else {
//Stack the data
stack_data($chart_data, $legend, $color);
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['color'] = $color;
$graph['legend'] = $legend;
$graph['xaxisname'] = $xaxisname;
$graph['yaxisname'] = $yaxisname;
$graph['water_mark'] = $water_mark_file;
$graph['font'] = $font;
$graph['font_size'] = $font_size;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=line&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
}
}
function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
$long_index, $no_data_image, $xaxisname = "", $yaxisname = "",
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '') {
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
if (empty($chart_data)) {
return '<img src="' . $no_data_image . '" />';
}
if($flash_chart) {
return flot_line_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url);
}
else {
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['color'] = $color;
$graph['legend'] = $legend;
$graph['xaxisname'] = $xaxisname;
$graph['yaxisname'] = $yaxisname;
$graph['water_mark'] = $water_mark_file;
$graph['font'] = $font;
$graph['font_size'] = $font_size;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=line&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
}
}
function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1, $homedir="") {
if (empty($chart_data)) {
return '<img src="' . $no_data_image . '" />';
}
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='".$homedir."include/graphs/functions_pchart.php?static_graph=1&graph_type=".$graph_type."&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
}
function radar_graph($flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1, $homedir="") {
return kiviat_graph('radar', $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl, $homedir);
}
function polar_graph($flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1, $homedir="") {
return kiviat_graph('polar', $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl, $homedir="");
}
function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array(),
$legend = array(), $xaxisname = "", $yaxisname = "", $force_height = true,
$homedir="", $water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1, $return = false) {
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
if($flash_chart) {
if ($return){
return flot_hcolumn_chart ($chart_data, $width, $height, $water_mark_url);
}
else{
echo flot_hcolumn_chart ($chart_data, $width, $height, $water_mark_url);
}
}
else {
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['color'] = $color;
$graph['legend'] = $legend;
$graph['xaxisname'] = $xaxisname;
$graph['yaxisname'] = $yaxisname;
$graph['force_height'] = $force_height;
$graph['water_mark'] = $water_mark_file;
$graph['font'] = $font;
$graph['font_size'] = $font_size;
$graph['force_steps'] = $force_steps;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='".$homedir."include/graphs/functions_pchart.php?static_graph=1&graph_type=hbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
}
}
function pie3d_graph($flash_chart, $chart_data, $width, $height,
$others_str = "other", $homedir = "", $water_mark = "", $font = '',
$font_size = '', $ttl = 1, $legend_position = false, $colors = '') {
return pie_graph('3d', $flash_chart, $chart_data, $width, $height,
$others_str, $homedir, $water_mark, $font, $font_size, $ttl,
$legend_position, $colors);
}
function pie2d_graph($flash_chart, $chart_data, $width, $height,
$others_str = "other", $homedir="", $water_mark = "", $font = '',
$font_size = '', $ttl = 1, $legend_position = false, $colors = '') {
return pie_graph('2d', $flash_chart, $chart_data, $width, $height,
$others_str, $homedir, $water_mark, $font, $font_size, $ttl,
$legend_position, $colors);
}
function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height,
$others_str = "other", $homedir="", $water_mark = "", $font = '',
$font_size = '', $ttl = 1, $legend_position = false, $colors = '') {
if (empty($chart_data)) {
2013-05-23 Sergio Martin <sergio.martin@artica.es> * include/functions_html.php include/styles/pandora_minimal.css include/styles/dialog.css include/styles/menu.css include/styles/jquery-ui-1.10.0.custom.css include/functions_events.php operation/events/events_list.php include/functions_snmp_browser.php include/styles/pandora.css: A lot of graphic changes including events form and snmp browser layout * include/ajax/module.php include/functions_ui.php include/functions.php include/functions_agents.php include/functions_graph.php include/graphs/functions_gd.php include/graphs/fgraph.php include/functions_reporting.php include/functions_filemanager.php include/javascript/pandora_snmp_browser.js include/functions_treeview.php include/constants.php index.php extensions/net_tools.php extensions/pandora_logs.php extensions/ssh_gateway.php extensions/update_manager/settings.php extensions/plugin_registration.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/visual_console/render_view.php operation/users/user_edit.php operation/reporting/reporting_viewer.php operation/reporting/graph_viewer.php operation/agentes/datos_agente.php operation/agentes/alerts_status.php operation/agentes/estado_generalagente.php operation/agentes/custom_fields.php operation/agentes/estado_agente.php operation/agentes/estado_monitores.php operation/agentes/agent_fields.php operation/agentes/stat_win.php operation/servers/recon_view.php operation/integria_incidents/incident_detail.php operation/netflow/nf_live_view.php godmode/groups/configure_group.php godmode/groups/configure_modu_group.php godmode/groups/group_list.php godmode/db/db_refine.php godmode/db/db_event.php godmode/agentes/module_manager_editor_common.php godmode/agentes/fields_manager.php godmode/agentes/modificar_agente.php godmode/agentes/module_manager_editor.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/setup/news.php godmode/setup/links.php godmode/setup/gis.php godmode/users/configure_profile.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_profiles.php godmode/modules/module_list.php godmode/reporting/visual_console_builder.php godmode/reporting/map_builder.php godmode/reporting/graphs.php godmode/tag/tag.php godmode/tag/edit_tag.php: Changing the old way of print errors to encapsulated UI function to unify styles * images/status_sets/color_text/agent_no_monitors.png images/status_sets/color_text/agent_no_monitors_ball.pn images/status_sets/color_text/agent_down_ball.png images/status_sets/color_text/agent_down.png images/status_sets/default/agent_no_monitors.png images/status_sets/default/agent_no_monitors_ball.png images/status_sets/default/agent_down_ball.png images/status_sets/default/agent_down.png: Modify some status set images * images/gis_map/icons/star.default.png images/gis_map/icons/cross.warning.png images/gis_map/icons/star.bad.png images/gis_map/icons/cross.ok.png images/gis_map/icons/marker.default.png images/gis_map/icons/square_marker.warning.png images/gis_map/icons/circle.warning.png images/gis_map/icons/marker.bad.png images/gis_map/icons/square_marker.ok.png images/gis_map/icons/circle.ok.png images/gis_map/icons/triangle.warning.png images/gis_map/icons/cross.default.png images/gis_map/icons/star.warning.png images/gis_map/icons/triangle.ok.png images/gis_map/icons/cross.bad.png images/gis_map/icons/star.ok.png images/gis_map/icons/square_marker.default.png images/gis_map/icons/circle.default.png images/gis_map/icons/marker.warning.png images/gis_map/icons/square_marker.bad.png images/gis_map/icons/circle.bad.png images/gis_map/icons/triangle.default.png images/gis_map/icons/marker.ok.png images/gis_map/icons/triangle.bad.png: Change whole the gis icons by new ones * images/os_icons/so_win.png images/os_icons/so_linux.png images/os_icons/so_mac.png images/os_icons/so_cisco.png images/os_icons/so_vmware.png images/os_icons/so_bsd.png images/os_icons/android.png images/os_icons/so_aix.png images/os_icons/so_other.png images/os_icons/so_hpux.png images/os_icons/network.png images/os_icons/embedded.png: Reduce the operating system icons size * images/vnc.png images/op_inventory.png images/refresh_mc.png images/heart.png images/service.png images/go.png images/graphmenu_arrow_hide.png images/submenu_tree_first.png images/config_mc.png images/cross_double.png images/wand.png images/expand.png images/submenu_tree_middle.png images/visual_console.png images/down.png images/chart_curve_threshold.png images/people_1.png images/cancel.png images/graphmenu_arrow.png images/people_2.png images/collapse.png images/camera_mc.png: Improve a lot of icons git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8198 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-05-23 17:42:32 +02:00
return graph_nodata_image($width, $height, 'pie');
}
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
// This library allows only 8 colors
$max_values = 8;
if (count($chart_data) > $max_values) {
$chart_data_trunc = array();
$n = 1;
foreach ($chart_data as $key => $value) {
if ($n < $max_values) {
$chart_data_trunc[$key] = $value;
}
else {
if (!isset($chart_data_trunc[$others_str])) {
$chart_data_trunc[$others_str] = 0;
}
$chart_data_trunc[$others_str] += $value;
}
$n++;
}
$chart_data = $chart_data_trunc;
}
if ($flash_chart) {
return flot_pie_chart(array_values($chart_data),
array_keys($chart_data), $width, $height, $water_mark_url,
$font, $font_size, $legend_position, $colors);
}
else {
//TODO SET THE LEGEND POSITION
$graph = array();
$graph['data'] = $chart_data;
$graph['width'] = $width;
$graph['height'] = $height;
$graph['water_mark'] = $water_mark_file;
$graph['font'] = $font;
$graph['font_size'] = $font_size;
$graph['legend_position'] = $legend_position;
$graph['color'] = $colors;
$id_graph = serialize_in_temp($graph, null, $ttl);
switch ($graph_type) {
case "2d":
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=pie2d&ttl=".$ttl."&id_graph=".$id_graph."'>";
break;
case "3d":
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=pie3d&ttl=".$ttl."&id_graph=".$id_graph."'>";
break;
}
}
}
?>