diff --git a/static/app.js b/static/app.js index 5bf26e3..1cd1494 100644 --- a/static/app.js +++ b/static/app.js @@ -6,17 +6,19 @@ const UPDATE_INTERVALS = { // Core update functions function updateDeviceStatus() { - console.log('Updating device status...'); + console.log('Fetching device status...'); fetch('/api/status') .then(response => response.json()) .then(data => { console.log('Received status data:', data); Object.entries(data).forEach(([deviceName, status]) => { - console.log(`Updating ${deviceName} status to ${status}`); - updateDeviceIndicator(deviceName, status); + const deviceElement = document.querySelector(`.device-status[data-device-name="${deviceName}"]`); + if (deviceElement) { + const indicator = deviceElement.querySelector('.status-indicator'); + indicator.className = `status-indicator status-${status ? 'up' : 'down'}`; + } }); - }) - .catch(error => console.error('Error updating status:', error)); + }); } function updateSystemMetrics() { diff --git a/templates/index.html b/templates/index.html index b44c4cf..ba2ff00 100644 --- a/templates/index.html +++ b/templates/index.html @@ -22,10 +22,6 @@
{{ device.name }} {{ device.ip }} - {{ device.type }} ({{ device.connection_type }}) - {% if device.critical %} - Critical - {% endif %}
{%- endfor %}