fix: 智能视频分类 测试完成
This commit is contained in:
parent
c3c0bb8c08
commit
708075f17e
|
|
@ -13,6 +13,7 @@ import {
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { LoadingSpinner } from './LoadingSpinner';
|
import { LoadingSpinner } from './LoadingSpinner';
|
||||||
import { ErrorMessage } from './ErrorMessage';
|
import { ErrorMessage } from './ErrorMessage';
|
||||||
|
import { CustomSelect } from './CustomSelect';
|
||||||
|
|
||||||
// 类型定义
|
// 类型定义
|
||||||
interface AiAnalysisLogItem {
|
interface AiAnalysisLogItem {
|
||||||
|
|
@ -157,20 +158,6 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
||||||
loadLogs();
|
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) => {
|
const handleRetryTask = async (taskId: string) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -260,21 +247,19 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
||||||
<div className="flex space-x-2">
|
<div className="flex space-x-2">
|
||||||
<button
|
<button
|
||||||
onClick={() => setLogType('records')}
|
onClick={() => setLogType('records')}
|
||||||
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${
|
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${logType === 'records'
|
||||||
logType === 'records'
|
|
||||||
? 'bg-blue-100 text-blue-700'
|
? 'bg-blue-100 text-blue-700'
|
||||||
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
|
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
分类记录
|
分类记录
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => setLogType('tasks')}
|
onClick={() => setLogType('tasks')}
|
||||||
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${
|
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors ${logType === 'tasks'
|
||||||
logType === 'tasks'
|
|
||||||
? 'bg-blue-100 text-blue-700'
|
? 'bg-blue-100 text-blue-700'
|
||||||
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
|
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-100'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
分类任务
|
分类任务
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -296,21 +281,9 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
||||||
|
|
||||||
{/* 状态过滤 */}
|
{/* 状态过滤 */}
|
||||||
{filterOptions && (
|
{filterOptions && (
|
||||||
<select
|
<CustomSelect options={logType === 'records'
|
||||||
value={statusFilter}
|
? filterOptions.record_statuses
|
||||||
onChange={(e) => setStatusFilter(e.target.value)}
|
: filterOptions.task_statuses} value={statusFilter} onChange={e => setStatusFilter(e)} />
|
||||||
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>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
@ -327,17 +300,6 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
||||||
<RefreshCw className="w-4 h-4" />
|
<RefreshCw className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -398,12 +360,6 @@ export const AiAnalysisLogViewer: React.FC<AiAnalysisLogViewerProps> = ({ projec
|
||||||
<RotateCcw className="w-4 h-4" />
|
<RotateCcw className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
<button
|
|
||||||
className="p-1 text-gray-600 hover:text-gray-800"
|
|
||||||
title="查看详情"
|
|
||||||
>
|
|
||||||
<Eye className="w-4 h-4" />
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue