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