From e058b955f25e3c034145996194dfeebd91de74fa Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Wed, 17 Jul 2024 10:24:40 -0500 Subject: [PATCH] Shaped Devices is redactable --- .../lqosd/src/node_manager/js_build/src/helpers/builders.js | 5 ++++- .../lqosd/src/node_manager/js_build/src/helpers/redact.js | 3 +-- .../lqosd/src/node_manager/js_build/src/shaped-devices.js | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/rust/lqosd/src/node_manager/js_build/src/helpers/builders.js b/src/rust/lqosd/src/node_manager/js_build/src/helpers/builders.js index ef91cc43..d5a48cdb 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/helpers/builders.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/helpers/builders.js @@ -26,8 +26,11 @@ export function theading(text, colspan=0, tooltip="", id="") { return th; } -export function simpleRow(text) { +export function simpleRow(text, redact=false) { let td = document.createElement("td"); + if (redact) { + td.classList.add("redactable"); + } td.innerText = text; return td; } diff --git a/src/rust/lqosd/src/node_manager/js_build/src/helpers/redact.js b/src/rust/lqosd/src/node_manager/js_build/src/helpers/redact.js index e82374bf..328f7a63 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/helpers/redact.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/helpers/redact.js @@ -18,10 +18,9 @@ export function redactCell(cell) { } function cssRedact() { - console.log("cssRedact called"); if (isRedacted()) { let r = document.querySelector(':root'); - r.style.setProperty('--redact', 'blur(4px)'); + r.style.setProperty('--redact', 'blur(8px)'); } else { let r = document.querySelector(':root'); r.style.setProperty('--redact', 'none'); diff --git a/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js b/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js index 8960913c..0416d78a 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/shaped-devices.js @@ -16,19 +16,21 @@ function tableRow(device) { let link = document.createElement("a"); link.href = "circuit.html?id=" + device.circuit_id; link.innerText = device.circuit_name; + link.classList.add("redactable"); let td = document.createElement("td"); td.appendChild(link); tr.appendChild(td); link = document.createElement("a"); - link.href = "device.html?id=" + device.device_id; + link.href = "circuit.html?id=" + device.circuit_id; link.innerText = device.device_name; + link.classList.add("redactable"); td = document.createElement("td"); td.appendChild(link); tr.appendChild(td); tr.appendChild(simpleRow(device.download_max_mbps + " / " + device.upload_max_mbps)); - tr.appendChild(simpleRow(device.parent_node)); + tr.appendChild(simpleRow(device.parent_node, true)); let ipList = ""; device.ipv4.forEach((ip) => { ipList += ip[0] + "/" + ip[1] + "
";