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",
|
||||
"lqos_config",
|
||||
"pyo3",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DashboardGraph } from "./graphs/dashboard_graph";
|
||||
import {lerpGreenToRedViaOrange} from "./helpers/scaling";
|
||||
import {isRedacted} from "./helpers/redact";
|
||||
|
||||
class AllTreeSankey extends DashboardGraph {
|
||||
constructor(id) {
|
||||
@@ -30,6 +31,7 @@ let lastRtt = {};
|
||||
function start() {
|
||||
$.get("/local-api/networkTree", (data) => {
|
||||
//console.log(data);
|
||||
let redact = isRedacted();
|
||||
|
||||
let nodes = [];
|
||||
let links = [];
|
||||
@@ -50,12 +52,15 @@ function start() {
|
||||
}
|
||||
let color = lerpGreenToRedViaOrange(200 - lastRtt[name], 200);
|
||||
|
||||
let label = {
|
||||
fontSize: 6,
|
||||
color: "#999"
|
||||
};
|
||||
if (redact) label.fontSize = 0;
|
||||
|
||||
nodes.push({
|
||||
name: data[i][1].name,
|
||||
label: {
|
||||
fontSize: 6,
|
||||
color: "#999"
|
||||
},
|
||||
label: label,
|
||||
itemStyle: {
|
||||
color: color
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ function cssRedact() {
|
||||
}
|
||||
}
|
||||
|
||||
function isRedacted() {
|
||||
export function isRedacted() {
|
||||
let prefs = localStorage.getItem("redact");
|
||||
if (prefs === null) {
|
||||
localStorage.setItem("redact", "false");
|
||||
|
||||
Reference in New Issue
Block a user