mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
cmd/syncthing: Remove folder limit on /rest/system/browse
Previously limited to 10 results, now unlimited. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3279 LGTM: calmh, AudriusButkevicius
This commit is contained in:
parent
03a8027efc
commit
e71c78ae84
@ -1148,14 +1148,11 @@ func (s *apiService) getSystemBrowse(w http.ResponseWriter, r *http.Request) {
|
|||||||
search = search + pathSeparator
|
search = search + pathSeparator
|
||||||
}
|
}
|
||||||
subdirectories, _ := osutil.Glob(search + "*")
|
subdirectories, _ := osutil.Glob(search + "*")
|
||||||
ret := make([]string, 0, 10)
|
ret := make([]string, 0, len(subdirectories))
|
||||||
for _, subdirectory := range subdirectories {
|
for _, subdirectory := range subdirectories {
|
||||||
info, err := os.Stat(subdirectory)
|
info, err := os.Stat(subdirectory)
|
||||||
if err == nil && info.IsDir() {
|
if err == nil && info.IsDir() {
|
||||||
ret = append(ret, subdirectory+pathSeparator)
|
ret = append(ret, subdirectory+pathSeparator)
|
||||||
if len(ret) > 9 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user