refactor: remove AgentRunLog related code and components
- Deleted AgentRunLogResponse struct from skill_response.go. - Removed agent_run_log_repository.go and agent_run_log_service.go files. - Eliminated AgentRunLogDetailDialog component and its related logic from the dashboard. - Removed agent run log fetching functions from admin API. - Updated navigation and localization files to remove references to agent run logs.
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
package dashboard
|
||||
|
||||
import (
|
||||
"agent-desk/internal/builders"
|
||||
"agent-desk/internal/pkg/constants"
|
||||
"agent-desk/internal/pkg/dto/response"
|
||||
"agent-desk/internal/pkg/httpx"
|
||||
"agent-desk/internal/services"
|
||||
|
||||
"agent-desk/internal/pkg/httpx/params"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mlogclub/simple/web"
|
||||
)
|
||||
|
||||
func AgentRunLogAnyList(ctx *gin.Context) {
|
||||
if _, err := services.AuthService.RequirePermission(ctx, constants.PermissionConversationView); err != nil {
|
||||
httpx.WriteJSON(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
cnd := params.NewPagedSqlCnd(ctx,
|
||||
params.QueryFilter{ParamName: "conversationId"},
|
||||
params.QueryFilter{ParamName: "messageId"},
|
||||
params.QueryFilter{ParamName: "requestId"},
|
||||
params.QueryFilter{ParamName: "aiAgentId"},
|
||||
params.QueryFilter{ParamName: "plannedAction"},
|
||||
params.QueryFilter{ParamName: "plannedSkillId"},
|
||||
params.QueryFilter{ParamName: "graphToolCode"},
|
||||
params.QueryFilter{ParamName: "interruptType"},
|
||||
params.QueryFilter{ParamName: "resumeSource"},
|
||||
params.QueryFilter{ParamName: "finalStatus"},
|
||||
params.QueryFilter{ParamName: "handoffReason", Op: params.Like},
|
||||
params.QueryFilter{ParamName: "finalAction"},
|
||||
params.QueryFilter{ParamName: "userMessage", Op: params.Like},
|
||||
).Desc("id")
|
||||
if hitlStatus, _ := params.Get(ctx, "hitlStatus"); hitlStatus != "" && hitlStatus != "all" {
|
||||
cnd = services.AgentRunLogService.ApplyHITLStatusFilter(cnd, hitlStatus)
|
||||
}
|
||||
queryParams := params.NewQueryParams(ctx)
|
||||
queryParams.Cnd = *cnd
|
||||
list, paging := services.AgentRunLogService.FindPageByParams(queryParams)
|
||||
results := make([]response.AgentRunLogResponse, 0, len(list))
|
||||
for _, item := range list {
|
||||
results = append(results, builders.BuildAgentRunLog(&item))
|
||||
}
|
||||
httpx.WriteJSON(ctx, &web.PageResult{Results: results, Page: paging})
|
||||
}
|
||||
|
||||
func AgentRunLogGetBy(ctx *gin.Context) {
|
||||
id, ok := httpx.GetPathInt64(ctx, "id")
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
if _, err := services.AuthService.RequirePermission(ctx, constants.PermissionConversationView); err != nil {
|
||||
httpx.WriteJSON(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
item := services.AgentRunLogService.Get(id)
|
||||
if item == nil {
|
||||
httpx.WriteJSON(ctx, httpx.JsonErrorMsg(ctx, "error.e0013"))
|
||||
return
|
||||
}
|
||||
httpx.WriteJSON(ctx, builders.BuildAgentRunLog(item))
|
||||
}
|
||||
Reference in New Issue
Block a user