mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Tree capacity now includes a link to the tree (duh), and is redactable.
This commit is contained in:
parent
1ea75039ee
commit
4580f499fc
@ -61,7 +61,7 @@ export class TopTreeSummary extends BaseDashlet {
|
|||||||
let link = document.createElement("a");
|
let link = document.createElement("a");
|
||||||
link.href = "/tree.html?id=" + r[0];
|
link.href = "/tree.html?id=" + r[0];
|
||||||
link.innerText = r[1].name;
|
link.innerText = r[1].name;
|
||||||
link.classList.add("tiny");
|
link.classList.add("tiny", "redactable");
|
||||||
nameCol.appendChild(link);
|
nameCol.appendChild(link);
|
||||||
|
|
||||||
row.appendChild(nameCol);
|
row.appendChild(nameCol);
|
||||||
|
@ -62,7 +62,14 @@ export class TreeCapacityDash extends BaseDashlet {
|
|||||||
let row = document.createElement("tr");
|
let row = document.createElement("tr");
|
||||||
row.classList.add("small");
|
row.classList.add("small");
|
||||||
|
|
||||||
row.appendChild(simpleRow(node.name));
|
let linkCol = document.createElement("td");
|
||||||
|
let link = document.createElement("a");
|
||||||
|
link.href = "/node.html?id=" + node.id;
|
||||||
|
link.innerText = node.name;
|
||||||
|
link.classList.add("tiny", "redactable");
|
||||||
|
linkCol.appendChild(link);
|
||||||
|
|
||||||
|
row.appendChild(linkCol());
|
||||||
row.appendChild(simpleRowHtml(formatPercent(down*100)));
|
row.appendChild(simpleRowHtml(formatPercent(down*100)));
|
||||||
row.appendChild(simpleRowHtml(formatPercent(up*100)));
|
row.appendChild(simpleRowHtml(formatPercent(up*100)));
|
||||||
row.appendChild(simpleRowHtml(formatRtt(node.rtt)));
|
row.appendChild(simpleRowHtml(formatRtt(node.rtt)));
|
||||||
|
@ -7,6 +7,7 @@ use crate::shaped_devices_tracker::NETWORK_JSON;
|
|||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
struct NodeCapacity {
|
struct NodeCapacity {
|
||||||
|
id: usize,
|
||||||
name: String,
|
name: String,
|
||||||
down: f64,
|
down: f64,
|
||||||
up: f64,
|
up: f64,
|
||||||
@ -22,7 +23,7 @@ pub async fn tree_capacity(channels: Arc<PubSub>) {
|
|||||||
|
|
||||||
let capacities: Vec<_> = {
|
let capacities: Vec<_> = {
|
||||||
if let Ok(reader) = NETWORK_JSON.read() {
|
if let Ok(reader) = NETWORK_JSON.read() {
|
||||||
reader.get_nodes_when_ready().iter().map(|node| {
|
reader.get_nodes_when_ready().iter().enumerate().map(|(id, node)| {
|
||||||
let node = node.clone_to_transit();
|
let node = node.clone_to_transit();
|
||||||
let down = node.current_throughput.0 as f64 * 8.0 / 1_000_000.0;
|
let down = node.current_throughput.0 as f64 * 8.0 / 1_000_000.0;
|
||||||
let up = node.current_throughput.1 as f64 * 8.0 / 1_000_000.0;
|
let up = node.current_throughput.1 as f64 * 8.0 / 1_000_000.0;
|
||||||
@ -40,6 +41,7 @@ pub async fn tree_capacity(channels: Arc<PubSub>) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
NodeCapacity {
|
NodeCapacity {
|
||||||
|
id,
|
||||||
name: node.name.clone(),
|
name: node.name.clone(),
|
||||||
down,
|
down,
|
||||||
up,
|
up,
|
||||||
|
Loading…
Reference in New Issue
Block a user