Initial commit — Serveur Lucas SmartEye

API réception alertes chute (SmartEye/YOLO), analyse IA (Gemini 2.5 Flash),
gestion alertes avec escalade (watchdog), notifications Firebase,
dashboard web, documentation MkDocs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-03-14 21:26:06 +01:00
commit 24dbc7cd6a
64 changed files with 9677 additions and 0 deletions

31
acknowledge.php Executable file
View File

@@ -0,0 +1,31 @@
<?php
header("Content-Type: application/json");
$json_file = 'database.json';
// 1. Lire la DB
if (!file_exists($json_file)) die(json_encode(["status"=>"error"]));
$db = json_decode(file_get_contents($json_file), true);
// 2. Récupérer les infos
$client_in = $_REQUEST['client'] ?? '';
$token_in = $_REQUEST['token'] ?? '';
$user = $_REQUEST['user'] ?? 'Inconnu';
// 3. Trouver le client
$idx = -1;
foreach ($db['clients'] as $i => $c) {
if (strcasecmp($c['name'], $client_in)==0 && $c['token']===$token_in) {
$idx = $i; break;
}
}
if ($idx === -1) die(json_encode(["status"=>"error"]));
// 4. JUSTE METTRE À JOUR LE STATUT (On ne touche pas aux images !)
// On garde 'alerte' = true, mais on ajoute 'handled_by'
$db['clients'][$idx]['handled_by'] = $user;
$db['clients'][$idx]['handled_at'] = date("H:i");
file_put_contents($json_file, json_encode($db, JSON_PRETTY_PRINT));
echo json_encode(["status"=>"success"]);
?>