Add persistent match history to server pages
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import MatchHistory from '$ui/components/MatchHistory.svelte';
|
||||
import RoundTelemetry from '$ui/components/RoundTelemetry.svelte';
|
||||
import TelemetryDiagnostics from '$ui/components/TelemetryDiagnostics.svelte';
|
||||
import { pollVisible } from '$ui/poll.js';
|
||||
@@ -102,7 +103,7 @@
|
||||
let rconProbe = $state<RconProbeResult | null>(null);
|
||||
let probingRcon = $state(false);
|
||||
let destroyOpen = $state(false);
|
||||
const sectionIds = ['scoreboard', 'chat', 'logs', 'config', 'inventory', 'diagnostics', 'history'];
|
||||
const sectionIds = ['scoreboard', 'matches', '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);
|
||||
@@ -214,6 +215,7 @@
|
||||
let tabs = $derived([
|
||||
{ id: 'scoreboard', label: 'Scoreboard', badge: scoreboard?.players.length ?? null },
|
||||
{ id: 'chat', label: 'Chat' },
|
||||
{ id: 'matches', label: 'Matches' },
|
||||
{ id: 'logs', label: 'Logs' },
|
||||
{ id: 'config', label: 'Config' },
|
||||
{ id: 'inventory', label: 'Inventory', badge: inventory.length || null },
|
||||
@@ -516,6 +518,8 @@
|
||||
</div>
|
||||
</Card>
|
||||
<div id="telemetry">{#key name}<TelemetryDiagnostics server={name} />{/key}</div>
|
||||
{:else if activeTab === 'matches'}
|
||||
{#key name}<MatchHistory server={name} />{/key}
|
||||
{:else if activeTab === 'history'}
|
||||
{#if operations.length}
|
||||
<Card padding="lg">
|
||||
|
||||
Reference in New Issue
Block a user