From 1608877813642a564c30c31acafce75f44d35578 Mon Sep 17 00:00:00 2001 From: Graham Steffaniak <42989099+gtsteffaniak@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:44:53 -0500 Subject: [PATCH] V0.2.10 (#220) --- CHANGELOG.md | 17 + README.md | 45 +-- backend/benchmark_results.txt | 26 +- backend/cmd/root.go | 311 +++++++++++------- backend/cmd/rule_rm.go | 20 +- backend/cmd/rules.go | 6 +- backend/cmd/rules_add.go | 16 +- backend/cmd/rules_ls.go | 7 +- backend/cmd/users.go | 4 - backend/cmd/users_add.go | 20 +- backend/cmd/users_export.go | 12 +- backend/cmd/users_find.go | 14 +- backend/cmd/users_import.go | 32 +- backend/cmd/users_rm.go | 12 +- backend/cmd/users_update.go | 16 +- backend/cmd/utils.go | 90 +---- backend/cmd/version.go | 21 -- backend/files/conditions.go | 2 +- backend/files/conditions_test.go | 154 +++++++++ backend/files/file.go | 102 +++--- backend/files/indexing.go | 153 +++++---- backend/files/indexing_test.go | 25 +- backend/files/search.go | 145 ++++---- backend/files/search_test.go | 264 ++++++--------- backend/files/sync.go | 81 ++--- backend/files/sync_test.go | 236 +++++++------ backend/http/http.go | 15 +- backend/http/public_test.go | 10 +- backend/http/users.go | 18 +- backend/settings/config.go | 7 +- backend/settings/settings.go | 12 + backend/storage/bolt/auth.go | 2 +- backend/storage/bolt/bolt.go | 16 +- backend/storage/bolt/config.go | 4 +- backend/storage/bolt/utils.go | 2 +- backend/storage/storage.go | 119 +++++++ backend/utils/main.go | 19 ++ configuration.md => docs/configuration.md | 0 docs/contributing.md | 2 + docs/getting_started.md | 2 + docs/migration.md | 22 ++ docs/roadmap.md | 24 ++ frontend/src/components/Breadcrumbs.vue | 29 +- frontend/src/components/Search.vue | 11 +- frontend/src/components/files/ListingItem.vue | 15 +- frontend/src/store/mutations.js | 12 +- frontend/src/utils/filesizes.js | 18 +- frontend/src/views/bars/Default.vue | 8 +- frontend/src/views/files/ListingView.vue | 10 +- roadmap.md | 27 -- 50 files changed, 1281 insertions(+), 954 deletions(-) delete mode 100644 backend/cmd/version.go create mode 100644 backend/files/conditions_test.go create mode 100644 backend/utils/main.go rename configuration.md => docs/configuration.md (100%) create mode 100644 docs/contributing.md create mode 100644 docs/getting_started.md create mode 100644 docs/migration.md create mode 100644 docs/roadmap.md delete mode 100644 roadmap.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 2af53cea..13f053ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. For commit guidelines, please refer to [Standard Version](https://github.com/conventional-changelog/standard-version). +## v0.2.10 + + **New Features**: + - Allows user creation command line arguments https://github.com/gtsteffaniak/filebrowser/issues/196 + - Folder sizes are always shown, leveraging the index. https://github.com/gtsteffaniak/filebrowser/issues/138 + - Searching files based on filesize is no longer slower. + + **Bugfixes**: + - fixes file selection usage when in single-click mode https://github.com/gtsteffaniak/filebrowser/issues/214 + - Fixed displayed search context on root directory + - Fixed issue searching "smaller than" actually returned files "larger than" + + **Notes**: + - Memory usage from index is reduced by ~40% + - Indexing time has increased 2x due to the extra processing time required to calculate directory sizes. + - File size calcuations use 1024 base vs previous 1000 base (matching windows explorer) + ## v0.2.9 This release focused on UI navigation experience. Improving keyboard navigation and adds right click context menu. diff --git a/README.md b/README.md index a31c33ff..3190d42a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@
-
+
|
,
for example "test|not"
searches for both terms independently.
- - File size: Searching files by size may have significantly longer search - times. -
{{ name }}
-—
-{{ humanSize() }}
+{{ humanSize() }}
@@ -93,6 +92,9 @@ export default { "path", ], computed: { + quickNav() { + return state.user.singleClick && !state.multiple; + }, user() { return state.user; }, @@ -263,6 +265,7 @@ export default { action(overwrite, rename); }, itemClick(event) { + console.log("should say something"); if (this.singleClick && !state.multiple) this.open(); else this.click(event); }, @@ -271,7 +274,7 @@ export default { setTimeout(() => { this.touches = 0; - }, 300); + }, 500); this.touches++; if (this.touches > 1) { diff --git a/frontend/src/store/mutations.js b/frontend/src/store/mutations.js index 1bff42a9..6869696e 100644 --- a/frontend/src/store/mutations.js +++ b/frontend/src/store/mutations.js @@ -9,6 +9,7 @@ export const mutations = { setGallerySize: (value) => { state.user.gallerySize = value emitStateChanged(); + users.update(state.user,['gallerySize']); }, setActiveSettingsView: (value) => { state.activeSettingsView = value; @@ -195,19 +196,20 @@ export const mutations = { emitStateChanged(); }, setRoute: (value) => { + console.log("going...",value) state.route = value; emitStateChanged(); }, updateListingSortConfig: ({ field, asc }) => { - state.req.sorting.by = field; - state.req.sorting.asc = asc; + state.user.sorting.by = field; + state.user.sorting.asc = asc; emitStateChanged(); }, updateListingItems: () => { state.req.items.sort((a, b) => { - const valueA = a[state.req.sorting.by]; - const valueB = b[state.req.sorting.by]; - if (state.req.sorting.asc) { + const valueA = a[state.user.sorting.by]; + const valueB = b[state.user.sorting.by]; + if (state.user.sorting.asc) { return valueA > valueB ? 1 : -1; } else { return valueA < valueB ? 1 : -1; diff --git a/frontend/src/utils/filesizes.js b/frontend/src/utils/filesizes.js index 30dc9a35..b3f29bba 100644 --- a/frontend/src/utils/filesizes.js +++ b/frontend/src/utils/filesizes.js @@ -7,24 +7,24 @@ export function getHumanReadableFilesize(fileSizeBytes) { switch (true) { case fileSizeBytes < 1024: break; - case fileSizeBytes < 1000 ** 2: // 1 KB - 1 MB - size = fileSizeBytes / 1000; + case fileSizeBytes < 1024 ** 2: // 1 KB - 1 MB + size = fileSizeBytes / 1024; unit = 'KB'; break; - case fileSizeBytes < 1000 ** 3: // 1 MB - 1 GB - size = fileSizeBytes / (1000 ** 2); + case fileSizeBytes < 1024 ** 3: // 1 MB - 1 GB + size = fileSizeBytes / (1024 ** 2); unit = 'MB'; break; - case fileSizeBytes < 1000 ** 4: // 1 GB - 1 TB - size = fileSizeBytes / (1000 ** 3); + case fileSizeBytes < 1024 ** 4: // 1 GB - 1 TB + size = fileSizeBytes / (1024 ** 3); unit = 'GB'; break; - case fileSizeBytes < 1000 ** 5: // 1 TB - 1 PB - size = fileSizeBytes / (1000 ** 4); + case fileSizeBytes < 1024 ** 5: // 1 TB - 1 PB + size = fileSizeBytes / (1024 ** 4); unit = 'TB'; break; default: // >= 1 PB - size = fileSizeBytes / (1000 ** 5); + size = fileSizeBytes / (1024 ** 5); unit = 'PB'; break; } diff --git a/frontend/src/views/bars/Default.vue b/frontend/src/views/bars/Default.vue index 9f32af35..dda05e5e 100644 --- a/frontend/src/views/bars/Default.vue +++ b/frontend/src/views/bars/Default.vue @@ -51,13 +51,13 @@ export default { return state.selected; }, nameSorted() { - return state.req.sorting.by === "name"; + return state.user.sorting.by === "name"; }, sizeSorted() { - return state.req.sorting.by === "size"; + return state.user.sorting.by === "size"; }, modifiedSorted() { - return state.req.sorting.by === "modified"; + return state.user.sorting.by === "modified"; }, ascOrdered() { return state.req.sorting.asc; @@ -297,7 +297,7 @@ export default { const currentIndex = this.viewModes.indexOf(state.user.viewMode); const nextIndex = (currentIndex + 1) % this.viewModes.length; const newView = this.viewModes[nextIndex]; - mutations.updateCurrentUser({ "viewMode": newView }); + mutations.updateCurrentUser({ viewMode: newView }); }, preventDefault(event) { // Wrapper around prevent default. diff --git a/frontend/src/views/files/ListingView.vue b/frontend/src/views/files/ListingView.vue index d6aa5a42..3a19cf19 100644 --- a/frontend/src/views/files/ListingView.vue +++ b/frontend/src/views/files/ListingView.vue @@ -207,16 +207,16 @@ export default { return state.multiple; }, nameSorted() { - return state.req.sorting.by === "name"; + return state.user.sorting.by === "name"; }, sizeSorted() { - return state.req.sorting.by === "size"; + return state.user.sorting.by === "size"; }, modifiedSorted() { - return state.req.sorting.by === "modified"; + return state.user.sorting.by === "modified"; }, ascOrdered() { - return state.req.sorting.asc; + return state.user.sorting.asc; }, items() { return getters.reqItems(); @@ -443,7 +443,7 @@ export default { return; } if (noModifierKeys && getters.currentPromptName() != null) { - return + return; } // Handle the space bar key if (key === " ") { diff --git a/roadmap.md b/roadmap.md deleted file mode 100644 index 32c2bd17..00000000 --- a/roadmap.md +++ /dev/null @@ -1,27 +0,0 @@ -# Planned Roadmap - -next 0.2.x release: - -- Theme configuration from settings -- File syncronization improvements -- right-click context menu - -initial 0.3.0 release : - -- database changes -- introduce jobs as replacement to runners. -- Add Job status to the sidebar - - index status. - - Job status from users - - upload status - -Future releases: - - Replace http routes for gorilla/mux with pocketbase - - Allow multiple volumes to show up in the same filebrowser container. https://github.com/filebrowser/filebrowser/issues/2514 - - enable/disable indexing for certain mounts - - Add tools to sidebar - - duplicate file detector. - - bulk rename https://github.com/filebrowser/filebrowser/issues/2473 - - job manager - folder sync, copy, lifecycle operations - - metrics tracker - user access, file access, download count, last login, etc - - support minio s3 and backblaze sources https://github.com/filebrowser/filebrowser/issues/2544