Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Introduced new components for managing admin settings, including AdminListControls, AdminSettingsCard, and TechBrandSelectLabel. - Implemented dynamic loading for admin settings sections to optimize performance. - Enhanced the layout of various admin settings sections for better user experience. - Updated the AiAssistantSection to include LLM provider management and improved model selection. - Refactored authentication settings to streamline configuration and improve accessibility.
56 lines
1.8 KiB
TypeScript
56 lines
1.8 KiB
TypeScript
"use client"
|
|
|
|
import Link from "next/link"
|
|
import { Sparkles } from "lucide-react"
|
|
import { AiChatIframe } from "@/components/ai/ai-chat-iframe"
|
|
import { useAiConfig } from "@/lib/api/hooks/use-ai-queries"
|
|
import { Button } from "@/components/ui/button"
|
|
|
|
export default function ChatPage() {
|
|
const { data: config, isLoading, isError } = useAiConfig()
|
|
|
|
if (isLoading) {
|
|
return (
|
|
<div className="flex h-dvh items-center justify-center text-sm text-muted-foreground">
|
|
Chargement UltiAI…
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (isError) {
|
|
return (
|
|
<div className="flex h-dvh flex-col items-center justify-center gap-3 px-6 text-center">
|
|
<Sparkles className="h-8 w-8 text-muted-foreground" />
|
|
<p className="text-sm text-muted-foreground">
|
|
Impossible de contacter l'API UltiAI. Vérifiez que le backend est démarré.
|
|
</p>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (!config?.enabled) {
|
|
return (
|
|
<div className="flex h-dvh flex-col items-center justify-center gap-3 px-6 text-center">
|
|
<Sparkles className="h-8 w-8 text-muted-foreground" />
|
|
<p className="max-w-md text-sm text-muted-foreground">
|
|
UltiAI n'est pas activé. Activez le plugin{" "}
|
|
<strong>UltiAI</strong> dans Administration → Plugins (puis enregistrez), ou définissez{" "}
|
|
<code className="rounded bg-muted px-1">AI_ASSISTANT_ENABLED=true</code> dans le
|
|
déploiement backend.
|
|
</p>
|
|
<Button asChild variant="outline" size="sm">
|
|
<Link href="/admin/settings/plugins">Ouvrir les plugins</Link>
|
|
</Button>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<AiChatIframe
|
|
publicPath={config.public_path}
|
|
context={{ app: "standalone", temporary: false }}
|
|
className="h-dvh w-full border-0"
|
|
/>
|
|
)
|
|
}
|