From b6cb7614d61b31669e5150faf2fc276020ce2fa0 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Thu, 18 Jul 2024 12:06:46 -0500 Subject: [PATCH] Adjust sizing on some dash tables. --- .../js_build/src/dashlets/endpoints_by_country.js | 9 ++++++++- .../js_build/src/dashlets/ether_protocols.js | 4 +++- .../node_manager/js_build/src/dashlets/ip_protocols.js | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/endpoints_by_country.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/endpoints_by_country.js index 68e143f1..34257d95 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/endpoints_by_country.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/endpoints_by_country.js @@ -35,9 +35,10 @@ export class Top10EndpointsByCountry extends BaseDashlet { let target = document.getElementById(this.id); let t = document.createElement("table"); - t.classList.add("table", "table-striped", "tiny"); + t.classList.add("table", "table-sm", "small"); let th = document.createElement("thead"); + th.classList.add("small"); th.appendChild(theading("Country")); th.appendChild(theading("DL ⬇️")); th.appendChild(theading("UL ⬆️")); @@ -46,8 +47,13 @@ export class Top10EndpointsByCountry extends BaseDashlet { t.appendChild(th); let tbody = document.createElement("tbody"); + let count = 0; msg.data.forEach((r) => { + if (count >= 10) { + return; + } let row = document.createElement("tr"); + row.classList.add("small"); let country = document.createElement("td"); country.innerText = r[0]; @@ -70,6 +76,7 @@ export class Top10EndpointsByCountry extends BaseDashlet { row.appendChild(rttu); t.appendChild(row); + count++; }); t.appendChild(tbody); diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ether_protocols.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ether_protocols.js index 126b61a6..b972d932 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ether_protocols.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ether_protocols.js @@ -35,9 +35,10 @@ export class EtherProtocols extends BaseDashlet { let target = document.getElementById(this.id); let t = document.createElement("table"); - t.classList.add("table", "table-striped", "tiny"); + t.classList.add("table", "table-sm", "small"); let th = document.createElement("thead"); + th.classList.add("small"); th.appendChild(theading("Protocol")); th.appendChild(theading("DL ⬇️")); th.appendChild(theading("UL ⬆️")); @@ -49,6 +50,7 @@ export class EtherProtocols extends BaseDashlet { let tbody = document.createElement("tbody"); let row = document.createElement("tr"); + row.classList.add("small"); row.appendChild(simpleRow("IPv4")); row.appendChild(simpleRow(scaleNumber(msg.data.v4_bytes.down))); row.appendChild(simpleRow(scaleNumber(msg.data.v4_bytes.up))); diff --git a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js index 1acaa75d..306f97ff 100644 --- a/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js +++ b/src/rust/lqosd/src/node_manager/js_build/src/dashlets/ip_protocols.js @@ -35,9 +35,10 @@ export class IpProtocols extends BaseDashlet { let target = document.getElementById(this.id); let t = document.createElement("table"); - t.classList.add("table", "table-striped", "tiny"); + t.classList.add("table", "table-sm", "small"); let th = document.createElement("thead"); + th.classList.add("small"); th.appendChild(theading("Protocol")); th.appendChild(theading("DL ⬇️")); th.appendChild(theading("UL ⬆️")); @@ -47,6 +48,7 @@ export class IpProtocols extends BaseDashlet { msg.data.forEach((r) => { let row = document.createElement("tr"); + row.classList.add("small"); row.appendChild(simpleRow(r[0])); row.appendChild(simpleRow(scaleNumber(r[1].down)));