mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Support redaction on the tree graph
This commit is contained in:
1
src/rust/Cargo.lock
generated
1
src/rust/Cargo.lock
generated
@@ -3966,6 +3966,7 @@ dependencies = [
|
|||||||
"ip_network_table",
|
"ip_network_table",
|
||||||
"lqos_config",
|
"lqos_config",
|
||||||
"pyo3",
|
"pyo3",
|
||||||
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { DashboardGraph } from "./graphs/dashboard_graph";
|
import { DashboardGraph } from "./graphs/dashboard_graph";
|
||||||
import {lerpGreenToRedViaOrange} from "./helpers/scaling";
|
import {lerpGreenToRedViaOrange} from "./helpers/scaling";
|
||||||
|
import {isRedacted} from "./helpers/redact";
|
||||||
|
|
||||||
class AllTreeSankey extends DashboardGraph {
|
class AllTreeSankey extends DashboardGraph {
|
||||||
constructor(id) {
|
constructor(id) {
|
||||||
@@ -30,6 +31,7 @@ let lastRtt = {};
|
|||||||
function start() {
|
function start() {
|
||||||
$.get("/local-api/networkTree", (data) => {
|
$.get("/local-api/networkTree", (data) => {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
|
let redact = isRedacted();
|
||||||
|
|
||||||
let nodes = [];
|
let nodes = [];
|
||||||
let links = [];
|
let links = [];
|
||||||
@@ -50,12 +52,15 @@ function start() {
|
|||||||
}
|
}
|
||||||
let color = lerpGreenToRedViaOrange(200 - lastRtt[name], 200);
|
let color = lerpGreenToRedViaOrange(200 - lastRtt[name], 200);
|
||||||
|
|
||||||
|
let label = {
|
||||||
|
fontSize: 6,
|
||||||
|
color: "#999"
|
||||||
|
};
|
||||||
|
if (redact) label.fontSize = 0;
|
||||||
|
|
||||||
nodes.push({
|
nodes.push({
|
||||||
name: data[i][1].name,
|
name: data[i][1].name,
|
||||||
label: {
|
label: label,
|
||||||
fontSize: 6,
|
|
||||||
color: "#999"
|
|
||||||
},
|
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: color
|
color: color
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function cssRedact() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isRedacted() {
|
export function isRedacted() {
|
||||||
let prefs = localStorage.getItem("redact");
|
let prefs = localStorage.getItem("redact");
|
||||||
if (prefs === null) {
|
if (prefs === null) {
|
||||||
localStorage.setItem("redact", "false");
|
localStorage.setItem("redact", "false");
|
||||||
|
|||||||
Reference in New Issue
Block a user