Browse Source

修复日志显示问题

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.9.1^2
zouap 3 years ago
parent
commit
16b23ff5cb
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      routers/api/v1/repo/cloudbrain.go

+ 3
- 2
routers/api/v1/repo/cloudbrain.go View File

@@ -414,13 +414,14 @@ func CloudbrainGetLog(ctx *context.Context) {
}
lines := ctx.QueryInt("lines")
baseLine := ctx.Query("base_line")
order := ctx.Query("order")
var result map[string]interface{}
if baseLine == "" {
if baseLine == "" && order == "desc" {
result = getLastLogFromModelDir(job.JobName, lines)
} else {
startLine := ctx.QueryInt("base_line")
endLine := startLine + lines
order := ctx.Query("order")
if order == "asc" {
endLine = startLine
startLine = endLine - lines


Loading…
Cancel
Save