Files
html/api/blade-status.php
2026-04-12 22:57:03 +02:00

8 lines
346 B
PHP

<?php
header("Content-Type:application/json");
$raw=file_get_contents("http://127.0.0.1/api/blade-poll.php?k=BLADE2026&action=status");
$d=json_decode($raw,true);
$hb=$d["heartbeat"]??[];
$online=$hb&&isset($hb["ts"])&&(time()-strtotime($hb["ts"])<300);
echo json_encode(["blade"=>["online"=>$online,"heartbeat"=>$hb,"stats"=>$d["stats"]??[]]]);