fix: 调整网元日志文件列表返回信息

This commit is contained in:
TsMask
2023-12-13 21:14:28 +08:00
parent 738ff3b6f5
commit 4340572421
2 changed files with 33 additions and 12 deletions

View File

@@ -125,9 +125,14 @@ func (s *NeActionController) Files(c *gin.Context) {
return
}
total, rows, err := ssh.FileList(querys.Path, neInfo.IP, querys.Search)
totalSize, rows, err := ssh.FileList(querys.Path, neInfo.IP, querys.Search)
if err != nil {
c.JSON(200, result.ErrMsg(err.Error()))
c.JSON(200, result.Ok(map[string]any{
"path": querys.Path,
"totalSize": totalSize,
"total": len(rows),
"rows": []ssh.FileListRow{},
}))
return
}
@@ -145,8 +150,9 @@ func (s *NeActionController) Files(c *gin.Context) {
}
c.JSON(200, result.Ok(map[string]any{
"path": querys.Path,
"total": total,
"rows": splitRows,
"path": querys.Path,
"totalSize": totalSize,
"total": lenNum,
"rows": splitRows,
}))
}