diff --git a/api/scanner.py b/api/scanner.py index c4a0e1a..94a6660 100644 --- a/api/scanner.py +++ b/api/scanner.py @@ -152,12 +152,13 @@ def get_sensor_details(friendly_date = False): first_seen = ts_to_pst_string(sensor.first_seen) last_seen = ts_to_pst_string(sensor.last_seen) # print(f"Summary - {sensor.name}") + sensor_dict = sensor.to_dict() new_sensor = { "name": sensor.name, "first_seen": first_seen, "last_seen": last_seen, "comment": sensor.comment, - "data": sensor.to_dict() + **sensor_dict } sensor_list.append(new_sensor) diff --git a/web_dash/web/html/index.php b/web_dash/web/html/index.php index 594fcb8..3350f38 100644 --- a/web_dash/web/html/index.php +++ b/web_dash/web/html/index.php @@ -3,7 +3,7 @@ declare(strict_types=1); # ---------- Settings ---------- date_default_timezone_set('America/Los_Angeles'); -$api_host = 'http://172.17.0.1'; +$api_host = 'http://172.20.20.51'; $api_port = 5001; // drive‑health API $api_path = '/details'; // endpoint that returns the JSON you showed @@ -24,7 +24,9 @@ function fetch_json(string $url): ?array # ---------- Load data ---------- $api_url = "$api_host:$api_port$api_path"; $payload = fetch_json($api_url); - +foreach ($payload['sensors'] as $s){ + echo $s; +} # ---------- Render ---------- ?> @@ -34,9 +36,7 @@ $payload = fetch_json($api_url);