celery 升级优化V2 | 日志调整 | 前端BUG修复

This commit is contained in:
2026-07-23 12:07:23 +08:00
parent 06bf5c4db7
commit 2931e67226
37 changed files with 3122 additions and 1613 deletions
+25 -6
View File
@@ -1,5 +1,5 @@
import { create } from 'zustand';
import type { Project, GenerationRecord, OptimizeParams, GenerateParams, OptimizeResult, Industry, MediaReference } from '../types';
import type { Project, GenerationRecord, OptimizeParams, OptimizeResult, Industry, MediaReference } from '../types';
import * as api from '../api';
import { useAuthStore } from './useAuthStore';
@@ -41,7 +41,8 @@ interface AppState {
fetchRecords: (params?: api.GetRecordsPageParams) => Promise<void>;
optimizePrompt: (projectId: string, params: OptimizeParams) => Promise<OptimizeResult>;
generateVideo: (recordId: string, params: GenerateParams) => Promise<GenerationRecord>;
generateVideo: (recordId: string) => Promise<GenerationRecord>;
retryGeneration: (recordId: string) => Promise<GenerationRecord>;
updateRecordReferences: (recordId: string, references: MediaReference[]) => void;
// 生成配置状态更新方法
@@ -126,18 +127,36 @@ export const useAppStore = create<AppState>((set, get) => ({
try { await useAuthStore.getState().checkAuth(); } catch { /* */ }
const currentRecords = get().records;
const existingIndex = currentRecords.items.findIndex((item) => item.id === result.record.id);
const nextItems = existingIndex >= 0
? currentRecords.items.map((item) => item.id === result.record.id ? result.record : item)
: [result.record, ...currentRecords.items];
set({
records: {
...currentRecords,
total: currentRecords.total + 1,
items: [result.record, ...currentRecords.items],
total: existingIndex >= 0 ? currentRecords.total : currentRecords.total + 1,
items: nextItems,
},
});
return result;
},
generateVideo: async (recordId, params) => {
const record = await api.generateVideo(recordId, params);
generateVideo: async (recordId) => {
const record = await api.generateVideo(recordId);
try { await useAuthStore.getState().checkAuth(); } catch { /* */ }
const currentRecords = get().records;
set({
records: {
...currentRecords,
items: currentRecords.items.map((r) => (r.id === recordId ? record : r)),
},
});
return record;
},
retryGeneration: async (recordId) => {
const record = await api.retryGeneration(recordId);
try { await useAuthStore.getState().checkAuth(); } catch { /* */ }
const currentRecords = get().records;