mirror of
https://github.com/sligter/LandPPT.git
synced 2026-09-01 15:54:37 +08:00
fix(web): track queued export tasks in editor
This commit is contained in:
@@ -34,7 +34,7 @@ async function exportToPDF() {
|
||||
throw new Error('服务器返回了未知的响应格式。');
|
||||
}
|
||||
|
||||
if (data.status === 'processing' && data.task_id) {
|
||||
if ((data.status === 'processing' || data.status === 'queued' || data.status === 'pending') && data.task_id) {
|
||||
const slideCount = data.slide_count || '多个';
|
||||
updateProgressToast(progressToast, `PDF生成任务已启动(共${slideCount}页),正在后台处理...`, 15);
|
||||
await trackPdfExportTask(data.task_id, progressToast);
|
||||
@@ -170,7 +170,7 @@ async function exportToPPTX() {
|
||||
throw new Error('服务器返回了未知的响应格式。');
|
||||
}
|
||||
|
||||
if (data.status === 'processing' && data.task_id) {
|
||||
if ((data.status === 'processing' || data.status === 'queued' || data.status === 'pending') && data.task_id) {
|
||||
updateProgressToast(progressToast, 'PPTX转换任务已启动,正在后台处理...', 20);
|
||||
await trackPptxExportTask(data.task_id, progressToast);
|
||||
} else if (data.download_url) {
|
||||
@@ -330,7 +330,7 @@ async function exportToPPTXAsImages() {
|
||||
throw new Error('服务器返回了未知的响应格式。');
|
||||
}
|
||||
|
||||
if (data.status === 'processing' && data.task_id) {
|
||||
if ((data.status === 'processing' || data.status === 'queued' || data.status === 'pending') && data.task_id) {
|
||||
updateProgressToast(progressToast, '图片PPTX生成任务已启动,正在后台处理...', 25);
|
||||
await trackPptxExportTask(data.task_id, progressToast, {
|
||||
startProgress: 25,
|
||||
|
||||
@@ -458,6 +458,13 @@ def test_editor_page_modules_own_their_responsibilities():
|
||||
assert marker in narration_text
|
||||
|
||||
|
||||
def test_editor_export_polling_accepts_queued_task_responses():
|
||||
share_text = _read("src/landppt/web/static/js/pages/project/slides_editor/projectEditorShareExport.js")
|
||||
|
||||
assert "data.status === 'queued'" in share_text
|
||||
assert share_text.count("data.status === 'queued'") >= 3
|
||||
|
||||
|
||||
def test_enhanced_ppt_service_delegates_file_outline_workflow_to_extracted_service():
|
||||
service_text = _read("src/landppt/services/enhanced_ppt_service.py")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user