Browse Source

fix-3392

fix-3221-v1
liuzx 2 years ago
parent
commit
c45ffda6eb
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      routers/api/v1/repo/cloudbrain.go

+ 9
- 5
routers/api/v1/repo/cloudbrain.go View File

@@ -766,13 +766,17 @@ func CloudbrainGetLog(ctx *context.APIContext) {
if baseLine == "" && order == "desc" && result["Lines"].(int) == 0 {
result["Lines"] = 1
result["EndLine"] = 1
content = content + ctx.Data["existStr"].(string)
}
if ctx.Data["existStr"] != nil && result["Lines"].(int) < 60 {

if result["Lines"].(int) == 0 && result["StartLine"] == result["EndLine"] && result["StartLine"].(int) != 0 {
content = content + ctx.Data["existStr"].(string)
if result["Lines"].(int) == 0 {
result["Lines"] = 1
result["EndLine"] = result["StartLine"]
}
result["Lines"] = 1
result["StartLine"] = result["StartLine"].(int) - 1
}
if result["Lines"].(int) == 1 && result["StartLine"] == result["EndLine"] {
result["Lines"] = 0
result["StartLine"] = result["StartLine"].(int) + 1
}
}
} else {


Loading…
Cancel
Save