/** 설정 — API base URL·guard 키(localStorage). prod 에서 X-API-Key 헤더로 자동 첨부. */ import { useState } from "react"; import { settings } from "../api/client"; import { Button, Card, PageHeader } from "../components/ui"; export default function Settings() { const [baseUrl, setBaseUrl] = useState(settings.baseUrl()); const [apiKey, setApiKey] = useState(settings.apiKey()); const [saved, setSaved] = useState(false); return (
{ e.preventDefault(); settings.save(baseUrl.trim(), apiKey.trim()); setSaved(true); setTimeout(() => setSaved(false), 2000); }} >
setBaseUrl(e.target.value)} placeholder="비우면 현재 주소 기준 (개발: vite 프록시 → :9600)" className="w-full rounded-lg border border-line-200 bg-surface px-3 py-2 text-[13px] outline-none focus:border-primary-600" />

예: https://lps.example.com — dev 서버를 직접 보려면 해당 주소 입력

setApiKey(e.target.value)} placeholder="개발(개방 모드)은 비워둠 — prod 만 필요" autoComplete="off" className="w-full rounded-lg border border-line-200 bg-surface px-3 py-2 text-[13px] outline-none focus:border-primary-600" />

서버 toml 의 [WebServerConfig].api_keys 중 하나. 이 브라우저에만 저장됩니다.

{saved && 저장했습니다}

지표 임계·요청 예산 등 서버 동작 설정은 이 화면에서 바꾸지 않습니다 — 설정 소스는 서버의 config.<env>.toml 하나이며(2026-07-13 협의), 변경은 toml 수정 + 재시작으로 합니다.

); }