added diag content
This commit is contained in:
4
app.py
4
app.py
@ -163,8 +163,10 @@ def get_diagnostics():
|
||||
config = load_config()
|
||||
diagnostics = {}
|
||||
for device in config['devices']:
|
||||
if device['device_id']:
|
||||
if device.get('device_id'):
|
||||
logger.debug(f"Fetching diagnostics for device: {device['name']}")
|
||||
diagnostics[device['name']] = run_diagnostics(device)
|
||||
logger.debug(f"Returning diagnostics: {diagnostics}")
|
||||
return jsonify(diagnostics)
|
||||
|
||||
# Application entry point
|
||||
|
||||
@ -31,9 +31,11 @@ function updateSystemMetrics() {
|
||||
|
||||
//Metric updates like interfaces, power, and health
|
||||
function updateDiagnostics() {
|
||||
console.log('Updating diagnostics...');
|
||||
fetch('/api/diagnostics')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
console.log('Received diagnostic data:', data);
|
||||
const diagnosticsPanel = document.querySelector('.diagnostics-content');
|
||||
diagnosticsPanel.innerHTML = '';
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<h2>Interface Status</h2>
|
||||
<div id="interface-details"></div>
|
||||
<div id="interface-details" class="diagnostics-content"></div>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<h2>System Health</h2>
|
||||
|
||||
Reference in New Issue
Block a user