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.
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
"use client"
|
|
|
|
import type { OrgLLMSettings } from "@/lib/admin-settings/org-settings-types"
|
|
import { Switch } from "@/components/ui/switch"
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
|
|
|
export function AdminOrgLlmPolicyCard({
|
|
draft,
|
|
setDraft,
|
|
}: {
|
|
draft: OrgLLMSettings
|
|
setDraft: React.Dispatch<React.SetStateAction<OrgLLMSettings>>
|
|
}) {
|
|
return (
|
|
<Card>
|
|
<CardHeader className="pb-3">
|
|
<CardTitle className="text-sm font-medium">Politique LLM</CardTitle>
|
|
<CardDescription>
|
|
Contrôle l'accès aux fournisseurs IA pour les utilisateurs de l'organisation.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent className="space-y-3">
|
|
<label className="flex items-center justify-between gap-4">
|
|
<div>
|
|
<p className="text-sm font-medium">Imposer les fournisseurs org.</p>
|
|
<p className="text-xs text-muted-foreground">
|
|
Les utilisateurs ne peuvent pas utiliser d'autres clés API.
|
|
</p>
|
|
</div>
|
|
<Switch
|
|
checked={draft.enforce_org_providers}
|
|
onCheckedChange={(enforce_org_providers) =>
|
|
setDraft((p) => ({ ...p, enforce_org_providers }))
|
|
}
|
|
/>
|
|
</label>
|
|
<label className="flex items-center justify-between gap-4">
|
|
<div>
|
|
<p className="text-sm font-medium">Autoriser surcharge utilisateur</p>
|
|
</div>
|
|
<Switch
|
|
checked={draft.allow_user_override}
|
|
onCheckedChange={(allow_user_override) =>
|
|
setDraft((p) => ({ ...p, allow_user_override }))
|
|
}
|
|
/>
|
|
</label>
|
|
</CardContent>
|
|
</Card>
|
|
)
|
|
}
|