diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index aad0506f86..d081cf7fca 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -29,6 +29,12 @@ function chordDiagram(recipient, elements, matrix, width) { var width = 700; var margin = 150; var padding = 0.02; + var consoleStyle = document.getElementById("hidden-selected_style_theme") + .value; + var textColor = + consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)"; + var tooltipColor = + consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)"; function chart(selection) { selection.each(function(data) { @@ -103,7 +109,6 @@ function chordDiagram(recipient, elements, matrix, width) { const chords = chord.chords(); let aux = 0; $.each(chords, function(key, value) { - console.log(aux); if (aux < 5) { if ( (value.source.index == i && value.target.subindex == i) || @@ -159,6 +164,7 @@ function chordDiagram(recipient, elements, matrix, width) { .attr("text-anchor", function(d) { return d.angle > Math.PI ? "end" : null; }) + .attr("style", "fill: " + textColor) .attr("transform", function(d) { return ( "rotate(" + @@ -266,7 +272,12 @@ function chordDiagram(recipient, elements, matrix, width) { $("#tooltip").attr( "style", - "background: #fff;" + + "background: " + + tooltipColor + + ";" + + "color: " + + textColor + + ";" + "position: absolute;" + "display: inline-block;" + "width: auto;" + @@ -393,6 +404,16 @@ function treeMap(recipient, data, width, height) { var isIE = true; var chartWidth = width; var chartHeight = height; + var consoleStyle = document.getElementById("hidden-selected_style_theme") + .value; + $("#tooltip").css( + "color", + consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)" + ); + $("#tooltip").css( + "background-color", + consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)" + ); if (width === "auto") { chartWidth = $(recipient).innerWidth(); } @@ -761,6 +782,7 @@ function treeMap(recipient, data, width, height) { $("#tooltip").attr( "style", "background: #fff;" + + "color: #111;" + "position: absolute;" + "display: block;" + "width: 200px;" + @@ -1023,6 +1045,7 @@ function sunburst(recipient, data, width, height, tooltip = true) { $("#tooltip").attr( "style", "background: #fff;" + + "color: #111;" + "position: absolute;" + "display: block;" + "width: 200px;" + diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index 442b1b2fa5..e717d92bfb 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -2,20 +2,28 @@ /** * Netflow live view * - * @package Pandora FMS open. - * @subpackage UI file. + * @category Netflow + * @package Pandora FMS + * @subpackage Community + * @version 1.0.0 + * @license See below * - * Pandora FMS - http://pandorafms.com - * ================================================== - * Copyright (c) 2005-2021 Artica Soluciones Tecnologicas + * ______ ___ _______ _______ ________ + * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| + * | __/| _ | | _ || _ | _| _ | | ___| |__ | + * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| + * + * ============================================================================ + * Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Please see http://pandorafms.org for full contribution list * 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 + * as published by the Free Software Foundation for 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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. + * ============================================================================ */ global $config; @@ -40,7 +48,7 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], $pure = get_parameter('pure', 0); // Ajax callbacks. -if (is_ajax()) { +if (is_ajax() === true) { $get_filter_type = get_parameter('get_filter_type', 0); $get_filter_values = get_parameter('get_filter_values', 0); @@ -117,7 +125,7 @@ $draw = get_parameter('draw_button', ''); $save = get_parameter('save_button', ''); $update = get_parameter('update_button', ''); -if (!is_metaconsole()) { +if (is_metaconsole() === false) { // Header. ui_print_page_header( __('Netflow live view'), @@ -505,7 +513,7 @@ if (is_metaconsole()) { echo ''; - if ($draw != '') { + if (empty($draw) === false) { // Draw. echo '
'; @@ -513,6 +521,11 @@ if (is_metaconsole()) { if ($netflow_disable_custom_lvfilters && $filter_selected == 0) { ui_print_error_message(__('No filter selected')); } else { + // Hidden input for handle properly the text colors. + html_print_input_hidden( + 'selected_style_theme', + $config['style'] + ); // Draw the netflow chart. echo netflow_draw_item( $start_date,