|
@@ -32,9 +32,18 @@ class L2TopologyView extends CController {
|
|
|
$ts_raw = $_REQUEST['ts'] ?? '';
|
|
$ts_raw = $_REQUEST['ts'] ?? '';
|
|
|
$ts = ($ts_raw === '' || $ts_raw === null) ? null : (int) $ts_raw;
|
|
$ts = ($ts_raw === '' || $ts_raw === null) ? null : (int) $ts_raw;
|
|
|
|
|
|
|
|
|
|
+ $requested_ts = $ts;
|
|
|
$snap = L2Store::snapshotAt($ts);
|
|
$snap = L2Store::snapshotAt($ts);
|
|
|
$json = $snap['json'] ?? null;
|
|
$json = $snap['json'] ?? null;
|
|
|
$used_ts = $snap['ts'];
|
|
$used_ts = $snap['ts'];
|
|
|
|
|
+ // A stale bookmark / hand-edited ?ts= must not leave an empty page.
|
|
|
|
|
+ // If that exact snapshot is gone, fall back to the live latest view.
|
|
|
|
|
+ if ($ts !== null && ($json === null || $json === '')) {
|
|
|
|
|
+ $ts = null;
|
|
|
|
|
+ $snap = L2Store::snapshotAt(null);
|
|
|
|
|
+ $json = $snap['json'] ?? null;
|
|
|
|
|
+ $used_ts = $snap['ts'];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// The selector must cover the full retention window, not only the
|
|
// The selector must cover the full retention window, not only the
|
|
|
// latest 500 rows. At 5 minutes / 7 days this is ~2,016 points.
|
|
// latest 500 rows. At 5 minutes / 7 days this is ~2,016 points.
|