mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-25 18:20:38 +00:00
- spotlight refactoring
- subscription widget fix in admin
This commit is contained in:
@@ -898,18 +898,7 @@ export default {
|
|||||||
params: { query: value },
|
params: { query: value },
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// Show user result
|
this.results = response.data.data
|
||||||
if (this.activeFilter === 'users') {
|
|
||||||
this.results = response.data
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show file result
|
|
||||||
if (!this.activeFilter) {
|
|
||||||
let files = response.data.files
|
|
||||||
let folders = response.data.folders
|
|
||||||
|
|
||||||
this.results = folders.concat(files)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(() => this.$isSomethingWrong())
|
.catch(() => this.$isSomethingWrong())
|
||||||
.finally(() => (this.isLoading = false))
|
.finally(() => (this.isLoading = false))
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default {
|
|||||||
|
|
||||||
this.limitations.push({
|
this.limitations.push({
|
||||||
message: payload.message[key],
|
message: payload.message[key],
|
||||||
isVisibleBar: item.total === -1,
|
isVisibleBar: item.total !== -1 && item.total !== 0,
|
||||||
distribution: [
|
distribution: [
|
||||||
{
|
{
|
||||||
progress: item.percentage,
|
progress: item.percentage,
|
||||||
|
|||||||
@@ -96,10 +96,14 @@ class SpotlightSearchController
|
|||||||
->get()
|
->get()
|
||||||
->take(3);
|
->take(3);
|
||||||
|
|
||||||
|
$entries = collect([
|
||||||
|
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
|
||||||
|
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
|
||||||
|
])->collapse();
|
||||||
|
|
||||||
// Collect folders and files to single array
|
// Collect folders and files to single array
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'folders' => new FolderCollection($folders),
|
'data' => $entries,
|
||||||
'files' => new FilesCollection($files),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user