Add server chat tab and show all four players

This commit is contained in:
2026-09-19 23:05:41 -04:00
parent 44b6415821
commit 070e7fe9f7
5 changed files with 155 additions and 2 deletions
+7 -1
View File
@@ -18,6 +18,7 @@
import { elapsedSince } from '$ui/duration.js';
import PlayerScoreboard from '$ui/components/PlayerScoreboard.svelte';
import LogPanel from '$ui/components/LogPanel.svelte';
import ChatPanel from '$ui/components/ChatPanel.svelte';
import { gametypeLabel } from '$ui/gametype.js';
import { decodeRconError, rconFixHint } from '$ui/rconError.js';
import { komodoFixHint, type KomodoPortFailure } from '$ui/komodoError.js';
@@ -101,7 +102,7 @@
let rconProbe = $state<RconProbeResult | null>(null);
let probingRcon = $state(false);
let destroyOpen = $state(false);
const sectionIds = ['scoreboard', 'logs', 'config', 'inventory', 'diagnostics', 'history'];
const sectionIds = ['scoreboard', 'chat', 'logs', 'config', 'inventory', 'diagnostics', 'history'];
const activeTab = $derived(sectionIds.includes($page.url.searchParams.get('tab') ?? '') ? $page.url.searchParams.get('tab')! : 'scoreboard');
function changeTab(tab: string) {
const url = new URL($page.url);
@@ -212,6 +213,7 @@
// Tab config — Diagnostics gets a warning badge when there's an issue.
let tabs = $derived([
{ id: 'scoreboard', label: 'Scoreboard', badge: scoreboard?.players.length ?? null },
{ id: 'chat', label: 'Chat' },
{ id: 'logs', label: 'Logs' },
{ id: 'config', label: 'Config' },
{ id: 'inventory', label: 'Inventory', badge: inventory.length || null },
@@ -308,6 +310,10 @@
<Card padding="lg">
{#key name}<PlayerScoreboard report={scoreboard} mapLabel={scoreboard ? fleetIdentity({ ...server, last_map: scoreboard.map }).map : undefined} />{/key}
</Card>
{:else if activeTab === 'chat'}
<Card padding="lg">
{#key name}<ChatPanel server={name} game={server.game} />{/key}
</Card>
{:else if activeTab === 'logs'}
<Card padding="lg">
<LogPanel