Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
6549732e
Commit
6549732e
authored
Jul 30, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[frameCalc upload] add missing FrameCalcUpload.hs file
parent
f33d2dd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
FrameCalcUpload.hs
src/Gargantext/API/Node/FrameCalcUpload.hs
+71
-0
No files found.
src/Gargantext/API/Node/FrameCalcUpload.hs
0 → 100644
View file @
6549732e
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE TypeOperators #-}
module
Gargantext.API.Node.FrameCalcUpload
where
import
Control.Lens
((
^.
))
import
Data.Aeson
import
Data.Swagger
import
GHC.Generics
(
Generic
)
import
Servant
import
Servant.Job.Async
import
Web.FormUrlEncoded
(
FromForm
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Prelude
import
Gargantext.Database.Action.Flow.Types
import
Gargantext.Database.Admin.Types.Hyperdata.Frame
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
data
FrameCalcUpload
=
FrameCalcUpload
()
deriving
(
Generic
)
instance
FromForm
FrameCalcUpload
instance
FromJSON
FrameCalcUpload
instance
ToJSON
FrameCalcUpload
instance
ToSchema
FrameCalcUpload
type
FrameCalcUploadAPI
=
Summary
" FrameCalc upload"
:>
"add"
:>
"framecalc"
:>
"async"
:>
AsyncJobs
JobLog
'[
J
SON
]
FrameCalcUpload
JobLog
frameCalcUploadAPI
::
UserId
->
NodeId
->
GargServer
FrameCalcUploadAPI
frameCalcUploadAPI
uId
nId
=
serveJobsAPI
$
JobFunction
(
\
p
logs
->
frameCalcUploadAsync
uId
nId
p
(
liftBase
.
logs
))
frameCalcUploadAsync
::
FlowCmdM
env
err
m
=>
UserId
->
NodeId
->
FrameCalcUpload
->
(
JobLog
->
m
()
)
->
m
JobLog
frameCalcUploadAsync
uId
nId
_f
logStatus
=
do
logStatus
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
}
printDebug
"[frameCalcUploadAsync] uId"
uId
printDebug
"[frameCalcUploadAsync] nId"
nId
node
<-
getNodeWith
nId
(
Proxy
::
Proxy
HyperdataFrame
)
let
(
HyperdataFrame
{
_hf_base
=
base
,
_hf_frame_id
=
frame_id
})
=
node
^.
node_hyperdata
let
csvUrl
=
base
<>
"/"
<>
frame_id
<>
".csv"
printDebug
"[frameCalcUploadAsync] csvUrl"
csvUrl
pure
JobLog
{
_scst_succeeded
=
Just
1
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
0
,
_scst_events
=
Just
[]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment