import { useEffect, useState } from 'react'; interface Settings { albionServer: string; availableServers: string[]; proxyUrl: string; gamePath: string; } export default function SettingsPage() { const [settings, setSettings] = useState(null); const [proxyUrl, setProxyUrl] = useState(''); const [gamePath, setGamePath] = useState(''); const [saved, setSaved] = useState(false); useEffect(() => { fetch('/api/settings') .then((r) => r.json()) .then((s: Settings) => { setSettings(s); setProxyUrl(s.proxyUrl); setGamePath(s.gamePath); }); }, []); const save = async (patch: Partial<{ albionServer: string; proxyUrl: string; gamePath: string }>) => { await fetch('/api/settings', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(patch), }); const s = await fetch('/api/settings').then((r) => r.json()); setSettings(s); setSaved(true); setTimeout(() => setSaved(false), 2000); }; if (!settings) return

Loading…

; return (

Settings

Albion server

Which game server's market prices to download.

Proxy for market data (optional)

The market data API (albion-online-data.com) is blocked in some countries. If your VPN covers the whole system, leave this empty. If it is browser-only, enter an HTTP proxy URL here (e.g. http://127.0.0.1:8080) and market downloads will go through it.

setProxyUrl(e.target.value)} />
{saved &&

Saved.

}

Albion game folder

Used to read the world map (travel planner) from the game's files — read-only. The folder that contains the "game" directory, e.g. E:\albion.

setGamePath(e.target.value)} />
); }