diff --git a/composer.json b/composer.json index ab68a47..4457b0e 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require": { "php" : "~7.0", "illuminate/support": "^5.4", - "tightenco/ziggy": "^0.3", + "tightenco/ziggy": "^0.4", "ctf0/package-changelog": "^1.0" }, "autoload": { diff --git a/logs/v1.2.2.txt b/logs/v1.2.2.txt deleted file mode 100644 index 5ebf8a6..0000000 --- a/logs/v1.2.2.txt +++ /dev/null @@ -1,3 +0,0 @@ -- add changelog feature so now you can know what was changed/updated/added on each update -- remove cmnd as we auto-add extra data on package installation -- update view \ No newline at end of file diff --git a/logs/v1.2.3.txt b/logs/v1.2.3.txt new file mode 100644 index 0000000..f8a72f2 --- /dev/null +++ b/logs/v1.2.3.txt @@ -0,0 +1,4 @@ +- fixed sortBy:size +- fixed sortBy:last_modified +- add new option to config https://github.com/ctf0/Laravel-Media-Manager/blob/master/src/config/mediaManager.php#L51 +- update view \ No newline at end of file diff --git a/src/Controllers/MediaController.php b/src/Controllers/MediaController.php index 283722b..5dff4df 100755 --- a/src/Controllers/MediaController.php +++ b/src/Controllers/MediaController.php @@ -308,12 +308,13 @@ public function getFiles($dir) foreach ($storageFolders as $folder) { if (!preg_grep($pattern, [$folder])) { $files[] = [ - 'name' => strpos($folder, '/') > 1 ? str_replace('/', '', strrchr($folder, '/')) : $folder, - 'type' => 'folder', - 'path' => $this->storageDisk->url($folder), - 'size' => '', - 'items' => count($this->storageDisk->allFiles($folder)) + count($this->storageDisk->allDirectories($folder)), - 'last_modified' => Carbon::createFromTimestamp($this->storageDisk->lastModified($folder))->{$this->LMF}(), + 'name' => strpos($folder, '/') > 1 ? str_replace('/', '', strrchr($folder, '/')) : $folder, + 'type' => 'folder', + 'path' => $this->storageDisk->url($folder), + 'size' => '', + 'items' => count($this->storageDisk->allFiles($folder)) + count($this->storageDisk->allDirectories($folder)), + 'last_modified' => $this->storageDisk->lastModified($folder), + 'last_modified_formated' => Carbon::createFromTimestamp($this->storageDisk->lastModified($folder))->{$this->LMF}(), ]; } } @@ -321,11 +322,12 @@ public function getFiles($dir) foreach ($storageFiles as $file) { if (!preg_grep($pattern, [$file])) { $files[] = [ - 'name' => strpos($file, '/') > 1 ? str_replace('/', '', strrchr($file, '/')) : $file, - 'type' => $this->storageDisk->mimeType($file), - 'path' => $this->storageDisk->url($file), - 'size' => $this->storageDisk->size($file), - 'last_modified' => Carbon::createFromTimestamp($this->storageDisk->lastModified($file))->{$this->LMF}(), + 'name' => strpos($file, '/') > 1 ? str_replace('/', '', strrchr($file, '/')) : $file, + 'type' => $this->storageDisk->mimeType($file), + 'path' => $this->storageDisk->url($file), + 'size' => $this->storageDisk->size($file), + 'last_modified' => $this->storageDisk->lastModified($file), + 'last_modified_formated' => Carbon::createFromTimestamp($this->storageDisk->lastModified($file))->{$this->LMF}(), ]; } } diff --git a/src/resources/assets/js/components/bulma/media.vue b/src/resources/assets/js/components/bulma/media.vue index e96dffe..a758cb0 100644 --- a/src/resources/assets/js/components/bulma/media.vue +++ b/src/resources/assets/js/components/bulma/media.vue @@ -550,12 +550,6 @@ export default { $('#file_loader').hide() this.selectFirst() $('#right').fadeIn() - - this.allFiles.map((e) => { - if (typeof e.size !== 'undefined') { - e.size = this.bytesToSize(e.size) - } - }) }) // dirs list diff --git a/src/resources/views/bulma/media.blade.php b/src/resources/views/bulma/media.blade.php index 7472401..a63d8d2 100755 --- a/src/resources/views/bulma/media.blade.php +++ b/src/resources/views/bulma/media.blade.php @@ -260,10 +260,10 @@ class="button" - - - - + + + +