Add global match history and ending timestamps
This commit is contained in:
@@ -99,7 +99,8 @@
|
||||
{ href: '/deployments', label: 'Operations', match: (p: string) => /^\/(deployments|campaigns)(\/|$)/.test(p) },
|
||||
{ href: '/betas', label: 'Betas', match: (p: string) => p.startsWith('/betas') },
|
||||
{ href: '/settings', label: 'Settings', match: (p: string) => p.startsWith('/server-keys') || p.startsWith('/settings') },
|
||||
{ href: '/leaderboard', label: 'Leaderboard', match: (p: string) => p.startsWith('/leaderboard') }
|
||||
{ href: '/leaderboard', label: 'Leaderboard', match: (p: string) => p.startsWith('/leaderboard') },
|
||||
{ href: '/matches', label: 'Match History', match: (p: string) => p.startsWith('/matches') }
|
||||
];
|
||||
const secondary = $derived(tabs[1].match($page.url.pathname)
|
||||
? [{ href: '/scripts', label: 'Scripts' }, { href: '/configs', label: 'Configs' }, { href: '/plugins', label: 'Plugins' }]
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { serverMatchHistory } from '$lib/server/fleet/match-history.js';
|
||||
|
||||
export function GET({ url }: { url: URL }) {
|
||||
const limit = Number(url.searchParams.get('limit') ?? 25);
|
||||
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 10000) {
|
||||
return json({ error: 'limit must be between 1 and 10000' }, { status: 400 });
|
||||
}
|
||||
return json(serverMatchHistory(undefined, limit));
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<script lang="ts">
|
||||
import MatchHistory from '$ui/components/MatchHistory.svelte';
|
||||
import SectionHeader from '$ui/components/primitives/SectionHeader.svelte';
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Match History · Electric Cherry</title></svelte:head>
|
||||
|
||||
<div class="page">
|
||||
<SectionHeader title="Match History" subtitle="Recorded matches across all servers." />
|
||||
<MatchHistory />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.page { display: grid; gap: var(--space-6); min-width: 0; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user