|
|
|
@@ -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 |
|
|
|
|