From 72464918a5fb5f31851b0efba3a896fa4e18ce72 Mon Sep 17 00:00:00 2001 From: Anton Yemelyanov Date: Sat, 27 Jul 2024 03:16:12 +0300 Subject: [PATCH] wip --- data/resolver.2.bin | Bin 3308 -> 3308 bytes templates/index.html | 4 +++- templates/index.js | 23 ++++++++++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/data/resolver.2.bin b/data/resolver.2.bin index e89d3887ea3d72efa41434451cd7c90f61276e9b..a3e76c28065cc08748cc7146cc9853d07d5bc3d0 100644 GIT binary patch literal 3308 zcmVwPjjiDK?6SGn(7lPep zp`$V^j@D7Bu495Ca9)EHs&Ej{;eQAAY8(z7nL20-3XlO-R9z!I9i3EDA$OEeSYCG0 zCXa?HKiYPQTv$+h-!#7PO>|~bK6W*zt`$Nr-LVEa&%hB{@tPuio4fC7uPugRSyiz) zD3Wn!dHDwK@f^3K_MNbh_@24jh`x}QJ0L3r@3Er1tAp5$)T%=Yl-q|u$SD4jsQ1vh z756Wh)q}?6yzF z;q&N58as^*vB~OaCl{_T>!-@h>W`iQ$!%VKtH%thKR@;}`F|n!vdHkYBmV)tF?ktVFCd_NPNXOX&deujWV*4W2>h4>o6`b^@rN4? zUw&Wf6ya%Q(`_J`G^`#EGjvV7+<#pmefu1vxf2C7snuabKBBmTR_khRtYfCKK*5|q zepNKy*Y2Q%uF?0Fs1n>jqrC0sas`;6*Xv=MAGuzI-AiIM*doQ=^~)K<4av?L0C}Do zn^wETJ_vnOtw+?&YhiThrS52BAaBk8Qw~6{pvIi((wj-|{theq+{0lSDRKf?!8Kz4 z0&nAJFo}q4XgIXjOS!ot#97z9csPkPT?`&ldE|bU3I!`STSek5mnIuBUF#}k3!0A^mTVe&|fZNu^Gd_Hwfy3PMtUJT}oqg!?^ULX)sI4p7E|cMW*)x(+`q1+WAkmH4c-r zZ$MdWC6MUg-vggHk9K7b`-&q)*~@9&wvXMlevsf`&vUkFd2GmhxstWd8^43FrgS89 zkr9d>y59-{0wJNDYC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z;e@ePVA0*5b>j3Gfz-VQhi4;>Rmh2?aC_SR{VNkRZ-Lo5*Z8pQ)SP$I-PsR5!(C01 zl{rewEwv49e=D}gH(Kpd4q}nrkK$LBTB#SS6@hwURR-L&_ZFQFop>|#*}joJ>2@9o z47+939{5^DDiEV)KK?SQ~1E_LtBt-<>h@#$|iNNY>U!phyk zJ-aD<$F*Q+3nB!%3M$uPa%BL;vVR9=gA=VffwnN8pL|})L~C4gb=p@vHR8tpvUb?X z<5Ex7;B#@v^K>Sfh8|lg{KV-%tqN`tItTO9WhrOiA<$jG>?RCjay>PGYF0;B;#f1x zg=!y^sl5KN9?$5&V qG1buR)6Dqf3#0)|h*0Q^WbX`3jfe-G6RX{Vi&#<%8v(S|QXca)uyQ5< diff --git a/templates/index.html b/templates/index.html index 91b62b3..023c86c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -25,7 +25,7 @@ font-size: 16px; font-family: "Menlo", "Consolas", "Andale Mono", monospace; } - .menu { + .menu, .status { break-after: always; margin-bottom: 16px; } @@ -59,6 +59,8 @@ +
+ {% endif %} diff --git a/templates/index.js b/templates/index.js index eb8df8e..4144f8d 100644 --- a/templates/index.js +++ b/templates/index.js @@ -53,6 +53,18 @@ function render() { let resort = false; let tbody = document.getElementById("nodes"); + const status = nodes + .filter((node) => node.status === 'online') + .reduce((acc, node) => { + const network = node.network; + if (!acc[network]) { + acc[network] = { connections: 0, capacity: 0 }; + } + acc[network].connections += node.connections; + acc[network].capacity += node.capacity; + return acc; + }, {}); + window.nodes.forEach((node) => { let { version, @@ -83,15 +95,24 @@ function render() { el.className = filter(node, ctx); let load = (connections / capacity * 100.0).toFixed(2); + let connections_ = connections.toLocaleString(); + let capacity_ = capacity.toLocaleString(); el.innerHTML = `${sid}:${uid}${service}${version}${fqdn}${protocol}${encoding}${network}${status}`; if (status != "offline") { - el.innerHTML += `${connections}/${capacity}${load}%`; + el.innerHTML += `${connections_}/${capacity_}${load}%`; } }); if (resort) { sort(); } + + document.getElementById('status').innerText = Object.entries(status).map(([network, status]) => { + let load = (status.connections / status.capacity * 100.0).toFixed(2); + let connections = status.connections.toLocaleString(); + let capacity = status.capacity.toLocaleString(); + return `${network}: ${connections}/${capacity} ${load}%`; + }).join(' '); } function sort() {