mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 17:13:30 +08:00
fix: 修复文件列表总共条数显示问题 (#952)
This commit is contained in:
parent
149c26728c
commit
2b23523bec
1 changed files with 3 additions and 4 deletions
|
@ -113,7 +113,6 @@ func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, tot
|
||||||
scanner := bufio.NewScanner(output)
|
scanner := bufio.NewScanner(output)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
fmt.Println(line)
|
|
||||||
info, err := os.Stat(line)
|
info, err := os.Stat(line)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
@ -159,8 +158,6 @@ func (f *FileInfo) listChildren(dir, showHidden, containSub bool, search string,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
f.ItemTotal = 0
|
|
||||||
|
|
||||||
var items []*FileInfo
|
var items []*FileInfo
|
||||||
for _, df := range files {
|
for _, df := range files {
|
||||||
if dir && !df.IsDir() {
|
if dir && !df.IsDir() {
|
||||||
|
@ -222,7 +219,9 @@ func (f *FileInfo) listChildren(dir, showHidden, containSub bool, search string,
|
||||||
}
|
}
|
||||||
items = append(items, file)
|
items = append(items, file)
|
||||||
}
|
}
|
||||||
f.ItemTotal = total
|
if containSub {
|
||||||
|
f.ItemTotal = total
|
||||||
|
}
|
||||||
start := (page - 1) * pageSize
|
start := (page - 1) * pageSize
|
||||||
end := pageSize + start
|
end := pageSize + start
|
||||||
var result []*FileInfo
|
var result []*FileInfo
|
||||||
|
|
Loading…
Reference in a new issue