Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LarvaTagger.jl
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyx
LarvaTagger.jl
Commits
6e01a966
Commit
6e01a966
authored
1 month ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
feat: file uploads
parent
332f599a
No related branches found
No related tags found
1 merge request
!23
Set of commits to be tagged 0.19.1
Pipeline
#148472
passed with stage
in 22 minutes and 34 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/editor.jl
+7
-1
7 additions, 1 deletion
src/editor.jl
src/files.jl
+4
-2
4 additions, 2 deletions
src/files.jl
src/plots.jl
+2
-1
2 additions, 1 deletion
src/plots.jl
src/wgl.jl
+3
-2
3 additions, 2 deletions
src/wgl.jl
with
16 additions
and
6 deletions
src/editor.jl
+
7
−
1
View file @
6e01a966
...
...
@@ -35,6 +35,8 @@ function larvaeditor(path=nothing;
backend_directory
::
AbstractString
=
projectdir
,
manualtag
::
Union
{
Nothing
,
String
,
Symbol
}
=
"edited"
,
title
=
"LarvaTagger"
,
root_directory
=
nothing
,
enable_uploads
=
false
,
kwargs
...
)
# to (re-)load a file, the app is reloaded with the filepath as sole information
...
...
@@ -47,6 +49,10 @@ function larvaeditor(path=nothing;
# used for method dispatch (here `Session` is taken to represent Bonito)
controller
[
:
frontend
]
=
Session
if
!
isnothing
(
root_directory
)
controller
[
:
workingdirectory
]
=
workingdir
(
controller
,
root_directory
)
end
tryopenfile
(
controller
,
input
)
editor
=
EditorView
(
larvaviewer
(
controller
;
...
...
@@ -56,7 +62,7 @@ function larvaeditor(path=nothing;
larvafilter
(
controller
),
tagfilter
(
controller
;
manualtag
=
manualtag
),
metadataeditor
(
controller
),
filemenu
(
controller
),
filemenu
(
controller
;
upload_button
=
enable_uploads
),
backendmenu
(
controller
,
backend_directory
),
loadanimation
(
controller
),
twooptiondialog
(
controller
))
...
...
This diff is collapsed.
Click to expand it.
src/files.jl
+
4
−
2
View file @
6e01a966
...
...
@@ -7,7 +7,9 @@ struct WorkingDirectory
content
::
Observable
{
Vector
{
String
}}
end
WorkingDirectory
(
controller
,
root
::
String
,
path
::
String
=
""
)
=
WorkingDirectory
(
controller
,
root
,
Validator
(
path
),
Observable
(
String
[]))
function
WorkingDirectory
(
controller
,
root
::
String
,
path
::
String
=
""
)
WorkingDirectory
(
controller
,
root
,
Validator
(
path
),
Observable
(
String
[]))
end
function
workingdir
(
controller
,
root
::
String
,
path
::
String
=
""
;
secure
::
Bool
=
true
)
if
secure
...
...
@@ -107,7 +109,7 @@ function tryopenfile(controller, path; reload::Bool=false)
@info
"Cannot load file"
file
=
path
return
elseif
haskey
(
hub
,
:
input
)
hub
[
:
input
][]
=
isabspath
(
path
)
?
relpath
(
path
)
:
path
hub
[
:
input
][]
=
path
end
# tag_lut
fallback_color
=
theme
[
:
LarvaPlot
][
:
fallback_color
]
...
...
This diff is collapsed.
Click to expand it.
src/plots.jl
+
2
−
1
View file @
6e01a966
...
...
@@ -562,7 +562,8 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
@assert
hovering_active
[]
i
=
current_larva
[]
if
i
==
j
@warn
"moving too fast? - please file an issue at https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/issues"
@warn
"Moving too fast?"
return
end
if
0
<
i
i_decorated
=
larvae
[
i
]
.
decorated
...
...
This diff is collapsed.
Click to expand it.
src/wgl.jl
+
3
−
2
View file @
6e01a966
...
...
@@ -902,10 +902,10 @@ struct FileMenu
browser
::
FileBrowser
end
function
filemenu
(
controller
;
kwargs
...
)
function
filemenu
(
controller
;
upload_button
=
false
,
kwargs
...
)
wd
=
getworkingdir
(
controller
)
dir
=
joinpath
(
wd
.
root
,
wd
.
path
[])
browser
=
FileBrowser
(
dir
;
root
=
wd
.
root
,
upload_button
=
false
)
browser
=
FileBrowser
(
dir
;
root
=
wd
.
root
,
upload_button
=
upload_button
)
on
(
FileBrowsers
.
selectedfile
(
browser
))
do
file
tryopenfile
(
controller
,
file
;
reload
=
true
)
end
...
...
@@ -920,6 +920,7 @@ function filemenu(controller; kwargs...)
on
(
FilePickers
.
uploadedfile
(
browser
))
do
fileinfo
filepath
=
joinpath
(
workingdir
[],
fileinfo
[
"name"
])
saveinputfile
(
filepath
,
fileinfo
[
"content"
])
notify
(
workingdir
)
end
end
return
FileMenu
(
gethub
(
controller
),
browser
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment