This commit is contained in:
Kelorastus
2026-09-29 10:29:52 +02:00
parent 73a8f2c30c
commit 80dd1e7c7d
22 changed files with 1739 additions and 44 deletions
+62 -3
View File
@@ -17,6 +17,9 @@ type Phase =
| "installing" // downloading + verifying a version
| "restoring" // loading the database snapshot into local Postgres
| "syncing" // exchanging operator data with the DHP (ODIAN is not running)
| "pulling_tiles" // fetching tiles the DHP baked while this PC was away
| "removing" // deleting marketplace items the operator unticked
| "building" // dev mode only: compiling the checkout before it launches
| "launching" // starting Postgres → API → tile server → Odian.exe
| "running" // Odian.exe is open
| "error"; // the last long operation failed; see `error`
@@ -41,6 +44,36 @@ interface Status {
live: boolean | null; // while ODIAN runs: true = its data comes from the DHP,
// false = from this PC. null when it is not running, or
// the DHP offers no Engine API to forward to
map_from_site: boolean | null; // while ODIAN runs: false = the map is this PC's own tiles
// because the site's tile service did not answer
map_problem: string | null; // why, in one line, when map_from_site is false
tiles_waiting: Waiting | null; // tiles the DHP baked for the sets this PC holds since its
// last sync: what a sync would fetch. null offline, with
// nothing installed, or when the DHP is too old to ask
unfinished: Unfinished | null; // chosen marketplace items not fully on this PC. ODIAN
// still runs, with less map than was asked for
dev: Licence | null; // this PC's dev licence. null on every operator PC, and
// the window then shows no trace of dev mode at all
}
interface Waiting {
tiles: number; // 0 means this PC is level with the site
sets: number; // how many of its tile sets have something waiting
capped: boolean; // the DHP stopped counting: "50000+"
}
interface Unfinished {
items: number;
bytes: number; // what finishing them downloads IN FULL — the whole item,
// not the gap, which is what the installer skips through
titles: string[]; // the first few, to name in one line
}
interface Licence {
machine: string | null; // the PC it was issued for; null = not tied to one
install_id: string | null; // the install it was issued for; null = not tied to one
expires_at: string; // "YYYY-MM-DD", the last day it works
note: string | null;
}
interface SyncStatus {
@@ -62,10 +95,34 @@ interface SyncConflict {
}
interface Settings {
site_url: string; // e.g. "http://192.168.1.41:30097"
mcp_url: string; // site MCP, for Keycloak sign-in
site_url: string; // e.g. "http://192.168.1.41:30097"; "" = no DHP, run offline
mcp_url: string; // site MCP, for Keycloak sign-in; "" = no sign-in, run offline
ai_url: string; // MCP serving /api/ai/... over the internet; "" = none
install_dir: string;
// Dev mode. Only honoured on a PC whose `dev` licence is valid: `set_settings` stores
// dev_mode as false without one, whatever the window sends.
dev_root: string; // folder holding the checkouts (ODIAN_Engine); "" = none
dev_mode: boolean; // run the stack from the checkout, each part in its own console
dev_user: string; // run as this operator instead of the signed-in one; "" = them.
// A DIFFERENT name switches sync OFF for that run
dev_build: boolean; // build the checkout before launching (phase "building")
dev_target: "client" | "web" | "both"; // which client(s) Launch starts. "both" runs them
// against the ONE stack: same API, same database
}
interface TileSyncProgress {
tiles: number; // tiles written so far
bytes: number;
page_tiles: number; // tiles in the page being written
page_done: number; // of them, written
}
interface RemoveProgress {
title: string; // the item being deleted
done: number; // bytes deleted of it
total: number;
index: number; // which of them, 1-based: one Apply can drop several
count: number;
}
interface InstallProgress {
@@ -81,7 +138,7 @@ interface InstallProgress {
}
interface StackEvent {
component: "postgres" | "api" | "tiles" | "odian";
component: "postgres" | "api" | "tiles" | "odian" | "web"; // "web" only on a dev run
state: "starting" | "ready" | "stopped" | "failed";
message: string | null;
}
@@ -217,4 +274,6 @@ edits wait in the local database until `resolve_sync_conflict`.
| `status` | `Status` | whenever any field changes |
| `install-progress` | `InstallProgress` | at most ~10 per second while installing |
| `stack` | `StackEvent` | on each component state change |
| `tile-sync-progress` | `TileSyncProgress` | while pulling tiles the DHP baked (phase `pulling_tiles`) |
| `remove-progress` | `RemoveProgress` | while deleting unticked marketplace items (phase `removing`) |
| `log` | `LogEvent` | notable backend messages, for the activity panel |