mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-06 12:12:16 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -32,14 +32,13 @@ export function AnalyzeLogs({ logs, context }: Props) {
|
|||||||
const { data: providers } = api.ai.getEnabledProviders.useQuery(undefined, {
|
const { data: providers } = api.ai.getEnabledProviders.useQuery(undefined, {
|
||||||
enabled: open,
|
enabled: open,
|
||||||
});
|
});
|
||||||
const { mutate, isPending, data, reset } =
|
const { mutate, isPending, data, reset } = api.ai.analyzeLogs.useMutation({
|
||||||
api.ai.analyzeLogs.useMutation({
|
onError: (error) => {
|
||||||
onError: (error) => {
|
toast.error("Analysis failed", {
|
||||||
toast.error("Analysis failed", {
|
description: error.message,
|
||||||
description: error.message,
|
});
|
||||||
});
|
},
|
||||||
},
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const handleAnalyze = () => {
|
const handleAnalyze = () => {
|
||||||
if (!aiId || logs.length === 0) return;
|
if (!aiId || logs.length === 0) return;
|
||||||
@@ -119,7 +118,11 @@ export function AnalyzeLogs({ logs, context }: Props) {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Bot className="mr-2 h-3.5 w-3.5" />
|
<Bot className="mr-2 h-3.5 w-3.5" />
|
||||||
Analyze {logs.length > MAX_LOG_LINES ? `last ${MAX_LOG_LINES}` : logs.length} lines
|
Analyze{" "}
|
||||||
|
{logs.length > MAX_LOG_LINES
|
||||||
|
? `last ${MAX_LOG_LINES}`
|
||||||
|
: logs.length}{" "}
|
||||||
|
lines
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ export const DockerLogsId: React.FC<Props> = ({
|
|||||||
<DownloadIcon className="mr-2 h-4 w-4" />
|
<DownloadIcon className="mr-2 h-4 w-4" />
|
||||||
Download logs
|
Download logs
|
||||||
</Button>
|
</Button>
|
||||||
<AnalyzeLogs logs={filteredLogs} context="runtime" />
|
<AnalyzeLogs logs={filteredLogs} context="runtime" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isPaused && (
|
{isPaused && (
|
||||||
|
|||||||
@@ -253,7 +253,9 @@ ${input.logs}`,
|
|||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "BAD_REQUEST",
|
code: "BAD_REQUEST",
|
||||||
message:
|
message:
|
||||||
error instanceof Error ? error.message : `Analysis failed: ${error}`,
|
error instanceof Error
|
||||||
|
? error.message
|
||||||
|
: `Analysis failed: ${error}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -285,7 +287,9 @@ ${input.logs}`,
|
|||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "BAD_REQUEST",
|
code: "BAD_REQUEST",
|
||||||
message:
|
message:
|
||||||
error instanceof Error ? error.message : `Connection failed: ${error}`,
|
error instanceof Error
|
||||||
|
? error.message
|
||||||
|
: `Connection failed: ${error}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user