dynamic overview

This commit is contained in:
2025-02-07 20:58:23 -05:00
parent 84679a49bb
commit c6273788bf
2 changed files with 14 additions and 4 deletions

6
app.py
View File

@ -153,3 +153,9 @@ if __name__ == '__main__':
status_thread = threading.Thread(target=update_status, daemon=True) status_thread = threading.Thread(target=update_status, daemon=True)
status_thread.start() status_thread.start()
app.run(debug=True) app.run(debug=True)
@app.route('/')
def home():
config = load_config()
return render_template('index.html', devices=config['devices'])

View File

@ -16,17 +16,21 @@
<div class="metric-card"> <div class="metric-card">
<h2>Network Overview</h2> <h2>Network Overview</h2>
<div id="network-health"> <div id="network-health">
<div class="device-status"> {% for device in devices %}
<div class="device-status" data-device-id="{{ device.device_id }}">
<span class="status-indicator"></span> <span class="status-indicator"></span>
<div class="device-info"> <div class="device-info">
<span class="device-name">UniFi Dream Machine Pro</span> <span class="device-name">{{ device.name }}</span>
<span class="device-details">10.10.10.1</span> <span class="device-details">{{ device.ip }}</span>
<span class="device-type">{{ device.type }} ({{ device.connection_type }})</span>
</div> </div>
</div> </div>
<!-- Repeat for other devices --> {% endfor %}
</div> </div>
</div> </div>
</div> </div>
</div>
<script src="{{ url_for('static', filename='app.js') }}"></script> <script src="{{ url_for('static', filename='app.js') }}"></script>
</body> </body>
</html> </html>