import { SettingsFormCard, type SettingFieldDef, } from '@/components/admin/shared/settings-form-card'; import { UmamiTestButton } from '@/components/admin/website-analytics/umami-test-button'; import { PageHeader } from '@/components/shared/page-header'; /** * Per-port Umami credentials. We deliberately keep all three values * port-scoped (per the operator decision) so different ports can point at * different Umami instances if needed. The /website-analytics dashboard * page reads these settings via the umami.service layer at request time. */ const FIELDS: SettingFieldDef[] = [ { key: 'umami_api_url', label: 'Umami API URL', description: 'Base URL of the Umami instance, e.g. https://analytics.portnimara.com (no trailing slash, no /api).', type: 'string', placeholder: 'https://analytics.portnimara.com', defaultValue: '', }, { key: 'umami_api_token', label: 'API token', description: 'Long-lived API token if your Umami install supports one (Umami Cloud or v2 self-hosted with API keys enabled). Leave blank if you only have username/password - the service falls back to the JWT login flow using the credentials below. Stored in plain text in system_settings.', type: 'password', defaultValue: '', }, { key: 'umami_username', label: 'Username', description: 'Self-hosted JWT fallback. Only used if API token is blank.', type: 'string', placeholder: 'admin', defaultValue: '', }, { key: 'umami_password', label: 'Password', description: 'Self-hosted JWT fallback. Only used if API token is blank.', type: 'password', defaultValue: '', }, { key: 'umami_website_id', label: 'Website ID', description: 'UUID of this port’s website inside Umami. Find it in Umami → Settings → Websites → Edit → Website ID.', type: 'string', placeholder: '00000000-0000-0000-0000-000000000000', defaultValue: '', }, ]; export default function WebsiteAnalyticsSettingsPage() { return (
} />
); }