changeset 680:8a49457a9737

fix glow Ignore-this: 6f374683408f724d42abf3aaf7570e2b
author drewp@bigasterisk.com
date Mon, 06 Jan 2020 22:43:48 -0800
parents 6723f7ae8f34
children 1c04c7dfbae6
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&amp;host=${dev.ipAddress.value}&amp;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&amp;host=${dev.ipAddress.value}&amp;page=flows"
-            >[flows]</a
-          >
-        </span>
+        <span class="links"><a href="${ntopLink}">[flows]</a></span>
       </div>
     `;
   }