diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0d007a27d..06077106b 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -753,8 +753,11 @@ func CloudBrainDel(ctx *context.Context) { } var isAdminPage = ctx.Query("isadminpage") + var isHomePage = ctx.Query("isHomepage") if ctx.IsUserSiteAdmin() && isAdminPage == "true" { ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") + } else if isHomePage == "true" { + ctx.Redirect(setting.AppSubURL + "/cloudbrains") } else { ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=" + listType) } @@ -1693,8 +1696,11 @@ func BenchmarkDel(ctx *context.Context) { } var isAdminPage = ctx.Query("isadminpage") + var isHomePage = ctx.Query("isHomepage") if ctx.IsUserSiteAdmin() && isAdminPage == "true" { ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") + } else if isHomePage == "true" { + ctx.Redirect(setting.AppSubURL + "/cloudbrains") } else { ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") } @@ -1747,8 +1753,11 @@ func CloudBrainTrainJobDel(ctx *context.Context) { } var isAdminPage = ctx.Query("isadminpage") + var isHomePage = ctx.Query("isHomepage") if ctx.IsUserSiteAdmin() && isAdminPage == "true" { ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") + } else if isHomePage == "true" { + ctx.Redirect(setting.AppSubURL + "/cloudbrains") } else { ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType) } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 933571a0b..36da1ce21 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -530,8 +530,11 @@ func NotebookDel(ctx *context.Context) { } var isAdminPage = ctx.Query("isadminpage") + var isHomePage = ctx.Query("ishomepage") if ctx.IsUserSiteAdmin() && isAdminPage == "true" { ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") + } else if isHomePage == "true" { + ctx.Redirect(setting.AppSubURL + "/cloudbrains") } else { ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=" + listType) } @@ -1685,8 +1688,11 @@ func TrainJobDel(ctx *context.Context) { } var isAdminPage = ctx.Query("isadminpage") + var isHomePage = ctx.Query("ishomepage") if ctx.IsUserSiteAdmin() && isAdminPage == "true" { ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") + } else if isHomePage == "true" { + ctx.Redirect(setting.AppSubURL + "/cloudbrains") } else { ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType) }