Show Windows Agent status on AI structure page
This commit is contained in:
@@ -703,6 +703,24 @@ def _format_binary_file_list(paths: list[Path]) -> str:
|
||||
return result
|
||||
|
||||
|
||||
def _ai_structure_agent_info(project_id: str) -> dict[str, str]:
|
||||
try:
|
||||
settings = _project_settings_or_404(project_id)
|
||||
except HTTPException:
|
||||
return {"status": "not_configured"}
|
||||
agent_id = _agent_id_for_source(settings, ImportSourceKind.CF_FILE)
|
||||
if not agent_id:
|
||||
return {"status": "not_configured"}
|
||||
status = _agent_status_with_liveness(_agent_statuses.get(agent_id, AgentStatus(agent_id=agent_id)))
|
||||
return {
|
||||
"agent_id": agent_id,
|
||||
"status": str(status.status or "offline"),
|
||||
"last_seen_at": str(status.last_seen_at or ""),
|
||||
"host": str(status.host or ""),
|
||||
"version": str(status.version or ""),
|
||||
}
|
||||
|
||||
|
||||
def _cancel_stale_extension_install_jobs(project_id: str, selected_agent_id: str) -> None:
|
||||
now = _current_timestamp()
|
||||
for job in list(_agent_import_jobs.values()):
|
||||
@@ -1791,6 +1809,7 @@ async def html5_project_ai_structure(project_id: str) -> Response:
|
||||
project_id=project_id,
|
||||
project_summaries=_project_summaries,
|
||||
load_credentials=_load_ai_structure_smb_credentials,
|
||||
load_agent_info=_ai_structure_agent_info,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user