-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes and improvements in file uploader component
- Loading branch information
1 parent
17ff66f
commit cfdb360
Showing
4 changed files
with
134 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "StippleUI" | ||
uuid = "a3c5d34a-b254-4859-a8fa-b86abb7e84a3" | ||
authors = ["Adrian Salceanu <[email protected]>"] | ||
version = "0.23.4" | ||
version = "0.23.5" | ||
|
||
[deps] | ||
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module App | ||
|
||
using GenieFramework | ||
@genietools | ||
|
||
const UPLOADS_FOLDER = "public/uploads" | ||
Genie.Watch.unwatch(UPLOADS_FOLDER) | ||
|
||
@app begin | ||
@event rejected begin | ||
@info "rejected" | ||
@notify("File rejected") | ||
end | ||
|
||
@event uploaded begin | ||
@info "File uploaded" | ||
end | ||
|
||
@event finished begin | ||
@info "Upload finished" | ||
end | ||
|
||
@event failed begin | ||
@info "Upload failed" | ||
@notify("File upload failed. Please try again.") | ||
end | ||
|
||
@onchange fileuploads begin | ||
uploaded_file = UploadedFile(fileuploads) | ||
try | ||
cp(uploaded_file, UPLOADS_FOLDER; force = true) | ||
catch e | ||
@error "Error processing file: $e" | ||
@notify("Error processing file: $(uploaded_file.name)") | ||
# rethrow(e) | ||
end | ||
end | ||
end | ||
|
||
@page("/", "app.jl.html") | ||
|
||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<q-uploader label="Upload files" hide-upload-btn="" auto-upload="" | ||
v-on:failed="function(event) { handle_event(event, 'failed') }" | ||
v-on:uploaded="function(event) { handle_event(event, 'uploaded') }" no-thumbnails="" | ||
v-on:finish="function(event) { handle_event(event, 'finished') }" :url="'/____/upload/' + channel_" | ||
v-on:rejected="function(event) { handle_event(event, 'rejected') }" max-files="10" multiple="" accept="*/*" | ||
:max-file-size="10 * 1024 * 1024" id="i6xi"></q-uploader> |
This file contains 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
cfdb360
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
cfdb360
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/117415
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: