mirror of
https://github.com/andwati/dokploy.git
synced 2026-12-04 16:48:46 +00:00
feat: enhance AnalyzeLogs component with AI provider configuration prompt
- Updated the AnalyzeLogs component to display a message and button for configuring AI providers when none are available, improving user guidance. - Added a link to the settings page for easy access to AI provider configuration. - Integrated new icon for the configuration button to enhance UI clarity. These changes improve the user experience by ensuring users are informed about the need to set up AI providers for log analysis.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { Bot, Loader2, RotateCcw, X } from "lucide-react";
|
import { Bot, Loader2, RotateCcw, Settings, X } from "lucide-react";
|
||||||
|
import Link from "next/link";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
@@ -91,6 +92,20 @@ export function AnalyzeLogs({ logs, context }: Props) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="p-4 space-y-3">
|
<div className="p-4 space-y-3">
|
||||||
{!data?.analysis ? (
|
{!data?.analysis ? (
|
||||||
|
providers && providers.length === 0 ? (
|
||||||
|
<div className="flex flex-col items-center gap-3 py-2 text-center">
|
||||||
|
<p className="text-sm text-muted-foreground">
|
||||||
|
No AI providers configured. Set up a provider to start
|
||||||
|
analyzing logs.
|
||||||
|
</p>
|
||||||
|
<Button size="sm" variant="outline" asChild>
|
||||||
|
<Link href="/dashboard/settings/ai">
|
||||||
|
<Settings className="mr-2 h-3.5 w-3.5" />
|
||||||
|
Configure AI Provider
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<>
|
<>
|
||||||
<Select value={aiId} onValueChange={setAiId}>
|
<Select value={aiId} onValueChange={setAiId}>
|
||||||
<SelectTrigger className="h-9 text-sm">
|
<SelectTrigger className="h-9 text-sm">
|
||||||
@@ -127,6 +142,7 @@ export function AnalyzeLogs({ logs, context }: Props) {
|
|||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="max-h-[400px] overflow-y-auto">
|
<div className="max-h-[400px] overflow-y-auto">
|
||||||
|
|||||||
Reference in New Issue
Block a user