|
@@ -36,8 +36,9 @@ class TaskManager:
|
|
|
# 计算偏移量
|
|
|
offset = (page_num - 1) * page_size
|
|
|
# 查询分页数据
|
|
|
- result = (session.query(AgentTestTask, AgentConfiguration)
|
|
|
+ result = (session.query(AgentTestTask, AgentConfiguration, ServiceModule)
|
|
|
.outerjoin(AgentConfiguration, AgentTestTask.agent_id == AgentConfiguration.id)
|
|
|
+ .outerjoin(ServiceModule, AgentTestTask.module_id == ServiceModule.id)
|
|
|
.limit(page_size).offset(offset).all())
|
|
|
# 查询总记录数
|
|
|
total = session.query(func.count(AgentTestTask.id)).scalar()
|
|
@@ -47,14 +48,16 @@ class TaskManager:
|
|
|
response_data = [
|
|
|
{
|
|
|
"id": agent_test_task.id,
|
|
|
- "agentName": agent_configuration.name,
|
|
|
+ "agentId": agent_configuration.id,
|
|
|
+ "agentName": agent_configuration.display_name,
|
|
|
+ "moduleName":service_module.display_name,
|
|
|
"createUser": agent_test_task.create_user,
|
|
|
"updateUser": agent_test_task.update_user,
|
|
|
"statusName": get_test_task_status_desc(agent_test_task.status),
|
|
|
"createTime": agent_test_task.create_time.strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
"updateTime": agent_test_task.update_time.strftime("%Y-%m-%d %H:%M:%S")
|
|
|
}
|
|
|
- for agent_test_task, agent_configuration in result
|
|
|
+ for agent_test_task, agent_configuration, service_module in result
|
|
|
]
|
|
|
return {
|
|
|
"currentPage": page_num,
|