mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Continue unifying the table system.
This commit is contained in:
parent
779f14e646
commit
e247231de0
@ -1,6 +1,6 @@
|
||||
import {BaseDashlet} from "./base_dashlet";
|
||||
import {RttHistogram} from "../graphs/rtt_histo";
|
||||
import {clearDashDiv, theading, topNTableHeader, topNTableRow} from "../helpers/builders";
|
||||
import {clearDashDiv, theading, TopNTableFromMsgData, topNTableHeader, topNTableRow} from "../helpers/builders";
|
||||
import {scaleNumber, rttCircleSpan, formatThroughput, formatRtt, formatRetransmit} from "../helpers/scaling";
|
||||
import {redactCell} from "../helpers/redact";
|
||||
|
||||
@ -36,16 +36,7 @@ export class Top10Downloaders extends BaseDashlet {
|
||||
if (msg.event === "TopDownloads") {
|
||||
let target = document.getElementById(this.id);
|
||||
|
||||
let t = document.createElement("table");
|
||||
t.classList.add("table", "table-striped", "table-sm");
|
||||
|
||||
t.appendChild(topNTableHeader());
|
||||
|
||||
let tbody = document.createElement("tbody");
|
||||
msg.data.forEach((r) => {
|
||||
t.appendChild(topNTableRow(r));
|
||||
});
|
||||
t.appendChild(tbody);
|
||||
let t = TopNTableFromMsgData(msg);
|
||||
|
||||
// Display it
|
||||
clearDashDiv(this.id, target);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {BaseDashlet} from "./base_dashlet";
|
||||
import {RttHistogram} from "../graphs/rtt_histo";
|
||||
import {clearDashDiv, theading, topNTableHeader, topNTableRow} from "../helpers/builders";
|
||||
import {clearDashDiv, theading, TopNTableFromMsgData, topNTableHeader, topNTableRow} from "../helpers/builders";
|
||||
import {scaleNumber, rttCircleSpan, formatThroughput, formatRtt} from "../helpers/scaling";
|
||||
import {redactCell} from "../helpers/redact";
|
||||
|
||||
@ -36,16 +36,7 @@ export class Worst10Downloaders extends BaseDashlet {
|
||||
if (msg.event === "WorstRTT") {
|
||||
let target = document.getElementById(this.id);
|
||||
|
||||
let t = document.createElement("table");
|
||||
t.classList.add("table", "table-striped", "small");
|
||||
|
||||
t.appendChild(topNTableHeader());
|
||||
|
||||
let tbody = document.createElement("tbody");
|
||||
msg.data.forEach((r) => {
|
||||
t.appendChild(topNTableRow(r));
|
||||
});
|
||||
t.appendChild(tbody);
|
||||
let t = TopNTableFromMsgData(msg);
|
||||
|
||||
// Display it
|
||||
clearDashDiv(this.id, target);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {BaseDashlet} from "./base_dashlet";
|
||||
import {RttHistogram} from "../graphs/rtt_histo";
|
||||
import {clearDashDiv, theading, topNTableHeader, topNTableRow} from "../helpers/builders";
|
||||
import {clearDashDiv, theading, TopNTableFromMsgData, topNTableHeader, topNTableRow} from "../helpers/builders";
|
||||
import {scaleNumber, rttCircleSpan, formatRtt, formatThroughput} from "../helpers/scaling";
|
||||
import {redactCell} from "../helpers/redact";
|
||||
|
||||
@ -36,16 +36,7 @@ export class Worst10Retransmits extends BaseDashlet {
|
||||
if (msg.event === "WorstRetransmits") {
|
||||
let target = document.getElementById(this.id);
|
||||
|
||||
let t = document.createElement("table");
|
||||
t.classList.add("table", "table-striped", "tiny");
|
||||
|
||||
t.appendChild(topNTableHeader());
|
||||
|
||||
let tbody = document.createElement("tbody");
|
||||
msg.data.forEach((r) => {
|
||||
t.appendChild(topNTableRow(r));
|
||||
});
|
||||
t.appendChild(tbody);
|
||||
let t = TopNTableFromMsgData(msg);
|
||||
|
||||
// Display it
|
||||
clearDashDiv(this.id, target);
|
||||
|
@ -157,4 +157,18 @@ export function topNTableRow(r) {
|
||||
row.append(tcp_xmit_up);
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
export function TopNTableFromMsgData(msg) {
|
||||
let t = document.createElement("table");
|
||||
t.classList.add("table", "table-striped", "table-sm");
|
||||
|
||||
t.appendChild(topNTableHeader());
|
||||
|
||||
let tbody = document.createElement("tbody");
|
||||
msg.data.forEach((r) => {
|
||||
t.appendChild(topNTableRow(r));
|
||||
});
|
||||
t.appendChild(tbody);
|
||||
return t;
|
||||
}
|
Loading…
Reference in New Issue
Block a user