Claude Code Claude Opus 4.6 commited on
Commit
cc0947e
·
1 Parent(s): 6bf9b6d

Claude Code: Add fixed status indicator to dashboard header

Browse files

- Add #status-indicator element with fixed positioning (top-right)
- Style with monospace font, padding, border-radius
- Update indicator text/color based on health: HEALTHY (green), UNHEALTHY (red)
- Initial state shows "CONNECTING..."

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. frontend/agent-dashboard.html +38 -0
frontend/agent-dashboard.html CHANGED
@@ -43,6 +43,27 @@
43
  font-size: 14px;
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  .status-bar {
47
  display: flex;
48
  gap: 20px;
@@ -551,6 +572,7 @@
551
  <div class="dashboard-container">
552
  <!-- Header -->
553
  <div class="header">
 
554
  <h1>Agent Thoughts Dashboard</h1>
555
  <div class="subtitle">Real-time visualization of agent cognitive processes</div>
556
 
@@ -1178,6 +1200,7 @@
1178
  const stateEl = document.getElementById('cainState');
1179
  const detailEl = document.getElementById('cainDetail');
1180
  const lastUpdatedEl = document.getElementById('cainLastUpdated');
 
1181
 
1182
  // Extract verified values from API response
1183
  const apiStage = data.stage || data.current_stage || 'UNKNOWN';
@@ -1191,14 +1214,29 @@
1191
  healthDot.classList.add('healthy');
1192
  healthEl.textContent = 'Healthy';
1193
  healthEl.style.color = '#28a745';
 
 
 
 
 
1194
  } else if (health === 'degraded' || health === 'warning' || health === 'fair') {
1195
  healthDot.classList.add('degraded');
1196
  healthEl.textContent = 'Degraded';
1197
  healthEl.style.color = '#f57c00';
 
 
 
 
 
1198
  } else {
1199
  healthDot.classList.add('unhealthy');
1200
  healthEl.textContent = health === 'unknown' ? 'Unknown' : 'Unhealthy';
1201
  healthEl.style.color = health === 'unknown' ? '#999' : '#dc3545';
 
 
 
 
 
1202
  }
1203
 
1204
  // Update stage, state, and detail
 
43
  font-size: 14px;
44
  }
45
 
46
+ #status-indicator {
47
+ position: fixed;
48
+ top: 10px;
49
+ right: 10px;
50
+ background-color: #333;
51
+ color: white;
52
+ padding: 5px 10px;
53
+ border-radius: 4px;
54
+ font-family: monospace;
55
+ font-size: 12px;
56
+ z-index: 1000;
57
+ }
58
+
59
+ #status-indicator.healthy {
60
+ background-color: #28a745;
61
+ }
62
+
63
+ #status-indicator.unhealthy {
64
+ background-color: #dc3545;
65
+ }
66
+
67
  .status-bar {
68
  display: flex;
69
  gap: 20px;
 
572
  <div class="dashboard-container">
573
  <!-- Header -->
574
  <div class="header">
575
+ <div id="status-indicator">CONNECTING...</div>
576
  <h1>Agent Thoughts Dashboard</h1>
577
  <div class="subtitle">Real-time visualization of agent cognitive processes</div>
578
 
 
1200
  const stateEl = document.getElementById('cainState');
1201
  const detailEl = document.getElementById('cainDetail');
1202
  const lastUpdatedEl = document.getElementById('cainLastUpdated');
1203
+ const statusIndicator = document.getElementById('status-indicator');
1204
 
1205
  // Extract verified values from API response
1206
  const apiStage = data.stage || data.current_stage || 'UNKNOWN';
 
1214
  healthDot.classList.add('healthy');
1215
  healthEl.textContent = 'Healthy';
1216
  healthEl.style.color = '#28a745';
1217
+ // Update status indicator
1218
+ if (statusIndicator) {
1219
+ statusIndicator.textContent = 'HEALTHY';
1220
+ statusIndicator.className = 'healthy';
1221
+ }
1222
  } else if (health === 'degraded' || health === 'warning' || health === 'fair') {
1223
  healthDot.classList.add('degraded');
1224
  healthEl.textContent = 'Degraded';
1225
  healthEl.style.color = '#f57c00';
1226
+ // Update status indicator
1227
+ if (statusIndicator) {
1228
+ statusIndicator.textContent = 'DEGRADED';
1229
+ statusIndicator.className = '';
1230
+ }
1231
  } else {
1232
  healthDot.classList.add('unhealthy');
1233
  healthEl.textContent = health === 'unknown' ? 'Unknown' : 'Unhealthy';
1234
  healthEl.style.color = health === 'unknown' ? '#999' : '#dc3545';
1235
+ // Update status indicator
1236
+ if (statusIndicator) {
1237
+ statusIndicator.textContent = health === 'unknown' ? 'UNKNOWN' : 'UNHEALTHY';
1238
+ statusIndicator.className = health === 'unknown' ? '' : 'unhealthy';
1239
+ }
1240
  }
1241
 
1242
  // Update stage, state, and detail