- Specialist Editor Change (all components in same overview), modal editors to allow for more complex configuration of Agents, Tasks and Tools
- Strengthening dynamic forms
This commit is contained in:
@@ -245,3 +245,74 @@ def get_eveai_data_capsules_list_view():
|
||||
'table_height': 800
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Combined specialist components list view helper
|
||||
def get_specialist_components_list_view(specialist):
|
||||
"""Generate a combined list view configuration for a specialist's agents, tasks, and tools"""
|
||||
# Build unified data rows: id, name, type_name (agent|task|tool), type, type_version
|
||||
data = []
|
||||
|
||||
# Agents
|
||||
for agent in getattr(specialist, 'agents', []) or []:
|
||||
data.append({
|
||||
'id': agent.id,
|
||||
'name': getattr(agent, 'name', f'Agent {agent.id}'),
|
||||
'type_name': 'agent',
|
||||
'type': agent.type,
|
||||
'type_version': agent.type_version,
|
||||
'row_key': f"agent:{agent.id}",
|
||||
})
|
||||
|
||||
# Tasks
|
||||
for task in getattr(specialist, 'tasks', []) or []:
|
||||
data.append({
|
||||
'id': task.id,
|
||||
'name': getattr(task, 'name', f'Task {task.id}'),
|
||||
'type_name': 'task',
|
||||
'type': task.type,
|
||||
'type_version': task.type_version,
|
||||
'row_key': f"task:{task.id}",
|
||||
})
|
||||
|
||||
# Tools
|
||||
for tool in getattr(specialist, 'tools', []) or []:
|
||||
data.append({
|
||||
'id': tool.id,
|
||||
'name': getattr(tool, 'name', f'Tool {tool.id}'),
|
||||
'type_name': 'tool',
|
||||
'type': tool.type,
|
||||
'type_version': tool.type_version,
|
||||
'row_key': f"tool:{tool.id}",
|
||||
})
|
||||
|
||||
current_app.logger.debug(f'Combined specialist components list view data: \n{data}')
|
||||
|
||||
# Sort ascending by id as requested
|
||||
data.sort(key=lambda r: (r.get('id') or 0))
|
||||
|
||||
columns = [
|
||||
{'title': 'ID', 'field': 'id', 'width': 80},
|
||||
{'title': 'Name', 'field': 'name'},
|
||||
{'title': 'Kind', 'field': 'type_name', 'formatter': 'typeBadge'},
|
||||
{'title': 'Type', 'field': 'type'},
|
||||
{'title': 'Type Version', 'field': 'type_version'},
|
||||
]
|
||||
|
||||
actions = [
|
||||
{'value': 'edit_component', 'text': 'Edit', 'class': 'btn-primary', 'requiresSelection': True},
|
||||
]
|
||||
|
||||
initial_sort = [{'column': 'id', 'dir': 'asc'}]
|
||||
|
||||
return {
|
||||
'title': 'Components',
|
||||
'data': data,
|
||||
'columns': columns,
|
||||
'actions': actions,
|
||||
'initial_sort': initial_sort,
|
||||
'table_id': 'specialist_components_table',
|
||||
'description': 'Agents, Tasks, and Tools associated with this specialist',
|
||||
'table_height': 600,
|
||||
'index': 'row_key',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user