Fix black theme issues

This commit is contained in:
José González 2022-05-06 14:23:24 +02:00
parent f0637438f3
commit 758933a211
2 changed files with 36 additions and 12 deletions

View File

@ -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;" +

View File

@ -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 '</form>';
if ($draw != '') {
if (empty($draw) === false) {
// Draw.
echo '<br/>';
@ -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,