Remove standalone Activity log page (Refs #153)

This commit is contained in:
2026-10-13 15:39:05 -04:00
parent 82e07ea33e
commit eceb38a6bc
21 changed files with 260 additions and 132 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
import { activityRedirectHref } from './activity-redirect.js';
const origin = 'https://electric-cherry.invalid';
const pagePath =
/^\/(?:$|activity|operations|autoscaling|account|bank|capacity|metrics|server-keys|settings(?:\/users)?|servers\/[^/]+|hosts(?:\/[^/]+)?|collections(?:\/launches\/[^/]+)?|(?:scripts|configs|plugins|betas|campaigns|maintenance|provisioning|matches)(?:\/[^/]+)?|game-files|leaderboard(?:\/players\/[^/]+(?:\/[^/]+)?)?)$/;
@@ -16,6 +18,8 @@ export function safeReturnHref(value: string | null | undefined, fallback: strin
try {
const url = new URL(value, origin);
if (url.origin !== origin || !pagePath.test(url.pathname)) return fallback;
if (url.pathname === '/activity' || url.pathname === '/operations')
return activityRedirectHref(url);
return url.pathname + url.search + url.hash;
} catch {
return fallback;
@@ -45,8 +49,6 @@ export function returnLabel(href: string): string {
if (path.startsWith('/hosts/')) return 'Back to host';
const names: Record<string, string> = {
'': 'Servers',
activity: 'Activity',
operations: 'Activity',
autoscaling: 'Autoscaling',
collections: 'Collections',
hosts: 'Hosts',