Mercurial > code > home > repos > homeauto
changeset 1481:b3ef0886d16c
fix glow
Ignore-this: 6f374683408f724d42abf3aaf7570e2b
darcs-hash:28dcc6f183715a865367974607abe390fa83c9db
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Mon, 06 Jan 2020 22:43:48 -0800 |
parents | ae023bba2104 |
children | 4791c09f915f |
files | service/wifi/src/index.ts |
diffstat | 1 files changed, 5 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/service/wifi/src/index.ts Mon Jan 06 22:39:46 2020 -0800 +++ b/service/wifi/src/index.ts Mon Jan 06 22:43:48 2020 -0800 @@ -80,16 +80,18 @@ renderDevice(dev: Dev) { let agoReport = ""; + let glow = 0; if (dev.agoMin === undefined) { agoReport = "unknown"; } else { - const glow = Math.max(0, 1 - dev.agoMin! / 60); + glow = Math.max(0, 1 - dev.agoMin! / 60); agoReport = dev.agoMin! < 360 ? ` (${Math.ceil(dev.agoMin! * 10) / 10} minutes ago)` : ""; } - const glow = ""; //todo + const ntopUrl = "https://bigasterisk.com/ntop/lua/host_details.lua"; + const ntopLink = `${ntopUrl}?ifid=17&host=${dev.ipAddress.value}&page=flows`; return html` <div class="dev" style="background: rgba(185, 5, 138, ${glow});"> <span class="mac">${dev.macAddress.value}</span> @@ -102,12 +104,7 @@ <span class="bytes">${dev.bytesPerSecDisplay}</span> <span class="hostname">${dev.dhcpHostname}</span> <span class="ago">${agoReport}</span> - <span class="links"> - <a - href="https://bigasterisk.com/ntop/lua/host_details.lua?ifid=17&host=${dev.ipAddress.value}&page=flows" - >[flows]</a - > - </span> + <span class="links"><a href="${ntopLink}">[flows]</a></span> </div> `; }