Compare commits
2 commits
66eff8f7ba
...
1ef21891f1
Author | SHA1 | Date | |
---|---|---|---|
1ef21891f1 | |||
c5f7a7092b |
1 changed files with 4 additions and 1 deletions
|
@ -79,7 +79,6 @@
|
||||||
<p>%%DESCRIPTION%%</p>
|
<p>%%DESCRIPTION%%</p>
|
||||||
</div>
|
</div>
|
||||||
<hr class="color"/>
|
<hr class="color"/>
|
||||||
<small style="display: block" class="rev">now --></small>
|
|
||||||
|
|
||||||
<main id="uppe-rs-content">
|
<main id="uppe-rs-content">
|
||||||
|
|
||||||
|
@ -101,6 +100,9 @@ function cell(timestamp, rtt) {
|
||||||
|
|
||||||
function card(key, history, last_rtt) {
|
function card(key, history, last_rtt) {
|
||||||
let bar = "";
|
let bar = "";
|
||||||
|
let now = Math.floor(Date.now() / 1000);
|
||||||
|
let first = history[0][0];
|
||||||
|
let hrs_ago = (now - first) / 3600;
|
||||||
for (let el of history) {
|
for (let el of history) {
|
||||||
bar += cell(el[0], el[1]);
|
bar += cell(el[0], el[1]);
|
||||||
}
|
}
|
||||||
|
@ -108,6 +110,7 @@ function card(key, history, last_rtt) {
|
||||||
<h3 class="mt-0">${key} <code class="color">${last_rtt ? last_rtt + 'ms' : 'DOWN'}</code></h3>
|
<h3 class="mt-0">${key} <code class="color">${last_rtt ? last_rtt + 'ms' : 'DOWN'}</code></h3>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
${bar}
|
${bar}
|
||||||
|
<p class="ma-0"><small>^ ~${hrs_ago.toFixed(1)}h ago</small></p>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue