Blocked HTML

This commit is contained in:
马一丁
2025-11-13 10:56:28 +08:00
parent 403dbbd296
commit 4846b1f758
20 changed files with 3660 additions and 367 deletions
+17 -9
View File
@@ -78,7 +78,9 @@ class ReportTask:
'has_result': bool(self.html_content),
'report_file_ready': bool(self.report_file_path),
'report_file_name': self.report_file_name,
'report_file_path': self.report_file_relative_path
'report_file_path': self.report_file_relative_path or self.report_file_path,
'state_file_ready': bool(self.state_file_path),
'state_file_path': self.state_file_relative_path or self.state_file_path
}
@@ -135,17 +137,21 @@ def run_report_generation(task: ReportTask, query: str, custom_template: str = "
save_report=True
)
html_report = generation_result.get('html_content', '')
if isinstance(generation_result, dict):
html_report = generation_result.get('html_content', '')
else:
html_report = generation_result
task.update_status("running", 90)
# 保存结果
task.html_content = html_report
task.report_file_path = generation_result.get('report_filepath', '')
task.report_file_relative_path = generation_result.get('report_relative_path', '')
task.report_file_name = generation_result.get('report_filename', '')
task.state_file_path = generation_result.get('state_filepath', '')
task.state_file_relative_path = generation_result.get('state_relative_path', '')
if isinstance(generation_result, dict):
task.report_file_path = generation_result.get('report_filepath', '')
task.report_file_relative_path = generation_result.get('report_relative_path', '')
task.report_file_name = generation_result.get('report_filename', '')
task.state_file_path = generation_result.get('state_filepath', '')
task.state_file_relative_path = generation_result.get('state_relative_path', '')
task.update_status("completed", 100)
except Exception as e:
@@ -269,7 +275,9 @@ def get_progress(task_id: str):
'has_result': True,
'report_file_ready': False,
'report_file_name': '',
'report_file_path': ''
'report_file_path': '',
'state_file_ready': False,
'state_file_path': ''
}
})
@@ -534,4 +542,4 @@ def clear_log():
return jsonify({
'success': False,
'error': f'清空日志失败: {str(e)}'
}), 500
}), 500