diff --git a/src/assets/css/index.css b/src/assets/css/index.css index 3109ac9..16482e8 100644 --- a/src/assets/css/index.css +++ b/src/assets/css/index.css @@ -199,11 +199,20 @@ a { background-color: rgba(0, 0, 0, 0.3); } .device-pin { + position: absolute; + right: 45px; + top: 4px; + height: 20px; + padding: inherit; +} +.device-traffic-signal { position: absolute; right: 15px; top: 4px; height: 20px; padding: inherit; + opacity: 0.3; + transition: opacity 0.1s ease-in-out; } .device-wrapper { box-sizing: border-box; diff --git a/src/assets/img/outline_link_white_18dp.png b/src/assets/img/outline_link_white_18dp.png new file mode 100644 index 0000000..ba63727 Binary files /dev/null and b/src/assets/img/outline_link_white_18dp.png differ diff --git a/src/device.js b/src/device.js index 86bdea9..1fe2267 100644 --- a/src/device.js +++ b/src/device.js @@ -47,6 +47,7 @@ function registerDevice(newDevice, discoveryMethod) { sendQueue: [], heartbeatInterval: PLUGINS.all[newDevice.type].heartbeatInterval, heartbeatTimeout: PLUGINS.all[newDevice.type].heartbeatTimeout, + trafficSignal: VIEW.trafficSignal, draw() { VIEW.draw(this); }, @@ -320,10 +321,7 @@ function infoUpdate(device, param, value) { } module.exports.infoUpdate = infoUpdate; -let $networkIndicatorDot; - function heartbeat() { - $networkIndicatorDot = document.getElementById('network-indicator-dot'); Object.keys(devices).forEach((deviceID) => { const d = devices[deviceID]; @@ -356,7 +354,7 @@ function networkTick() { if (d.sendQueue.length > 0 && d.sendNow) { d.sendNow(d.sendQueue[0]); d.sendQueue.shift(); - $networkIndicatorDot.style.background = 'green'; + d.trafficSignal(d); } }); } diff --git a/src/view.js b/src/view.js index c8e5bd0..be510fa 100644 --- a/src/view.js +++ b/src/view.js @@ -171,7 +171,10 @@ function switchDevice(id) { const $deviceWrapper = document.getElementById(`device-${i}`); if (!$deviceWrapper) { - const html = `

`;
+ html += `
`;
+ html += `