mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-05 13:01:50 +08:00
fix: restore topology view and mapping progress state
This commit is contained in:
1 parent
495ab57ba7
commit
14ebf44362
4 files changed
+59
-3
No files matched your search
@@ -767,6 +767,7 @@ func (s *Server) Handler() http.Handler {
|
||||
mux.HandleFunc("GET /api/tasks/{id}/coverage", s.taskCoverage)
|
||||
mux.HandleFunc("GET /api/tasks/{id}/coverage-graph", s.taskCoverageGraph)
|
||||
mux.HandleFunc("POST /api/tasks/{id}/asset-mapping", s.taskAssetMapping)
|
||||
mux.HandleFunc("GET /api/tasks/{id}/asset-mapping/status", s.taskAssetMappingStatus)
|
||||
mux.HandleFunc("GET /api/tasks/{id}/asset-refs", s.taskAssetRefs)
|
||||
mux.HandleFunc("POST /api/tasks/{id}/assets", s.attachTaskAssets)
|
||||
mux.HandleFunc("DELETE /api/tasks/{id}/assets/{assetID}", s.detachTaskAsset)
|
||||
|
||||
@@ -80,3 +80,29 @@ func (s *Server) taskAssetMapping(w http.ResponseWriter, r *http.Request) {
|
||||
"status": "accepted", "agent_key": "asset_mapper", "conversation_id": conversation.ID,
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Server) taskAssetMappingStatus(w http.ResponseWriter, r *http.Request) {
|
||||
t, ok := s.m.Task(r.PathValue("id"))
|
||||
if !ok {
|
||||
writeErr(w, http.StatusNotFound, "task not found")
|
||||
return
|
||||
}
|
||||
conversations, err := s.m.pg.ListConversations()
|
||||
if err != nil {
|
||||
writeErr(w, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
title := fmt.Sprintf("资产梳理 · 任务 #%s", t.ID)
|
||||
for _, conversation := range conversations {
|
||||
if conversation.AgentKey != "asset_mapper" || conversation.Title != title {
|
||||
continue
|
||||
}
|
||||
busyKey := s.convBusyKey(conversation.ID)
|
||||
s.chatMu.Lock()
|
||||
running := s.chatBusy[busyKey]
|
||||
s.chatMu.Unlock()
|
||||
writeJSON(w, http.StatusOK, map[string]any{"running": running, "conversation_id": conversation.ID})
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, map[string]any{"running": false})
|
||||
}
|
||||
Reference in new issue
Block a user