Browse Source

fix-462

tags/v1.22.4.1^2
liuzx 3 years ago
parent
commit
9612df52b9
2 changed files with 15 additions and 0 deletions
  1. +9
    -0
      routers/repo/cloudbrain.go
  2. +6
    -0
      routers/repo/modelarts.go

+ 9
- 0
routers/repo/cloudbrain.go View File

@@ -753,8 +753,11 @@ func CloudBrainDel(ctx *context.Context) {
} }


var isAdminPage = ctx.Query("isadminpage") var isAdminPage = ctx.Query("isadminpage")
var isHomePage = ctx.Query("isHomepage")
if ctx.IsUserSiteAdmin() && isAdminPage == "true" { if ctx.IsUserSiteAdmin() && isAdminPage == "true" {
ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains")
} else if isHomePage == "true" {
ctx.Redirect(setting.AppSubURL + "/cloudbrains")
} else { } else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=" + listType) 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 isAdminPage = ctx.Query("isadminpage")
var isHomePage = ctx.Query("isHomepage")
if ctx.IsUserSiteAdmin() && isAdminPage == "true" { if ctx.IsUserSiteAdmin() && isAdminPage == "true" {
ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains")
} else if isHomePage == "true" {
ctx.Redirect(setting.AppSubURL + "/cloudbrains")
} else { } else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark")
} }
@@ -1747,8 +1753,11 @@ func CloudBrainTrainJobDel(ctx *context.Context) {
} }


var isAdminPage = ctx.Query("isadminpage") var isAdminPage = ctx.Query("isadminpage")
var isHomePage = ctx.Query("isHomepage")
if ctx.IsUserSiteAdmin() && isAdminPage == "true" { if ctx.IsUserSiteAdmin() && isAdminPage == "true" {
ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains")
} else if isHomePage == "true" {
ctx.Redirect(setting.AppSubURL + "/cloudbrains")
} else { } else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType) ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType)
} }


+ 6
- 0
routers/repo/modelarts.go View File

@@ -530,8 +530,11 @@ func NotebookDel(ctx *context.Context) {
} }


var isAdminPage = ctx.Query("isadminpage") var isAdminPage = ctx.Query("isadminpage")
var isHomePage = ctx.Query("ishomepage")
if ctx.IsUserSiteAdmin() && isAdminPage == "true" { if ctx.IsUserSiteAdmin() && isAdminPage == "true" {
ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains")
} else if isHomePage == "true" {
ctx.Redirect(setting.AppSubURL + "/cloudbrains")
} else { } else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=" + listType) 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 isAdminPage = ctx.Query("isadminpage")
var isHomePage = ctx.Query("ishomepage")
if ctx.IsUserSiteAdmin() && isAdminPage == "true" { if ctx.IsUserSiteAdmin() && isAdminPage == "true" {
ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains")
} else if isHomePage == "true" {
ctx.Redirect(setting.AppSubURL + "/cloudbrains")
} else { } else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType) ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType)
} }


Loading…
Cancel
Save