mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-21 22:05:23 +02:00
fix(ai): only show Custom Presets button to owner/admin roles
This commit is contained in:
@@ -18,6 +18,9 @@ import { HandleAiProviders } from "./handle-ai-providers";
|
||||
export const AiForm = () => {
|
||||
const { data: aiConfigs, refetch, isPending } = api.ai.getAll.useQuery();
|
||||
const { mutateAsync, isPending: isRemoving } = api.ai.delete.useMutation();
|
||||
const { data: currentUser } = api.user.get.useQuery();
|
||||
const isOrgAdmin =
|
||||
currentUser?.role === "owner" || currentUser?.role === "admin";
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
@@ -32,7 +35,7 @@ export const AiForm = () => {
|
||||
<CardDescription>Manage your AI configurations</CardDescription>
|
||||
</div>
|
||||
<div className="flex flex-row gap-2">
|
||||
<HandleAiProviders />
|
||||
{isOrgAdmin && <HandleAiProviders />}
|
||||
{aiConfigs && aiConfigs?.length > 0 && <HandleAi />}
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user