fix: 智能视频分类 测试完成
This commit is contained in:
parent
c3c0bb8c08
commit
708075f17e
|
|
@ -13,6 +13,7 @@ import {
|
|||
} from 'lucide-react';
|
||||
import { LoadingSpinner } from './LoadingSpinner';
|
||||
import { ErrorMessage } from './ErrorMessage';
|
||||
import { CustomSelect } from './CustomSelect';
|
||||
|
||||
// 类型定义
|
||||
interface AiAnalysisLogItem {
|
||||
|
|
@ -157,20 +158,6 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
|||
loadLogs();
|
||||
};
|
||||
|
||||
// 导出日志
|
||||
const handleExport = async (format: 'csv' | 'json') => {
|
||||
try {
|
||||
const result = await invoke('export_ai_analysis_logs', {
|
||||
projectId,
|
||||
format,
|
||||
});
|
||||
console.log('导出结果:', result);
|
||||
// TODO: 处理导出结果,可能需要保存文件
|
||||
} catch (err) {
|
||||
console.error('导出失败:', err);
|
||||
}
|
||||
};
|
||||
|
||||
// 重试失败任务
|
||||
const handleRetryTask = async (taskId: string) => {
|
||||
try {
|
||||
|
|
@ -260,21 +247,19 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
|||
<div className="flex space-x-2">
|
||||
<button
|
||||
onClick={() => setLogType('records')}
|
||||
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${
|
||||
logType === 'records'
|
||||
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${logType === 'records'
|
||||
? 'bg-blue-100 text-blue-700'
|
||||
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
|
||||
}`}
|
||||
}`}
|
||||
>
|
||||
分类记录
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setLogType('tasks')}
|
||||
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${
|
||||
logType === 'tasks'
|
||||
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${logType === 'tasks'
|
||||
? 'bg-blue-100 text-blue-700'
|
||||
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
|
||||
}`}
|
||||
}`}
|
||||
>
|
||||
分类任务
|
||||
</button>
|
||||
|
|
@ -296,21 +281,9 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
|||
|
||||
{/* 状态过滤 */}
|
||||
{filterOptions && (
|
||||
<select
|
||||
value={statusFilter}
|
||||
onChange={(e) => setStatusFilter(e.target.value)}
|
||||
className="px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
>
|
||||
<option value="">全部状态</option>
|
||||
{(logType === 'records'
|
||||
? filterOptions.record_statuses
|
||||
: filterOptions.task_statuses
|
||||
).map((status: any) => (
|
||||
<option key={status.value} value={status.value}>
|
||||
{status.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<CustomSelect options={logType === 'records'
|
||||
? filterOptions.record_statuses
|
||||
: filterOptions.task_statuses} value={statusFilter} onChange={e => setStatusFilter(e)} />
|
||||
)}
|
||||
|
||||
<button
|
||||
|
|
@ -327,17 +300,6 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
|||
<RefreshCw className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* 操作按钮 */}
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
onClick={() => handleExport('csv')}
|
||||
className="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors"
|
||||
title="导出CSV"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -398,12 +360,6 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
|||
<RotateCcw className="w-4 h-4" />
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
className="p-1 text-gray-600 hover:text-gray-800"
|
||||
title="查看详情"
|
||||
>
|
||||
<Eye className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue