Files
Heimdall/docs/ui-pages.md
T
Arnaud Dartois 32ba481da1 docs: restructure documentation with UI pages, fix implementation order
- Create docs/ui-pages.md with detailed descriptions of all 8 UI pages
  (Login, Dashboard, Sites, Cameras, Persons, Events, Admin, Alerts)
  including MudBlazor components, states, and tests per page
- Rewrite implementation.md with correct dependency order:
  Auth → Sites → Agent Registration → ONVIF → Cameras → FFmpeg →
  AI → Storage → Hangfire → Blazor (basic) → WebRTC → Live Video LAST
- Add Agent bootstrap flow with token registration
- Add two-tier AI pipeline (CPU pre-detect on Agent, GPU on Central)
- Add IMU camera protocol specifics and ONVIF network limitations
- Add GPU passthrough Docker documentation
- Add Blazor Server + WebRTC JS Interop pattern
- Add MinIO/S3 centralized storage model with bandwidth impact analysis
- Add SFU (MediaMTX) for multi-user WebRTC scenarios
2026-07-16 19:21:14 +00:00

498 lines
28 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Heimdall — Interface Utilisateur (Blazor + MudBlazor)
Interface complète en Blazor Interactive Server avec MudBlazor.
Toutes les pages sont accessibles après authentification (sauf Login).
---
## P1 — Login
**Route** : `/login`
**Auth** : Non (publique)
### Contenu
```text
┌──────────────────────────────────┐
│ HEIMDALL │
│ Intelligent Surveillance │
│ │
│ ┌────────────────────────┐ │
│ │ Email │ │
│ └────────────────────────┘ │
│ ┌────────────────────────┐ │
│ │ Mot de passe │ │
│ └────────────────────────┘ │
│ │
│ [ Se connecter ] [Loading] │
│ │
│ ──── ou ──────────────── │
│ │
│ [ Clé API ] → page login │
│ API Key │
│ │
├──────────────────────────────────┤
│ Footer: version, liens │
└──────────────────────────────────┘
```
### États
| État | Comportement |
|---|---|
| **Idle** | Champs vides, bouton actif |
| **Loading** | `MudButton.Loading=true`, champs désactivés |
| **Erreur** | `MudAlert` rouge "Email ou mot de passe invalide" |
| **API Key** | Champ UUID + validation → redirection |
| **Succès** | Redirection vers Dashboard |
### Tests
```
User can login with valid credentials
Invalid email shows error message
API key login works for external users
Login page redirects authenticated users
```
---
## P2 — Dashboard
**Route** : `/`
**Auth** : Requise
### Contenu
```text
┌──────────────────────────────────────────────────────┐
│ 🏠 Dashboard [▲] 12 caméras en ligne│
│ │
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │📷 24 │ │📹 12 │ │🚗 8 │ │💾 2.4TB│ │
│ │Total │ │En ligne│ │Aujour- │ │Stockage│ │
│ │Cams │ │ │ │d'hui │ │libre │ │
│ └────────┘ └────────┘ └────────┘ └────────┘ │
│ │
│ ┌────────────────────────────────────────────────┐ │
│ │ Événements récents [Voir]> │ │
│ │ │ │
│ │ 🟢 14:23 — Personne détectée — Entrée │ │
│ │ 🟡 14:20 — Véhicule detecté — Parking │ │
│ │ 🔴 14:15 — Visage inconnu — Entrée │ │
│ │ 🟢 14:10 — Mouvement — Jardin │ │
│ └────────────────────────────────────────────────┘ │
│ │
│ State des Agents (MudChip) │
│ 🟢 Entrepôt A 🟢 Entrepôt B 🔴 Bureaux │
│ │
│ Alertes non lues : 3 [Voir] │
└──────────────────────────────────────────────────────┘
```
### MudBlazor Components
| Component | Usage |
|---|---|
| `MudContainer` | Layout page |
| `MudCard` × 4 | KPI cards |
| `MudIcon` + `MudText` | KPI values |
| `MudTable` | Événements récents (5 lignes) |
| `MudChip` | State des Agents |
| `MudBadge` | Alertes non lues |
| `MudButton` | Voir tout |
### États
| État | Comportement |
|---|---|
| **Chargé** | KPIs + events + agents |
| **Empty** | "Aucune caméra configurée" + lien "Ajouter un site" |
| **Loading** | MudSkeleton cards |
| **Erreur** | MudAlert "Impossible de charger le tableau de bord" |
| **Tous offline** | Bannière rouge "Aucun Agent connecté" |
### Tests
```
Dashboard shows camera KPI
Dashboard shows event list
Empty dashboard shows setup prompt
Dashboard updates on new events (SignalR)
Dashboard shows agent offline state
```
---
## P3 — Sites
### Liste — P3a
**Route** : `/sites`
**Auth** : Requise
```text
┌──────────────────────────────────────────────────────┐
│ Sites [+ Nouveau site] │
│ │
│ ┌──────────────────────────────────────────────────┐│
│ │ 🏢 Entrepôt A 🟢 8 cams [Détails] [×]││
│ │ Paris, 75012 ││
│ ├──────────────────────────────────────────────────┤│
│ │ 🏢 Entrepôt B 🟠 0 cams [Détails] [×]││
│ │ Lyon, 69003 Agent offline ││
│ ├──────────────────────────────────────────────────┤│
│ │ 🏢 Bureaux 🔴 — [Détails] [×]││
│ │ Paris, 75008 Aucun agent ││
│ └──────────────────────────────────────────────────┘│
└──────────────────────────────────────────────────────┘
```
**Components** : `MudTable`, `MudChip` (status), `MudIconButton`
### Détail — P3b
**Route** : `/sites/{id}`
**Auth** : Requise
```text
┌──────────────────────────────────────────────────────┐
│ 🏢 Entrepôt A [Modifier] │
│ Paris, 75012 · tz: Europe/Paris │
│ │
│ ┌───── Tabs ─────────────────────────────────────┐ │
│ │ 📷 Caméras | 👤 Agents | ⚙️ Configuration │ │
│ │ │ │
│ │ [Tab Caméras] │ │
│ │ ┌──────────────────────────────────────────────┐ │ │
│ │ │ 📷 Entrée 1080p H264 🟢 Online [Live] │ │ │
│ │ │ 📷 Parking 1080p H264 🟢 Online [Live] │ │ │
│ │ │ 📷 Jardin 720p H264 🔴 Offline [Live] │ │ │
│ │ └──────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [Tab Agents] │ │
│ │ ┌──────────────────────────────────────────────┐ │ │
│ │ │ 🤖 agent-01 v1.2.0 🟢 Online il y a 12s │ │ │
│ │ │ IP: 192.168.1.42 GPU: NVIDIA RTX 3060 │ │ │
│ │ └──────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [Tab Configuration] │ │
│ │ ┌──────────────────────────────────────────────┐ │ │
│ │ │ Détection IA: ✅ Active │ │ │
│ │ │ Enregistrement: Continu (24/7) │ │ │
│ │ │ Rétention: 30 jours │ │ │
│ │ │ Notification: Email + Webhook │ │ │
│ │ └──────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ Token d'enregistrement Agent │ │
│ │ │ │
│ │ [Générer un token] │ │
│ │ │ │
│ │ ┌──────────────────────────────────────────┐ │ │
│ │ │ Token: a1b2c3d4-... (caché après création)│ │ │
│ │ └──────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Commande Docker à exécuter sur le site distant : │ │
│ │ ┌──────────────────────────────────────────┐ │ │
│ │ │ docker run -e HEIMDALL_CENTRAL_URL=... │ │ │
│ │ │ -e HEIMDALL_SITE_TOKEN=... │ │ │
│ │ │ heimdall/agent:latest │ │ │
│ │ └──────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [Copier la commande] [× Révoquer le token] │ │
│ └──────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘
```
**Components** : `MudTabs`, `MudTable`, `MudChip`, `MudTextField`, `MudButton`, `MudSnackbar` (copié)
### États — Détail Site
| État | Comportement |
|---|---|
| **Chargé** | Tabs + infos site |
| **Loading** | `MudSkeleton` |
| **Token généré** | Affiche token 1 seule fois + snackbar "Copié !" |
| **Token révoqué** | Disparaît, bouton "Générer" réapparaît |
| **Agent offline > 90s** | `MudChip` rouge + "Dernière vue il y a X min" |
---
## P4 — Caméras
### Live View — P4a (DERNIÈRE page implémentée)
**Route** : `/cameras/{id}/live`
**Auth** : Requise
```text
┌──────────────────────────────────────────────────────┐
│ 📷 Entrée — Live [Plein écran]│
│ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ │ │
│ │ FLUX VIDÉO WEBRTC │ │
│ │ │ │
│ │ <video> élément HTML natif │ │
│ │ │ │
│ │ ⏳ Loading... | 🟢 Live | 🔴 Offline │ │
│ │ │ │
│ └──────────────────────────────────────────────────┘ │
│ │
│ Qualité: [1080p ▼] [📷 Snapshot] [⏺️ Enregistrer]│
│ │
│ ┌───Événements récents (cette caméra)────────────┐ │
│ │ 🟢 14:23 — Personne détectée │ │
│ │ 🟡 14:20 — Véhicule détecté │ │
│ └────────────────────────────────────────────────┘ │
│ │
│ Timeline: [══════■══════■══════════■══════] │
│ 14:00 14:10 14:20 14:30 Maintenant │
└──────────────────────────────────────────────────────┘
```
**Attention Blazor Server + WebRTC** : Voir §26 de la spec — le flux WebRTC
est géré par un module JS autonome (`wwwroot/js/liveView.js`) qui survit
aux reconnexions Blazor. Le `<video>` est un élément HTML standard,
pas un composant Blazor.
### Détail Caméra — P4b
**Route** : `/cameras/{id}`
**Auth** : Requise
```text
┌──────────────────────────────────────────────────────┐
│ 📷 Entrée [Modifier] │
│ Site: Entrepôt A · Agent: agent-01 │
│ │
│ ┌───────────── Infos ─────────────────────────────┐ │
│ │ Manufacturer: Imou │ │
│ │ Model: IPC-T2A30P │ │
│ │ Firmware: v3.2.1 │ │
│ │ Status: 🟢 Online │ │
│ │ Résolution: 1920x1080 @ 25fps │ │
│ │ Codec: H264 │ │
│ └──────────────────────────────────────────────────┘ │
│ │
│ ┌───────────── Configuration ──────────────────────┐ │
│ │ [Détection IA] ✅ Active Modèle: yolov8n │ │
│ │ Enregistrement: [Continu ▼] │ │
│ │ Rétention: [30 jours ▼] │ │
│ │ Snapshot interval: [200ms ▼] │ │
│ │ Notification: Personnes + Véhicules │ │
│ └──────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘
```
---
## P5 — Personnes
**Route** : `/persons`
**Auth** : Requise
```text
┌──────────────────────────────────────────────────────┐
│ Personnes [Nouvelle personne] │
│ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ 🔍 [Rechercher... ] │ │
│ ├──────────────────────────────────────────────────┤ │
│ │ ┌──────┐ ┌──────┐ ┌──────┐ ┌────────┐ │ │
│ │ │Photo │ │Photo │ │Photo │ │ +24 │ │ │
│ │ │Jean │ │Marie │ │Paul │ │inconnus│ │ │
│ │ └──────┘ └──────┘ └──────┘ └────────┘ │ │
│ └──────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘
```
**Components** : `MudGrid`, `MudCard` (person card), `MudAvatar`, `MudTextField` (search)
### Détail Personne
**Route** : `/persons/{id}`
```text
┌──────────────────────────────────────────────────────┐
│ Jean Dupont [Modifier] │
│ │
│ ┌──────┐ Notes: Agent de sécurité │
│ │Photo │ Tél: 06 XX XX XX XX │
│ │ │ Email: jean@example.com │
│ └──────┘ │
│ │
│ Échantillons faciaux (3) │
│ ┌──────┐ ┌──────┐ ┌──────┐ │
│ │ #001 │ │ #002 │ │ #003 │ │
│ └──────┘ └──────┘ └──────┘ │
│ │
│ Véhicules associés │
│ │ 🚗 AA-123-XX (Renault Clio — Gris) │
│ │
│ Historique des événements (30 derniers jours) │
│ │ 📷 14/07 08:23 — Entrée reconnu │
│ │ 📷 13/07 18:45 — Parking reconnu │
│ │ 📷 12/07 12:00 — Entrée reconnu │
└──────────────────────────────────────────────────────┘
```
---
## P6 — Événements
**Route** : `/events`
**Auth** : Requise
```text
┌──────────────────────────────────────────────────────┐
│ Événements Filtres: [Site ▼] [Type ▼] [Date ▼]
│ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ 🔴 14:23 Entrée Personne détectée [Voir]│ │
│ │ 🟡 14:20 Parking Véhicule détecté [Voir]│ │
│ │ 🔵 14:15 Entrée Visage inconnu [Voir]│ │
│ │ 🟢 14:10 Jardin Mouvement [Voir]│ │
│ │ 🟡 13:55 Parking AA-123-XX détectée [Voir]│ │
│ └──────────────────────────────────────────────────┘ │
│ P1 ◀ [1] [2] [3] ▶ P3 50 événements/page │
└──────────────────────────────────────────────────────┘
```
**Components** : `MudTable`, `MudSelect` (filters), `MudDateRangePicker`, `MudPagination`, `MudChip` (type)
---
## P7 — Administration
**Route** : `/admin`
**Auth** : Requise + `Administration.Manage`
```text
┌──────────────────────────────────────────────────────┐
│ Administration │
│ │
│ ┌──── Tabs ───────────────────────────────────────┐ │
│ │ Utilisateurs | Rôles | Clés API | Jobs │ │
│ │ │ │
│ │ [Tab Utilisateurs] │ │
│ │ ┌──────────────────────────────────────────────┐ │ │
│ │ │ Jean Dupont Admin jean@ex.com [×] │ │ │
│ │ │ Marie Martin Superviseur marie@ex.com [×] │ │ │
│ │ │ Paul View paul@ex.com [×] │ │ │
│ │ └──────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [Tab Clés API] │ │
│ │ ┌──────────────────────────────────────────────┐ │ │
│ │ │ Key-1 Camera.Read 01/01/2026 Actif [×] │ │ │
│ │ │ Key-2 Camera.Write 15/06/2026 Expiré [×] │ │ │
│ │ │ Key-3 Person.Read 01/07/2026 Actif [×] │ │ │
│ │ └──────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [Tab Jobs Hangfire] │ │
│ │ ┌──────────────────────────────────────────────┐ │ │
│ │ │ Retention Check Tous les jours 🟢 OK │ │ │
│ │ │ S3 Cleanup Tous les jours 🟢 OK │ │ │
│ │ │ Unknown Faces Clean Toutes les sem. 🟢 OK │ │ │
│ │ └──────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘
```
---
## P8 — Alertes & Notifications
### Modal (overlay)
```text
┌──────────────────────────────────────────┐
│ 🔔 Alertes [Tout lu] │
│ │
│ 🟢 14:23 Entrée Personne détectée │
│ 🟠 14:20 Parking Plaque inconnue │
│ 🔴 14:15 Entrée Visage inconnu │
│ │
│ ──── │
│ │
│ ⚙️ Configurer les notifications │
└──────────────────────────────────────────┘
```
Accessible depuis `MudBadge` dans la barre de navigation.
Les événements arrivent en temps réel via SignalR.
### Configuration notifications
```text
┌──────────────────────────────────────────┐
│ Notifications │
│ │
│ Canaux : │
│ [✅] Notification in-app (SignalR) │
│ [✅] Email │
│ [ ] Webhook │
│ │
│ Événements : │
│ [✅] Personne détectée │
│ [✅] Visage inconnu │
│ [✅] Véhicule détecté │
│ [ ] Mouvement seul │
│ [ ] Caméra offline │
└──────────────────────────────────────────┘
```
---
## Navigation & Layout
### App Bar (top)
```text
┌──────────────────────────────────────────────────────┐
│ ☰ Heimdall 📷 Sites 👤 Personnes ⚙️ Admin │ 🔔 3 │ 😊 Jean │
└──────────────────────────────────────────────────────┘
```
### Drawer (left, responsive)
```text
┌──────────┬───────────────────────────────────────────┐
│ ☰ Menu │ │
│ │ │
│ 🏠 │ CONTENU PRINCIPAL │
│ Dashboard│ │
│ │ │
│ 📷 Sites │ │
│ │ │
│ 👤 Persons│ │
│ │ │
│ 🚗 │ │
│ Vehicles │ │
│ │ │
│ ⚙️ Admin │ │
│ │ │
│ 📄 Logs │ │
└──────────┴───────────────────────────────────────────┘
```
`MudDrawer` avec `MudNavMenu` responsive — se rétracte en icônes sur mobile.
---
## Règles générales UI
| Règle | Application |
|---|---|
| **Loading state** | `MudSkeleton` partout |
| **Empty state** | "Aucun résultat" avec illustration MudBlazor |
| **Error state** | `MudAlert` avec retry button |
| **Temps réel** | SignalR pour events, notifications, status |
| **Confirmations** | `MudDialog` pour delete |
| **Formulaires** | `MudForm` + `FluentValidation` |
| **Thème** | Light/Dark/Auto par utilisateur |
| **Localisation** | `T.T("key")` — français par défaut |
| **Responsive** | Mobile-first avec MudBreakpoint |