Dashboard web FastAPI + Chart.js
- 4 vues : spectre temps reel, historique detections, background, timeline CPS - API REST : /api/status, /api/spectrum/current, /api/spectrum/difference, /api/background, /api/background/spectrum, /api/history, /api/cps/timeline - Frontend vanilla JS + Chart.js (pas de Node.js, leger pour Pi 4) - Moniteur modifie pour exporter son etat dans /data/monitor_state.json et le CPS dans /data/cps_log.jsonl chaque cycle - Nouveau conteneur Docker 'web' sur port 8080 - Theme sombre, calibration energie (E = 0.33 + 2.97 * canal) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
70
web/static/index.html
Normal file
70
web/static/index.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Radiacode 103 — Dashboard</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Radiacode 103</h1>
|
||||
<div id="status-bar">
|
||||
<span id="status-connected" class="status-dot"></span>
|
||||
<span id="status-cps">-- CPS</span>
|
||||
<span id="status-live-time">-- h</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<nav>
|
||||
<a href="#spectrum" class="tab active" data-tab="spectrum">Spectre</a>
|
||||
<a href="#history" class="tab" data-tab="history">Historique</a>
|
||||
<a href="#background" class="tab" data-tab="background">Background</a>
|
||||
<a href="#cps" class="tab" data-tab="cps">CPS</a>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<section id="tab-spectrum" class="tab-content active">
|
||||
<div class="chart-container">
|
||||
<canvas id="spectrum-chart"></canvas>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<label><input type="checkbox" id="show-difference"> Background soustrait</label>
|
||||
<label><input type="checkbox" id="log-scale"> Echelle log</label>
|
||||
</div>
|
||||
<div id="isotopes-table"></div>
|
||||
</section>
|
||||
|
||||
<section id="tab-history" class="tab-content">
|
||||
<div id="history-list"></div>
|
||||
</section>
|
||||
|
||||
<section id="tab-background" class="tab-content">
|
||||
<div class="bg-stats" id="bg-stats"></div>
|
||||
<div class="chart-container">
|
||||
<canvas id="background-chart"></canvas>
|
||||
</div>
|
||||
<div id="peaks-table"></div>
|
||||
</section>
|
||||
|
||||
<section id="tab-cps" class="tab-content">
|
||||
<div class="controls">
|
||||
<button onclick="loadCps(1)">1h</button>
|
||||
<button onclick="loadCps(6)">6h</button>
|
||||
<button onclick="loadCps(24)">24h</button>
|
||||
<button onclick="loadCps(168)">7j</button>
|
||||
</div>
|
||||
<div class="chart-container">
|
||||
<canvas id="cps-chart"></canvas>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script src="/static/js/app.js"></script>
|
||||
<script src="/static/js/spectrum.js"></script>
|
||||
<script src="/static/js/history.js"></script>
|
||||
<script src="/static/js/background.js"></script>
|
||||
<script src="/static/js/cps.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user