diff --git a/dzen-assistant/admin/src/App.tsx b/dzen-assistant/admin/src/App.tsx index 8aa88a3..d6968e1 100644 --- a/dzen-assistant/admin/src/App.tsx +++ b/dzen-assistant/admin/src/App.tsx @@ -1146,6 +1146,22 @@ function StatusBadge({ status }: { status: string }) { ) } + if (normalized === "planning") { + return ( + + + Хронометраж + + ) + } + if (normalized === "planned") { + return ( + + + Темы готовы + + ) + } return {status} } @@ -1504,6 +1520,12 @@ export default function App() { try { const result = await api(`/api/videos/${video.id}/chapters`) if (!result.canSplit || result.chapters.length < 2) { + if (video.sourceUrl.startsWith("upload://")) { + const task = await api<{ taskId: string }>(`/api/videos/${video.id}/chapter-plan`, { method: "POST" }) + setStatusMessage(`Строю хронометраж ролика. Транскрибация и темы появятся в журнале. Task: ${task.taskId}`) + await refresh() + return + } await processVideo(video.id) return } @@ -2336,7 +2358,7 @@ export default function App() { const draftArticleId = draftArticles[0]?.id ?? (publishedArticle ? undefined : fallbackArticleId) const progress = Math.max(0, Math.min(100, video.progressPercent || 0)) const hasStarted = video.status !== "new" || progress > 0 - const isActive = ["queued", "processing"].includes(video.status) + const isActive = ["queued", "processing", "planning"].includes(video.status) const isSubmitting = videoActionId === video.id const hasDraftAction = draftArticles.length > 0 || Boolean(draftArticleId) return ( @@ -2415,12 +2437,12 @@ export default function App() { ) : (