From 3999f7b9bd48ff954faeb9325c49daf3fa2bbad8 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 20 Aug 2022 08:26:52 +0000 Subject: [PATCH] Show previews on folders --- lib/Controller/ApiController.php | 7 ++- src/components/Folder.vue | 100 +++++++++++++++++++++++++++++-- src/components/Timeline.vue | 2 +- src/services/DavRequests.js | 72 ++++++++++++++++++++++ 4 files changed, 171 insertions(+), 10 deletions(-) diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 469276a8..13fe459f 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -149,11 +149,12 @@ class ApiController extends Controller { // Map sub to JSON array $subdirArray = [ "day_id" => -0.1, - "detail" => array_map(function ($item) { + "detail" => array_map(function ($node) { return [ - "file_id" => $item->getId(), - "name" => $item->getName(), + "file_id" => $node->getId(), + "name" => $node->getName(), "is_folder" => 1, + "path" => $node->getPath(), ]; }, $sub, []), ]; diff --git a/src/components/Folder.vue b/src/components/Folder.vue index 46449ee0..2ca87994 100644 --- a/src/components/Folder.vue +++ b/src/components/Folder.vue @@ -1,16 +1,27 @@