You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am now working on a dashboard app with Stipple.jl. I start my project by modifying the IrisCluster demo step by step. I am now struggling on the data uploading features.
I defined a model containing :data attributes like this
@reactivemutable struct MyModel <:ReactiveModel
data::R{DataFrame}=DataFrame("x"=> [0.0, 1000.0], "y"=> [0.0, 1000.0])
endroute("/") do
MyModel |> init |> ui |> html
end
then I want to modify the :data field of above created model with the uploaded file, just like this
route("/upload_data", method=POST) do
files = Genie.Requests.filespayload()
data = XLSX.readtable(files[1][2])
# modify mymodel.data with dataend
I have two ways achieving this goal
defining a global variable mymodel and initialize it at the global view, so that "/" and "/upload_data" just modify the same model
in the "/upload_data" method, write the data to a temp file in on the server side, then create a btn in the main page to modify the model :data with the temp file.
These two methods are both unsafe for the multi-user case. Is there any better way to accomplish similar task?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am now working on a dashboard app with Stipple.jl. I start my project by modifying the IrisCluster demo step by step. I am now struggling on the data uploading features.
I defined a model containing :data attributes like this
then I want to modify the :data field of above created model with the uploaded file, just like this
I have two ways achieving this goal
These two methods are both unsafe for the multi-user case. Is there any better way to accomplish similar task?
Beta Was this translation helpful? Give feedback.
All reactions