[Draft] feat: browser-side zip grouping for uploads (AI-generated, unreviewed) - #415
Draft
i0rt wants to merge 2 commits into
Draft
[Draft] feat: browser-side zip grouping for uploads (AI-generated, unreviewed)#415i0rt wants to merge 2 commits into
i0rt wants to merge 2 commits into
Conversation
Compress multiple files into a single zip archive in the browser (via JSZip) before upload. Preserves folder structure and shows compression progress and resulting size. Enabled by default; disabled for end-to-end-encrypted uploads. Naming: single-folder uploads use the folder name plus a timestamp; otherwise an editable template with strftime-style date tokens is used, falling back to GOKAPI_DEFAULT_ZIP_NAME when the field is left empty. A single loose file is never zipped and uploads as-is. Add GOKAPI_DEFAULT_ZIP_NAME env var (default gokapi-upload-%Y%m%d-%H%M%S).
Regenerate minified admin JS and main CSS bundles with the pinned minifier (tdewolff/minify v2.24.11) and update the auto-generated environment-variable docs to include GOKAPI_DEFAULT_ZIP_NAME.
Author
|
This is related to #106 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Compress multiple files into a single zip archive in the browser (via JSZip) before upload. Preserves folder structure and shows compression progress and resulting size. Enabled by default; disabled for end-to-end-encrypted uploads.
Naming: single-folder uploads use the folder name plus a timestamp; otherwise an editable template with strftime-style date tokens is used, falling back to GOKAPI_DEFAULT_ZIP_NAME when the field is left empty. A single loose file is never zipped and uploads as-is.
Add GOKAPI_DEFAULT_ZIP_NAME env var (default gokapi-upload-%Y%m%d-%H%M%S).
Implementation notes: adds a new
admin_ui_zip.jsthat intercepts files as they are added to the dropzone, buffers a batch, compresses it with JSZip, and hands the resulting archive back as a single regular upload. Vendorsjszip.min.js(v3.10.1, MIT/GPLv3). Adds a "Zip Archive" option card with an enable toggle and an editable name-template field to the admin upload UI. On the Go side, adds theDefaultZipNameenvironment setting and passes it to the admin view so the browser can use it as the default naming template. Regenerates the minifiedadmin.min.*.jsandgokapi.min.*.cssbundles.Type of Change
Technical Details
admin_ui_zip.js), the template/CSS changes, and the Go environment-variable plumbing (GOKAPI_DEFAULT_ZIP_NAME). The code has not been human-reviewed.How Has This Been Tested?
GOKAPI_DEFAULT_ZIP_NAMEdefault, compression progress and resulting-size display, and that the option is disabled for end-to-end-encrypted uploads. Also verified Upload, Delete, and Download still work.go test ./...Checklist
docs/advanced.rstwas updated — viago generate, to add theGOKAPI_DEFAULT_ZIP_NAMEentry.)