From 0bb624c372252d6d3a4645259f182652c89ec30d Mon Sep 17 00:00:00 2001 From: "manuel.maier" Date: Wed, 29 Jul 2026 11:38:36 +0200 Subject: [PATCH] Dateien nach "/" hochladen --- api.php | 11 ++ favicon.ico | Bin 0 -> 473 bytes index.html | 283 +++++++++++++++++++++++++++++++++++----------------- 3 files changed, 200 insertions(+), 94 deletions(-) create mode 100644 favicon.ico diff --git a/api.php b/api.php index 88fd5c2..199e5d0 100644 --- a/api.php +++ b/api.php @@ -5,6 +5,17 @@ $db_file = __DIR__ . '/status.sqlite'; $pdo = new PDO('sqlite:' . $db_file); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +// --- Manuelle Bereinigung per Frontend --- +if (isset($_GET['action']) && $_GET['action'] === 'cleanup') { + // FEHLER BEHOBEN: Es muss $pdo heißen, nicht $db! + // Zeitabgleich gefixt: Wir nutzen datetime('now', '-2 minutes'), da der INSERT auch in UTC erfolgt. + $pdo->exec("DELETE FROM nodes WHERE last_seen < datetime('now', '-1 days')"); + + header('Content-Type: application/json'); + echo json_encode(["status" => "success"]); + exit; +} + // Tabelle erstellen, falls nicht existent $pdo->exec("CREATE TABLE IF NOT EXISTS nodes ( id INTEGER PRIMARY KEY AUTOINCREMENT, diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8ca152ddcf375ec59f9f9903dad183e85ff005e8 GIT binary patch literal 473 zcmZQzU<5)11qKkwaF~&SL5zWcp)i^GI2vB$*zkdJy1^og0-_KuPP|)BoA%Fk* z^$iP56B73W6`%2RaSW-Lvvu-qu_grpSI*gcQdE=5FaP_m&74xCFk|~UVT0SHX4wk` z>QA|ey{X~e@c5bPjF5|ozSk}>`33}eO{fk^xE%B#!G5KuV@%N&_IrO?9E6!K?A-dQ zI@j#*&ri$;rsf>Bu3#{o)Uao*ROW%$rH>ne7Q3+tlwUc)_~@bOCWfphjO!<|?_p!s zk($LghpnLDGDl;&^^C)5GOO3Sab(mm99|{Jz{OZIT|YuPc3G<3<9mAo)@lUo5c=gS o``5fnOy#p0>q(KKq~|_%{P(%07u-F)4d^chPgg&ebxsLQ06hn?EdT%j literal 0 HcmV?d00001 diff --git a/index.html b/index.html index a171d7c..392c8cb 100644 --- a/index.html +++ b/index.html @@ -3,8 +3,12 @@ - Gateway Status - -

Gateway Status Übersicht

+
+ +

GW-Status

+ +
@@ -141,7 +188,23 @@ \ No newline at end of file