Put everything Varaverk persists under one root, state included

This commit is contained in:
Gmer4Lfe
2026-08-08 23:26:46 -04:00
parent d5c36db531
commit f1603349cc
11 changed files with 420 additions and 77 deletions
+17
View File
@@ -64,6 +64,23 @@
require_once __DIR__ . '/config.php';
require_once __DIR__ . '/unraid_api.php';
// Timestamp out of the container restart log, whose second field is a formatted local date
// ("2026-08-02 13:15:07") rather than an epoch — docker_watchdog.sh writes it that way because
// its own rolling-window trim compares the strings lexically in awk.
//
// Lives here rather than in watchdog.php because include/monitor.php parses the same file for
// the dashboard card and does not include watchdog.php. Both readers previously cast the field
// with (int), which stops at the first non-digit and returned 2026 for every line ever written —
// below any cutoff, so both restart lists were permanently empty and looked exactly like
// "nothing has restarted".
//
// Accepts an epoch too, so that changing the writer later does not require changing the readers.
function vv_wd_restart_ts(string $raw): int {
$raw = trim($raw);
if (ctype_digit($raw)) return (int)$raw;
return (int)(strtotime($raw) ?: 0);
}
function vv_system_info(): array {
// ── Shared local reads (always needed regardless of API) ──────────────────
$ident = @parse_ini_file('/boot/config/ident.cfg') ?: [];