| @@ -5,6 +5,7 @@ import ( | |||||
| "errors" | "errors" | ||||
| "github.com/unknwon/com" | "github.com/unknwon/com" | ||||
| "strconv" | "strconv" | ||||
| "strings" | |||||
| "time" | "time" | ||||
| "code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
| @@ -146,7 +147,7 @@ func ModelArtsShow(ctx *context.Context) { | |||||
| func ModelArtsDebug(ctx *context.Context) { | func ModelArtsDebug(ctx *context.Context) { | ||||
| var jobID = ctx.Params(":jobid") | var jobID = ctx.Params(":jobid") | ||||
| task, err := models.GetCloudbrainByJobID(jobID) | |||||
| _, err := models.GetCloudbrainByJobID(jobID) | |||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("GetCloudbrainByJobID failed", err) | ctx.ServerError("GetCloudbrainByJobID failed", err) | ||||
| return | return | ||||
| @@ -164,7 +165,17 @@ func ModelArtsDebug(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| urlPrefix := result.Spec.Annotations.TargetDomain + "/modelarts/internal/hub/notebook/user/" + task.JobID | |||||
| urls := strings.Split(result.Spec.Annotations.Url, "/") | |||||
| urlPrefix := result.Spec.Annotations.TargetDomain | |||||
| for i, url := range urls { | |||||
| if i > 2 { | |||||
| urlPrefix += "/" + url | |||||
| } | |||||
| } | |||||
| //urlPrefix := result.Spec.Annotations.TargetDomain + "/modelarts/internal/hub/notebook/user/" + task.JobID | |||||
| log.Info(urlPrefix) | |||||
| debugUrl := urlPrefix + "?token=" + res.Token | debugUrl := urlPrefix + "?token=" + res.Token | ||||
| ctx.Redirect(debugUrl) | ctx.Redirect(debugUrl) | ||||
| } | } | ||||