From c5e6d67d0645fa607dc6704da01f4a2c9bd20dc4 Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Mon, 11 Nov 2024 17:28:44 +0800 Subject: [PATCH] bug fix --- internal/logic/core/taskdetailslogic.go | 9 +++++++++ internal/types/types.go | 1 + 2 files changed, 10 insertions(+) diff --git a/internal/logic/core/taskdetailslogic.go b/internal/logic/core/taskdetailslogic.go index 0ab1202e..215a4966 100644 --- a/internal/logic/core/taskdetailslogic.go +++ b/internal/logic/core/taskdetailslogic.go @@ -8,6 +8,7 @@ import ( "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" "gorm.io/gorm" + "strings" "github.com/zeromicro/go-zero/core/logx" ) @@ -48,6 +49,14 @@ func (l *TaskDetailsLogic) TaskDetails(req *types.FId) (resp *types.TaskDetailsR } case "2": l.svcCtx.DbEngin.Table("task_hpc").Where("task_id", task.Id).Scan(&subList) + for _, hpc := range subList { + var cluster types.ClusterInfo + tx := l.svcCtx.DbEngin.Table("t_cluster").Where("id = ?", hpc.ClusterId).Scan(&cluster) + if tx.Error != nil { + + } + hpc.WorkDir = strings.TrimPrefix(hpc.WorkDir, cluster.WorkDir) + } } for _, sub := range subList { clusterIds = append(clusterIds, sub.ClusterId) diff --git a/internal/types/types.go b/internal/types/types.go index 0d21eff3..11b182ec 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -1267,6 +1267,7 @@ type SubTaskInfo struct { Status string `json:"status" db:"status"` Remark string `json:"remark" db:"remark"` InferUrl string `json:"inferUrl"` + WorkDir string `json:"workDir"` } type CommonResp struct {