diff --git a/src-tauri/src/commands/ai_video.rs b/src-tauri/src/commands/ai_video.rs index b4fdaaa..ce1cbfa 100644 --- a/src-tauri/src/commands/ai_video.rs +++ b/src-tauri/src/commands/ai_video.rs @@ -105,7 +105,6 @@ async fn execute_python_command(_app: tauri::AppHandle, args: &[String]) -> Resu } } else if line.trim().starts_with('{') && line.trim().ends_with('}') { // Fallback: try to parse as direct JSON result - println!("Python json rpc: {}", line); if let Ok(json_value) = serde_json::from_str::(line.trim()) { // Check if this looks like a final result (has status field) if json_value.get("status").is_some() { @@ -113,8 +112,6 @@ async fn execute_python_command(_app: tauri::AppHandle, args: &[String]) -> Resu println!("Direct JSON result: {}", line.trim()); } } - } else { - println!("Python other: {}", line); } } diff --git a/src/components/ai-video/VideoJobList.tsx b/src/components/ai-video/VideoJobList.tsx index a532c57..02597ed 100644 --- a/src/components/ai-video/VideoJobList.tsx +++ b/src/components/ai-video/VideoJobList.tsx @@ -1,5 +1,5 @@ -import React from 'react' -import { Play, Trash2 } from 'lucide-react' +import React, { useState } from 'react' +import { Play, Trash2, Copy, Check } from 'lucide-react' interface VideoJob { id: string @@ -22,6 +22,8 @@ interface VideoJobListProps { } const VideoJobList: React.FC = ({ jobs, onPreview, onDelete }) => { + const [copiedJobId, setCopiedJobId] = useState(null) + const formatTime = (timestamp: number): string => { return new Date(timestamp).toLocaleTimeString() } @@ -45,6 +47,24 @@ const VideoJobList: React.FC = ({ jobs, onPreview, onDelete } } } + const copyErrorToClipboard = (job: VideoJob) => { + const errorInfo = { + error: job.error, + request: job.request, + id: job.id, + status: job.status, + startTime: new Date(job.startTime).toLocaleString(), + endTime: job.endTime ? new Date(job.endTime).toLocaleString() : undefined + } + + navigator.clipboard.writeText(JSON.stringify(errorInfo, null, 2)) + .then(() => { + setCopiedJobId(job.id) + setTimeout(() => setCopiedJobId(null), 2000) + }) + .catch(err => console.error('Failed to copy error info:', err)) + } + if (jobs.length === 0) { return (
@@ -141,8 +161,37 @@ const VideoJobList: React.FC = ({ jobs, onPreview, onDelete } {/* Error Result */} {job.error && job.status === 'failed' && (
-
❌ 生成失败
-
{JSON.stringify(job)}
+
+
❌ 生成失败
+ +
+
+ 错误信息: {job.error} +
+
+ + 查看详细信息 + +
+                  {JSON.stringify(job, null, 2)}
+                
+
)}