feat(ui/files_pane): enable file/folder searching
This commit is contained in:
parent
302d3a6af8
commit
dbb1ce65ef
10 changed files with 225 additions and 37 deletions
|
@ -1181,10 +1181,15 @@ func (h *FileHandlers) SearchItems(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
role := c.MustGet(q.RoleParam).(string)
|
||||
userName := c.MustGet(q.UserParam).(string)
|
||||
results := []string{}
|
||||
for pathname, count := range resultsMap {
|
||||
if count >= len(keywords) {
|
||||
results = append(results, pathname)
|
||||
if role == db.AdminRole ||
|
||||
(role != db.AdminRole && strings.HasPrefix(pathname, userName)) {
|
||||
results = append(results, pathname)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue