fix: 网元文件获取改用find读取避免Argument list too long错误
This commit is contained in:
@@ -181,13 +181,12 @@ func (s *NeActionController) Files(c *gin.Context) {
|
||||
defer sshClient.Close()
|
||||
|
||||
// 获取文件列表
|
||||
totalSize, rows, err := ssh.FileList(sshClient, querys.Path, querys.Search)
|
||||
rows, err := ssh.FileList(sshClient, querys.Path, querys.Search)
|
||||
if err != nil {
|
||||
c.JSON(200, result.Ok(map[string]any{
|
||||
"path": querys.Path,
|
||||
"totalSize": totalSize,
|
||||
"total": len(rows),
|
||||
"rows": []ssh.FileListRow{},
|
||||
"path": querys.Path,
|
||||
"total": len(rows),
|
||||
"rows": []ssh.FileListRow{},
|
||||
}))
|
||||
return
|
||||
}
|
||||
@@ -206,10 +205,9 @@ func (s *NeActionController) Files(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(200, result.Ok(map[string]any{
|
||||
"path": querys.Path,
|
||||
"totalSize": totalSize,
|
||||
"total": lenNum,
|
||||
"rows": splitRows,
|
||||
"path": querys.Path,
|
||||
"total": lenNum,
|
||||
"rows": splitRows,
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user