chore: fix frontend build errors and prepare prod configuration

This commit is contained in:
Lv, Qi 2025-11-30 23:21:34 +08:00
parent abe47c4bc8
commit 6065b1ff48
8 changed files with 22 additions and 10 deletions

View File

@ -31,6 +31,7 @@
"elkjs": "^0.11.0", "elkjs": "^0.11.0",
"html-to-image": "^1.11.13", "html-to-image": "^1.11.13",
"lucide-react": "^0.554.0", "lucide-react": "^0.554.0",
"marked": "^17.0.1",
"react": "^19.2.0", "react": "^19.2.0",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",
"react-markdown": "^10.1.0", "react-markdown": "^10.1.0",
@ -6480,6 +6481,18 @@
"url": "https://github.com/sponsors/wooorm" "url": "https://github.com/sponsors/wooorm"
} }
}, },
"node_modules/marked": {
"version": "17.0.1",
"resolved": "http://npm.repo.lan/marked/-/marked-17.0.1.tgz",
"integrity": "sha512-boeBdiS0ghpWcSwoNm/jJBwdpFaMnZWRzjA6SkUMYb40SVaN1x7mmfGKp0jvexGcx+7y2La5zRZsYFZI6Qpypg==",
"license": "MIT",
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">= 20"
}
},
"node_modules/math-intrinsics": { "node_modules/math-intrinsics": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",

View File

@ -34,6 +34,7 @@
"elkjs": "^0.11.0", "elkjs": "^0.11.0",
"html-to-image": "^1.11.13", "html-to-image": "^1.11.13",
"lucide-react": "^0.554.0", "lucide-react": "^0.554.0",
"marked": "^17.0.1",
"react": "^19.2.0", "react": "^19.2.0",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",
"react-markdown": "^10.1.0", "react-markdown": "^10.1.0",

View File

@ -1,9 +1,8 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { ScrollArea } from "@/components/ui/scroll-area"; import { ScrollArea } from "@/components/ui/scroll-area";
import { Badge } from "@/components/ui/badge"; import { Badge } from "@/components/ui/badge";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Card, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button"; import { ChevronRight, ChevronDown, FileText, Folder, FileJson, RefreshCw, GitCommit } from 'lucide-react';
import { ChevronRight, ChevronDown, FileText, Folder, FileJson, RefreshCw, GitBranch, GitCommit } from 'lucide-react';
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
// Types mirroring the Rust backend // Types mirroring the Rust backend

View File

@ -1,7 +1,6 @@
import { useEffect, useCallback, useState } from 'react'; import { useEffect, useCallback, useState } from 'react';
import ReactFlow, { import ReactFlow, {
Background, Background,
Controls,
Node, Node,
Edge, Edge,
useNodesState, useNodesState,
@ -79,7 +78,7 @@ const useGridLayout = () => {
// 1. Topological Sort (Rank-Based Grid) // 1. Topological Sort (Rank-Based Grid)
// Calculate Ranks // Calculate Ranks
const ranks = new Map<string, number>(); const ranks = new Map<string, number>();
const nodeMap = new Map(dagNodes.map(n => [n.id, n])); // const nodeMap = new Map(dagNodes.map(n => [n.id, n])); // Removed unused nodeMap
const incomingEdges = new Map<string, string[]>(); const incomingEdges = new Map<string, string[]>();
dagNodes.forEach(n => incomingEdges.set(n.id, [])); dagNodes.forEach(n => incomingEdges.set(n.id, []));

View File

@ -81,7 +81,7 @@ export function useSaveAnalysisTemplate() {
mutationFn: async ({ id, template }: { id: string, template: AnalysisTemplateSet }) => { mutationFn: async ({ id, template }: { id: string, template: AnalysisTemplateSet }) => {
return await client.update_template(template, { params: { id } }); return await client.update_template(template, { params: { id } });
}, },
onSuccess: (data, variables) => { onSuccess: (_data, variables) => {
queryClient.invalidateQueries({ queryKey: ['analysis-templates'] }); queryClient.invalidateQueries({ queryKey: ['analysis-templates'] });
queryClient.invalidateQueries({ queryKey: ['analysis-template', variables.id] }); queryClient.invalidateQueries({ queryKey: ['analysis-template', variables.id] });
} }

View File

@ -11,7 +11,7 @@ export async function cropImage(
): Promise<string> { ): Promise<string> {
const { threshold = 252, padding = 20 } = options; // 252 covers pure white and very light compression artifacts const { threshold = 252, padding = 20 } = options; // 252 covers pure white and very light compression artifacts
return new Promise((resolve, reject) => { return new Promise((resolve) => {
const img = new Image(); const img = new Image();
// Enable CORS if needed, though usually data URLs don't need it // Enable CORS if needed, though usually data URLs don't need it
img.crossOrigin = "anonymous"; img.crossOrigin = "anonymous";

View File

@ -387,7 +387,7 @@ function OverviewTabContent({ status, tasks, totalTasks, completedTasks }: {
) )
} }
function TaskDetailView({ taskId, task, requestId, mode }: { taskId: string, task?: TaskState, requestId?: string, mode: 'realtime' | 'historical' }) { function TaskDetailView({ taskId, task, requestId }: { taskId: string, task?: TaskState, requestId?: string, mode: 'realtime' | 'historical' }) {
const [isInspectorOpen, setIsInspectorOpen] = useState(false); const [isInspectorOpen, setIsInspectorOpen] = useState(false);
const { setTaskContent } = useWorkflowStore(); const { setTaskContent } = useWorkflowStore();

View File

@ -190,8 +190,8 @@ export const useWorkflowStore = create<WorkflowStoreState>((set, get) => ({
p.status, p.status,
(p.message === null) ? undefined : p.message, (p.message === null) ? undefined : p.message,
p.progress || undefined, p.progress || undefined,
p.input_commit, p.input_commit || undefined, // Explicitly handle null/undefined
p.output_commit p.output_commit || undefined
); );
break; break;
} }