Blocked HTML
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user