|
|
@@ -1,11 +1,11 @@
|
|
|
|
'use client'
|
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
|
|
import { useState, useEffect, useCallback } from 'react'
|
|
|
|
import { useState, useEffect, useCallback, Fragment } from 'react'
|
|
|
|
import { useSession } from 'next-auth/react'
|
|
|
|
import { useSession } from 'next-auth/react'
|
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
import { Input } from '@/components/ui/input'
|
|
|
|
import { Input } from '@/components/ui/input'
|
|
|
|
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs'
|
|
|
|
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs'
|
|
|
|
import { User, Mail, Server, Cloud, Shield, Bell, Sparkles, Bot, KeyRound, PlugZap, FolderSync, CalendarDays, BookUser, Check, X, AlertTriangle } from 'lucide-react'
|
|
|
|
import { User, Mail, Server, Cloud, Shield, Bell, Sparkles, Bot, KeyRound, PlugZap, FolderSync, CalendarDays, BookUser, ArrowLeft, Check, X, AlertTriangle } from 'lucide-react'
|
|
|
|
import { toast } from 'sonner'
|
|
|
|
import { toast } from 'sonner'
|
|
|
|
import { invalidateReference } from '@/lib/reference-data'
|
|
|
|
import { invalidateReference } from '@/lib/reference-data'
|
|
|
|
import { NotificationsSettings } from '@/components/notifications-settings'
|
|
|
|
import { NotificationsSettings } from '@/components/notifications-settings'
|
|
|
@@ -17,6 +17,36 @@ import { WebdavSettings } from '@/components/webdav-settings'
|
|
|
|
import { CalDavSettings } from '@/components/caldav-settings'
|
|
|
|
import { CalDavSettings } from '@/components/caldav-settings'
|
|
|
|
import { CardDavSettings } from '@/components/carddav-settings'
|
|
|
|
import { CardDavSettings } from '@/components/carddav-settings'
|
|
|
|
import type { OidcStatus } from '@/lib/oidc-config'
|
|
|
|
import type { OidcStatus } from '@/lib/oidc-config'
|
|
|
|
|
|
|
|
import { cn } from '@/lib/utils'
|
|
|
|
|
|
|
|
import { useMediaQuery } from '@/lib/use-media-query'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Settings are grouped by purpose, not a flat strip: account, the external
|
|
|
|
|
|
|
|
// services that feed your data, the assistant/automation surface, and
|
|
|
|
|
|
|
|
// machine/developer access. Each item keeps its Radix tab value so deep
|
|
|
|
|
|
|
|
// links and the browser suites' role="tab" locators are unchanged.
|
|
|
|
|
|
|
|
const NAV_GROUPS = [
|
|
|
|
|
|
|
|
{ label: 'Account', items: [
|
|
|
|
|
|
|
|
{ value: 'profile', label: 'Profile', icon: User },
|
|
|
|
|
|
|
|
{ value: 'oidc', label: 'Sign-in', icon: Shield },
|
|
|
|
|
|
|
|
] },
|
|
|
|
|
|
|
|
{ label: 'Connections', items: [
|
|
|
|
|
|
|
|
{ value: 'webdav', label: 'WebDAV', icon: FolderSync },
|
|
|
|
|
|
|
|
{ value: 'caldav', label: 'CalDAV', icon: CalendarDays },
|
|
|
|
|
|
|
|
{ value: 'carddav', label: 'CardDAV', icon: BookUser },
|
|
|
|
|
|
|
|
{ value: 'nextcloud', label: 'Contacts sync', icon: Cloud },
|
|
|
|
|
|
|
|
{ value: 'imap', label: 'IMAP', icon: Mail },
|
|
|
|
|
|
|
|
] },
|
|
|
|
|
|
|
|
{ label: 'AI & Automation', items: [
|
|
|
|
|
|
|
|
{ value: 'ai', label: 'AI', icon: Bot },
|
|
|
|
|
|
|
|
{ value: 'mcp', label: 'MCP', icon: PlugZap },
|
|
|
|
|
|
|
|
{ value: 'automations', label: 'Automations', icon: Sparkles },
|
|
|
|
|
|
|
|
{ value: 'notifications', label: 'Notifications', icon: Bell },
|
|
|
|
|
|
|
|
] },
|
|
|
|
|
|
|
|
{ label: 'Developer', items: [
|
|
|
|
|
|
|
|
{ value: 'api-keys', label: 'API Keys', icon: KeyRound },
|
|
|
|
|
|
|
|
] },
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callbackUrl: string }) {
|
|
|
|
export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callbackUrl: string }) {
|
|
|
|
const { data: session } = useSession()
|
|
|
|
const { data: session } = useSession()
|
|
|
@@ -25,6 +55,12 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
|
|
|
|
const [savingImap, setSavingImap] = useState(false)
|
|
|
|
const [savingImap, setSavingImap] = useState(false)
|
|
|
|
const [testingImap, setTestingImap] = useState(false)
|
|
|
|
const [testingImap, setTestingImap] = useState(false)
|
|
|
|
const [syncingContacts, setSyncingContacts] = useState(false)
|
|
|
|
const [syncingContacts, setSyncingContacts] = useState(false)
|
|
|
|
|
|
|
|
const [section, setSection] = useState('profile')
|
|
|
|
|
|
|
|
// Below md the grouped nav becomes a list -> detail flow (same
|
|
|
|
|
|
|
|
// master-detail pattern as collections/tags/contacts); at md+ the
|
|
|
|
|
|
|
|
// nav and the selected panel sit side by side.
|
|
|
|
|
|
|
|
const isNarrow = useMediaQuery('(max-width: 767px)')
|
|
|
|
|
|
|
|
const [mobileDetail, setMobileDetail] = useState(false)
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
fetch('/api/settings/imap').then(r => r.json()).then(data => {
|
|
|
|
fetch('/api/settings/imap').then(r => r.json()).then(data => {
|
|
|
@@ -92,29 +128,49 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="max-w-2xl space-y-6">
|
|
|
|
<div className="max-w-5xl space-y-6">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<h1 className="font-display text-2xl font-bold tracking-tight">Settings</h1>
|
|
|
|
<h1 className="font-display text-2xl font-bold tracking-tight">Settings</h1>
|
|
|
|
<p className="text-sm text-muted-foreground mt-1">Configure your integrations and preferences</p>
|
|
|
|
<p className="text-sm text-muted-foreground mt-1">Configure your integrations and preferences</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<Tabs defaultValue="profile" className="w-full">
|
|
|
|
<Tabs
|
|
|
|
<TabsList className="w-full justify-start overflow-x-auto flex-nowrap">
|
|
|
|
value={section}
|
|
|
|
<TabsTrigger value="profile" className="gap-1.5"><User className="h-3.5 w-3.5" /> Profile</TabsTrigger>
|
|
|
|
onValueChange={(v) => { setSection(v); if (isNarrow) setMobileDetail(true) }}
|
|
|
|
<TabsTrigger value="imap" className="gap-1.5"><Mail className="h-3.5 w-3.5" /> IMAP</TabsTrigger>
|
|
|
|
orientation="vertical"
|
|
|
|
<TabsTrigger value="nextcloud" className="gap-1.5"><Cloud className="h-3.5 w-3.5" /> Nextcloud</TabsTrigger>
|
|
|
|
className="w-full"
|
|
|
|
<TabsTrigger value="notifications" className="gap-1.5"><Bell className="h-3.5 w-3.5" /> Notifications</TabsTrigger>
|
|
|
|
>
|
|
|
|
<TabsTrigger value="automations" className="gap-1.5"><Sparkles className="h-3.5 w-3.5" /> Automations</TabsTrigger>
|
|
|
|
<div className="flex flex-col gap-6 md:flex-row md:gap-8">
|
|
|
|
<TabsTrigger value="ai" className="gap-1.5"><Bot className="h-3.5 w-3.5" /> AI</TabsTrigger>
|
|
|
|
<TabsList
|
|
|
|
<TabsTrigger value="api-keys" className="gap-1.5"><KeyRound className="h-3.5 w-3.5" /> API Keys</TabsTrigger>
|
|
|
|
aria-label="Settings sections"
|
|
|
|
<TabsTrigger value="mcp" className="gap-1.5"><PlugZap className="h-3.5 w-3.5" /> MCP</TabsTrigger>
|
|
|
|
className={cn(
|
|
|
|
<TabsTrigger value="webdav" className="gap-1.5"><FolderSync className="h-3.5 w-3.5" /> WebDAV</TabsTrigger>
|
|
|
|
'flex h-auto w-full flex-col items-stretch justify-start gap-0.5 rounded-lg border bg-card/50 p-2 md:w-56 md:shrink-0',
|
|
|
|
<TabsTrigger value="caldav" className="gap-1.5"><CalendarDays className="h-3.5 w-3.5" /> CalDAV</TabsTrigger>
|
|
|
|
isNarrow && mobileDetail && 'hidden'
|
|
|
|
<TabsTrigger value="carddav" className="gap-1.5"><BookUser className="h-3.5 w-3.5" /> CardDAV</TabsTrigger>
|
|
|
|
)}
|
|
|
|
<TabsTrigger value="oidc" className="gap-1.5"><Shield className="h-3.5 w-3.5" /> OIDC</TabsTrigger>
|
|
|
|
>
|
|
|
|
|
|
|
|
{NAV_GROUPS.map((g) => (
|
|
|
|
|
|
|
|
<Fragment key={g.label}>
|
|
|
|
|
|
|
|
<div className="px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground first:pt-1">{g.label}</div>
|
|
|
|
|
|
|
|
{g.items.map((it) => (
|
|
|
|
|
|
|
|
<TabsTrigger
|
|
|
|
|
|
|
|
key={it.value}
|
|
|
|
|
|
|
|
value={it.value}
|
|
|
|
|
|
|
|
className="w-full justify-start gap-2 rounded-md px-3 py-2 data-[state=active]:bg-accent data-[state=active]:text-accent-foreground data-[state=active]:shadow-none"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<it.icon className="h-3.5 w-3.5 shrink-0" /> {it.label}
|
|
|
|
|
|
|
|
</TabsTrigger>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</Fragment>
|
|
|
|
|
|
|
|
))}
|
|
|
|
</TabsList>
|
|
|
|
</TabsList>
|
|
|
|
|
|
|
|
|
|
|
|
<TabsContent value="profile" className="space-y-4 mt-4">
|
|
|
|
<div className={cn('min-w-0 flex-1', isNarrow && !mobileDetail && 'hidden')}>
|
|
|
|
|
|
|
|
{isNarrow && mobileDetail && (
|
|
|
|
|
|
|
|
<Button variant="ghost" size="sm" className="mb-3 -ml-2 gap-1 text-muted-foreground" onClick={() => setMobileDetail(false)}>
|
|
|
|
|
|
|
|
<ArrowLeft className="h-4 w-4" /> All settings
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
<TabsContent value="profile" className="mt-0 space-y-4">
|
|
|
|
<div className="flex items-center gap-4">
|
|
|
|
<div className="flex items-center gap-4">
|
|
|
|
<div className="h-16 w-16 rounded-full bg-primary/20 flex items-center justify-center text-2xl font-bold text-primary">
|
|
|
|
<div className="h-16 w-16 rounded-full bg-primary/20 flex items-center justify-center text-2xl font-bold text-primary">
|
|
|
|
{(session?.user?.name ?? session?.user?.email ?? '?')[0]?.toUpperCase()}
|
|
|
|
{(session?.user?.name ?? session?.user?.email ?? '?')[0]?.toUpperCase()}
|
|
|
@@ -125,8 +181,67 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</TabsContent>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="oidc" className="mt-0 space-y-4">
|
|
|
|
<TabsContent value="imap" className="space-y-4 mt-4">
|
|
|
|
<div className="rounded-lg border p-4 space-y-3">
|
|
|
|
|
|
|
|
<h3 className="font-medium flex items-center gap-2"><Shield className="h-4 w-4" /> Sign-in (OIDC)</h3>
|
|
|
|
|
|
|
|
<p className="text-sm text-muted-foreground">Authelia single sign-on, configured via environment variables (read-only)</p>
|
|
|
|
|
|
|
|
<div className={`flex items-start gap-2 rounded-md p-3 text-sm ${oidc.enabled ? 'bg-green-500/10 text-green-700 dark:text-green-400' : 'bg-amber-500/10 text-amber-800 dark:text-amber-300'}`}>
|
|
|
|
|
|
|
|
{oidc.enabled ? <Check className="h-4 w-4 mt-0.5 shrink-0" /> : <AlertTriangle className="h-4 w-4 mt-0.5 shrink-0" />}
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
{oidc.enabled
|
|
|
|
|
|
|
|
? <>Configured for <span className="font-mono break-all">{oidc.issuer}</span>. Authelia sign-in is enabled.</>
|
|
|
|
|
|
|
|
: <>Not connected. Authelia sign-in is disabled until all three variables below hold real values. Users can sign in with email and password meanwhile. Setup guide: <span className="font-mono">docs/AUTHELIA.md</span></>}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
|
|
|
{([['OIDC_ISSUER', oidc.issuerSet], ['OIDC_CLIENT_ID', oidc.clientIdSet], ['OIDC_CLIENT_SECRET', oidc.clientSecretSet]] as const).map(([name, set]) => (
|
|
|
|
|
|
|
|
<div key={name} className="flex items-center gap-2">
|
|
|
|
|
|
|
|
<span className="text-xs font-mono bg-muted px-2 py-1 rounded">{name}</span>
|
|
|
|
|
|
|
|
<span className="text-sm text-muted-foreground">{set ? 'Set' : 'Not set'}</span>
|
|
|
|
|
|
|
|
{set ? <Check className="h-4 w-4 text-green-500" /> : <X className="h-4 w-4 text-muted-foreground" />}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="space-y-1 pt-2 border-t">
|
|
|
|
|
|
|
|
<p className="text-xs font-medium text-muted-foreground">Redirect URI to register in Authelia</p>
|
|
|
|
|
|
|
|
<p className="text-xs font-mono bg-muted px-2 py-1.5 rounded break-all" suppressHydrationWarning>{callbackUrl}</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="webdav" className="mt-0 space-y-4">
|
|
|
|
|
|
|
|
<WebdavSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="caldav" className="mt-0 space-y-4">
|
|
|
|
|
|
|
|
<CalDavSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="carddav" className="mt-0 space-y-4">
|
|
|
|
|
|
|
|
<CardDavSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="nextcloud" className="mt-0 space-y-4">
|
|
|
|
|
|
|
|
<div className="rounded-lg border p-4 space-y-3">
|
|
|
|
|
|
|
|
<h3 className="font-medium flex items-center gap-2"><Cloud className="h-4 w-4" /> Contacts sync (Nextcloud)</h3>
|
|
|
|
|
|
|
|
<div className="grid grid-cols-2 gap-3">
|
|
|
|
|
|
|
|
<div className="col-span-2">
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">Nextcloud URL</label>
|
|
|
|
|
|
|
|
<Input value={ncConfig.nextcloudUrl} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, nextcloudUrl: e.target.value }))} placeholder="https://nextcloud.example.com" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="col-span-2">
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">CardDAV Path (optional)</label>
|
|
|
|
|
|
|
|
<Input value={ncConfig.cardDavPath} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, cardDavPath: e.target.value }))} placeholder="/remote.php/dav/addressbooks/users/USER/contacts/" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">Username</label>
|
|
|
|
|
|
|
|
<Input value={ncConfig.username} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, username: e.target.value }))} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">App Password</label>
|
|
|
|
|
|
|
|
<Input type="password" value={ncConfig.password} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, password: e.target.value }))} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<Button onClick={syncContacts} loading={syncingContacts}>Sync Contacts Now</Button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="imap" className="mt-0 space-y-4">
|
|
|
|
<div className="rounded-lg border p-4 space-y-3">
|
|
|
|
<div className="rounded-lg border p-4 space-y-3">
|
|
|
|
<h3 className="font-medium flex items-center gap-2"><Server className="h-4 w-4" /> IMAP Configuration</h3>
|
|
|
|
<h3 className="font-medium flex items-center gap-2"><Server className="h-4 w-4" /> IMAP Configuration</h3>
|
|
|
|
<div className="grid grid-cols-2 gap-3">
|
|
|
|
<div className="grid grid-cols-2 gap-3">
|
|
|
@@ -162,91 +277,23 @@ export function SettingsClient({ oidc, callbackUrl }: { oidc: OidcStatus; callba
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</TabsContent>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="ai" className="mt-0 space-y-4">
|
|
|
|
<TabsContent value="nextcloud" className="space-y-4 mt-4">
|
|
|
|
|
|
|
|
<div className="rounded-lg border p-4 space-y-3">
|
|
|
|
|
|
|
|
<h3 className="font-medium flex items-center gap-2"><Cloud className="h-4 w-4" /> Nextcloud / CardDAV</h3>
|
|
|
|
|
|
|
|
<div className="grid grid-cols-2 gap-3">
|
|
|
|
|
|
|
|
<div className="col-span-2">
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">Nextcloud URL</label>
|
|
|
|
|
|
|
|
<Input value={ncConfig.nextcloudUrl} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, nextcloudUrl: e.target.value }))} placeholder="https://nextcloud.example.com" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="col-span-2">
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">CardDAV Path (optional)</label>
|
|
|
|
|
|
|
|
<Input value={ncConfig.cardDavPath} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, cardDavPath: e.target.value }))} placeholder="/remote.php/dav/addressbooks/users/USER/contacts/" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">Username</label>
|
|
|
|
|
|
|
|
<Input value={ncConfig.username} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, username: e.target.value }))} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<label className="text-xs font-medium text-muted-foreground">App Password</label>
|
|
|
|
|
|
|
|
<Input type="password" value={ncConfig.password} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setNcConfig(p => ({ ...p, password: e.target.value }))} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<Button onClick={syncContacts} loading={syncingContacts}>Sync Contacts Now</Button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<TabsContent value="notifications" className="space-y-4 mt-4">
|
|
|
|
|
|
|
|
<NotificationsSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<TabsContent value="automations" className="space-y-4 mt-4">
|
|
|
|
|
|
|
|
<AutomationsSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<TabsContent value="ai" className="space-y-4 mt-4">
|
|
|
|
|
|
|
|
<AiSettings />
|
|
|
|
<AiSettings />
|
|
|
|
</TabsContent>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="mcp" className="mt-0 space-y-4">
|
|
|
|
<TabsContent value="api-keys" className="space-y-4 mt-4">
|
|
|
|
|
|
|
|
<ApiKeysSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<TabsContent value="mcp" className="space-y-4 mt-4">
|
|
|
|
|
|
|
|
<McpSettings />
|
|
|
|
<McpSettings />
|
|
|
|
</TabsContent>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="automations" className="mt-0 space-y-4">
|
|
|
|
<TabsContent value="webdav" className="space-y-4 mt-4">
|
|
|
|
<AutomationsSettings />
|
|
|
|
<WebdavSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="notifications" className="mt-0 space-y-4">
|
|
|
|
<TabsContent value="caldav" className="space-y-4 mt-4">
|
|
|
|
<NotificationsSettings />
|
|
|
|
<CalDavSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
<TabsContent value="api-keys" className="mt-0 space-y-4">
|
|
|
|
<TabsContent value="carddav" className="space-y-4 mt-4">
|
|
|
|
<ApiKeysSettings />
|
|
|
|
<CardDavSettings />
|
|
|
|
|
|
|
|
</TabsContent>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
|
|
|
|
<TabsContent value="oidc" className="space-y-4 mt-4">
|
|
|
|
|
|
|
|
<div className="rounded-lg border p-4 space-y-3">
|
|
|
|
|
|
|
|
<h3 className="font-medium flex items-center gap-2"><Shield className="h-4 w-4" /> OIDC Configuration</h3>
|
|
|
|
|
|
|
|
<p className="text-sm text-muted-foreground">Authelia single sign-on, configured via environment variables (read-only)</p>
|
|
|
|
|
|
|
|
<div className={`flex items-start gap-2 rounded-md p-3 text-sm ${oidc.enabled ? 'bg-green-500/10 text-green-700 dark:text-green-400' : 'bg-amber-500/10 text-amber-800 dark:text-amber-300'}`}>
|
|
|
|
|
|
|
|
{oidc.enabled ? <Check className="h-4 w-4 mt-0.5 shrink-0" /> : <AlertTriangle className="h-4 w-4 mt-0.5 shrink-0" />}
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
{oidc.enabled
|
|
|
|
|
|
|
|
? <>Configured for <span className="font-mono break-all">{oidc.issuer}</span>. Authelia sign-in is enabled.</>
|
|
|
|
|
|
|
|
: <>Not connected. Authelia sign-in is disabled until all three variables below hold real values. Users can sign in with email and password meanwhile. Setup guide: <span className="font-mono">docs/AUTHELIA.md</span></>}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
|
|
|
{([['OIDC_ISSUER', oidc.issuerSet], ['OIDC_CLIENT_ID', oidc.clientIdSet], ['OIDC_CLIENT_SECRET', oidc.clientSecretSet]] as const).map(([name, set]) => (
|
|
|
|
|
|
|
|
<div key={name} className="flex items-center gap-2">
|
|
|
|
|
|
|
|
<span className="text-xs font-mono bg-muted px-2 py-1 rounded">{name}</span>
|
|
|
|
|
|
|
|
<span className="text-sm text-muted-foreground">{set ? 'Set' : 'Not set'}</span>
|
|
|
|
|
|
|
|
{set ? <Check className="h-4 w-4 text-green-500" /> : <X className="h-4 w-4 text-muted-foreground" />}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="space-y-1 pt-2 border-t">
|
|
|
|
|
|
|
|
<p className="text-xs font-medium text-muted-foreground">Redirect URI to register in Authelia</p>
|
|
|
|
|
|
|
|
<p className="text-xs font-mono bg-muted px-2 py-1.5 rounded break-all" suppressHydrationWarning>{callbackUrl}</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
</Tabs>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|