Add responsive frontend dashboard and updated README - #7
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a static, responsive operations dashboard UI (plus a shift-handover page) intended to be served by the FastAPI backend, updates the README with new “live dashboard” run instructions, and introduces a convenience training pipeline script to generate simulator data and train the anomaly detector.
Changes:
- Added new static frontend pages (
frontend/index.html,frontend/handover.html) with polling-based live telemetry rendering and intervention actions. - Updated
README.mdto reflect the integrated live dashboard launch flow via Uvicorn. - Added
train_pipeline.pyto run simulation → feature extraction → anomaly model training end-to-end.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| train_pipeline.py | Adds an end-to-end local pipeline script to generate data and train the anomaly detector. |
| README.md | Updates project status bullets and documents how to run the integrated dashboard. |
| frontend/index.html | Introduces the main operations dashboard UI with live polling and incident/action rendering. |
| frontend/handover.html | Adds a shift handover/logs UI that polls simulation state and renders shift logs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+10
| <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet"/> | ||
| <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet"/> |
Comment on lines
+491
to
+494
| <lineargradient id="grad2" x1="0%" x2="100%" y1="0%" y2="0%"> | ||
| <stop offset="0%" style="stop-color:#0566d9;stop-opacity:1"></stop> | ||
| <stop offset="100%" style="stop-color:#adc6ff;stop-opacity:1"></stop> | ||
| </lineargradient> |
| } | ||
|
|
||
| document.getElementById('ai-explanation-text').textContent = fusion.explanation || 'Sensors reporting normal operations. No hazard indicators detected.'; | ||
| document.getElementById('ai-confidence-value').textContent = fusion.confidence ? (fusion.confidence * 100).toFixed(1) + '%' : '100.0%'; |
| <!-- Schematic Image (Background-ish) --> | ||
| <div class="mt-lg h-40 w-full rounded-lg bg-surface-container/30 relative overflow-hidden border border-outline-variant/10"> | ||
| <div class="absolute inset-0 opacity-20 pointer-events-none bg-[linear-gradient(rgba(255,255,255,0.05)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.05)_1px,transparent_1px)] bg-[size:20px_20px]"></div> | ||
| <img class="w-full h-full object-contain opacity-60" data-alt="Technical schematic diagram of a CDU-100 distillation unit refinery system with pipes, heat exchangers, and tanks. The style is blue-print aesthetic with glowing industrial green accents and thin technical lines on a dark obsidian background. Cinematic lighting highlights the distillation column in the center." src="https://lh3.googleusercontent.com/aida-public/AB6AXuDxca4FD_3HVlL8WWW1TmA2FTyjvyx3slgA--sM4RS1u2dD-IqOfmEW8G4_q9-1meG2gT8WM5mZIv7V3mBlogwHyl_owmXJQDUOnUBIwBtPjij3zvjTE4gt5n_NxbiaNNH5GBr-76FULZGgWe9k9ZsHLU5saoNld-bCXlB7-sROLSmGq8qF-70hiuqQMbyF1HmmoonwORDYwuSVoHD0GPbj6h6As9ZDnokJP-ayy2vOhDYLe30p70boov2TTqZfRQ4MyBbQXcSe5lv3"/> |
| </div> | ||
| </div> | ||
| <div class="flex-1 relative bg-black"> | ||
| <img class="w-full h-full object-cover opacity-80" data-alt="High-contrast surveillance camera footage of an industrial distillation column base inside a refinery. Deep shadows, glowing green and orange status lights on machinery, and three workers in bright orange safety jumpsuits moving around the base. Grainy digital filter with technical data overlays in the corners (timestamps, thermal heat map signatures in yellow)." src="https://lh3.googleusercontent.com/aida-public/AB6AXuDBtbm7k87ZN9ou_KgN2Wk6cp1--eWf4sq-gLu_C49t3gV4xwdj23oBxNlzbm1dIW1Z7b9nNYa_e6GbqPAOGzGpaLsV9jba0RerMi0I8s_bQupljWDN1Y_D6LCCpyZR9U36L_639EZ3itQAg3k5jS6BtITXbW8rYYCdo92Yyy4F4QLmNoiEs22U4jb66AtclNrZWgzp2yjsrJLdKKkSS2pHlbpG-H4ar5n3OSpJwgRmdVY0fH46oUa-_46cmsGwoCnLJFC5ImVslsyU"/> |
| <a class="flex items-center gap-md p-md text-on-surface-variant hover:text-on-surface hover:bg-surface-variant/40 transition-all rounded-lg font-label-md text-label-md" href="/"> | ||
| <span class="material-symbols-outlined">dashboard</span> Overview Dashboard | ||
| </a> | ||
| <a class="flex items-center gap-md p-md bg-secondary-container text-on-secondary-container rounded-lg font-bold shadow-[0_0_15px_rgba(5,102,217,0.3)] transition-all scale-98 font-label-md text-label-md" href="/handover"> |
| <div class="flex gap-gutter"> | ||
| <div class="glass-panel p-md rounded-lg flex items-center gap-md border-primary/20"> | ||
| <div class="w-10 h-10 rounded-full border-2 border-primary-container overflow-hidden"> | ||
| <img class="w-full h-full object-cover" data-alt="Mark Chen Outgoing Supervisor" src="https://lh3.googleusercontent.com/aida-public/AB6AXuA0poxk30n9omXfYjplwAyCJuY98pztXYF795IpUa3v0jKMsCwBAkCTzNVUCTdVUkiRWygjRtHb591bbicKS4QIIBntjbqdtmgd48VO5x2sPg3csrrFs9CPusCumTvLx0-CqW5W3uLLm7r5BXKBIwqxgxqabdpvBL7wLLFfJci87eev1RlEPueGiM71zVhkVKzrPFfNnYYNvf0JcEdltZmzurH1u0QVGY7Mu8XKtyyFVn_7HyfZo5hhoFGLMX7vC0eh4Y0MYaxIXxl9"/> |
| </div> | ||
| <div class="glass-panel p-md rounded-lg flex items-center gap-md border-secondary/20"> | ||
| <div class="w-10 h-10 rounded-full border-2 border-secondary-container overflow-hidden"> | ||
| <img class="w-full h-full object-cover" data-alt="Sarah Jenkins Incoming Supervisor" src="https://lh3.googleusercontent.com/aida-public/AB6AXuDuKrLEzeOnlA0t1Q7FwyI5yojipZnsHzCMxtLtxi4EmCJnoWFrYjHQLS35n0b5uE77J9UlCu82YPJsdBOa-BQEEaEwsMukJF8QxixhRtxzMwrLxSR6Jn550xxT2221NhbDD_5rjgT5r39Qc7eVbnASvFg3sUbkw1YhKrCEKmI0_sy20BN7RVUzn25GgttPjGLlFKzFWlhFK6s8mHckXNGKhddJmKRXu2NF3K6Ff8bc0AkOrNazL58W6XaJ_5KP1GEOEmsGhHXUc9Pf"/> |
Comment on lines
+393
to
+411
| // Render shift logs | ||
| let logsHtml = ""; | ||
| if (data.shift_logs && data.shift_logs.length > 0) { | ||
| data.shift_logs.slice().reverse().forEach(log => { | ||
| let severityClass = "text-on-surface-variant"; | ||
| if (log.severity === "CRITICAL") severityClass = "text-error font-bold"; | ||
| else if (log.severity === "WARNING") severityClass = "text-tertiary font-bold"; | ||
|
|
||
| logsHtml += ` | ||
| <div class="flex items-start gap-md p-sm hover:bg-surface-variant/20 rounded-md border-b border-outline-variant/10 text-sm"> | ||
| <span class="text-primary font-code-data">${log.timestamp}</span> | ||
| <span class="font-bold text-secondary">[${log.operator}]</span> | ||
| <span class="flex-1 ${severityClass}">${log.message}</span> | ||
| </div>`; | ||
| }); | ||
| } else { | ||
| logsHtml = `<p class="text-xs text-on-surface-variant text-center my-auto">Waiting for simulator log messages...</p>`; | ||
| } | ||
| document.getElementById('handover-logs').innerHTML = logsHtml; |
Comment on lines
+844
to
+861
| // CCTV log lines | ||
| let cLogs = ""; | ||
| if (details.cctv && details.cctv.length > 0) { | ||
| details.cctv.slice(-3).forEach(c => { | ||
| const timePart = c.timestamp.split('T')[1].substring(0,8); | ||
| cLogs += ` | ||
| <div class="flex items-center gap-md text-[10px] font-code-data text-on-surface-variant"> | ||
| <span class="text-primary">${timePart}</span> | ||
| <span>${c.event_type} (Conf: ${(c.confidence * 100).toFixed(0)}%)</span> | ||
| </div>`; | ||
| }); | ||
| } else { | ||
| cLogs += ` | ||
| <div class="flex items-center gap-md text-[10px] font-code-data text-on-surface-variant"> | ||
| <span>No active events on feed</span> | ||
| </div>`; | ||
| } | ||
| document.getElementById('cctv-logs-container').innerHTML = cLogs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.