Shaped Devices is redactable

This commit is contained in:
Herbert Wolverson
2024-07-17 10:24:40 -05:00
parent 0770e9fe78
commit e058b955f2
3 changed files with 9 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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');

View File

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