Add active/inactive/game-time timers to fleet + server pages
Fleet cards and the per-server detail hero now show three live-ticking timers: Active (since players > 0), Inactive (since server emptied), and Game (since InitGame in games_sp.log, back-computed from the log's own MM:SS prefix so it stays accurate across restarts). Anchors are persisted on `servers` and fanned out via the SSE bus; a single 1s ticker feeds every card. Idle map cycles are filtered out so the game timer doesn't flicker.
This commit is contained in:
+18
-2
@@ -21,6 +21,10 @@
|
||||
health: Health;
|
||||
endpoint: { host: string; port: number } | null;
|
||||
held: HeldRow[];
|
||||
active_since: string | null;
|
||||
inactive_since: string | null;
|
||||
game_started_at: string | null;
|
||||
game_ended_at: string | null;
|
||||
}
|
||||
|
||||
let servers = $state<ServerRow[]>([]);
|
||||
@@ -47,7 +51,11 @@
|
||||
roster: fallback.roster,
|
||||
health: fallback.health,
|
||||
lastSeenAt: fallback.last_seen_at,
|
||||
lastError: fallback.last_error
|
||||
lastError: fallback.last_error,
|
||||
activeSince: fallback.active_since,
|
||||
inactiveSince: fallback.inactive_since,
|
||||
gameStartedAt: fallback.game_started_at,
|
||||
gameEndedAt: fallback.game_ended_at
|
||||
};
|
||||
}
|
||||
return {
|
||||
@@ -57,7 +65,11 @@
|
||||
roster: live.roster,
|
||||
health: live.health,
|
||||
lastSeenAt: live.lastSeenAt,
|
||||
lastError: live.lastError
|
||||
lastError: live.lastError,
|
||||
activeSince: live.activeSince,
|
||||
inactiveSince: live.inactiveSince,
|
||||
gameStartedAt: live.gameStartedAt,
|
||||
gameEndedAt: live.gameEndedAt
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -91,6 +103,10 @@
|
||||
lastSeenAt={live.lastSeenAt}
|
||||
lastError={live.lastError}
|
||||
held={s.held}
|
||||
activeSince={live.activeSince}
|
||||
inactiveSince={live.inactiveSince}
|
||||
gameStartedAt={live.gameStartedAt}
|
||||
gameEndedAt={live.gameEndedAt}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user