fix: 解决搜索子目录模糊查询失败的问题 (#1085)

Refs https://github.com/1Panel-dev/1Panel/issues/1049
This commit is contained in:
zhengkunwang223 2023-05-19 15:51:09 +08:00 committed by GitHub
parent 03d338d6c9
commit d851aeed45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -99,7 +99,7 @@ func NewFileInfo(op FileOption) (*FileInfo, error) {
}
func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, total int, err error) {
cmd := exec.Command("find", f.Path, "-name", search)
cmd := exec.Command("find", f.Path, "-name", fmt.Sprintf("*%s*", search))
output, err := cmd.StdoutPipe()
if err != nil {
return

View file

@ -90,7 +90,7 @@
clearable
@clear="search()"
@keydown.enter="search()"
:placeholder="req.containSub ? $t('file.searchHelper') : $t('file.search')"
:placeholder="$t('file.search')"
>
<template #prepend>
<el-checkbox v-model="req.containSub">