Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ESAP GUI
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
ESCAPE WP5
ESAP GUI
Commits
ba016b72
Commit
ba016b72
authored
3 years ago
by
stvoutsin
Browse files
Options
Downloads
Patches
Plain Diff
Modify IDA UI to read notebooks/jhubs from REST API
parent
221390b0
No related branches found
No related tags found
2 merge requests
!17
Master
,
!16
Modify IDA UI to read notebooks/jhubs from REST API
Pipeline
#13744
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Interactive.js
+3
-15
3 additions, 15 deletions
src/components/Interactive.js
src/contexts/IDAContext.js
+41
-3
41 additions, 3 deletions
src/contexts/IDAContext.js
with
44 additions
and
18 deletions
src/components/Interactive.js
+
3
−
15
View file @
ba016b72
...
...
@@ -2,26 +2,14 @@ import React, { useContext } from "react";
import
{
Button
,
Form
,
Container
,
Alert
}
from
"
react-bootstrap
"
;
import
{
IDAContext
}
from
"
../contexts/IDAContext
"
;
export
default
function
Interactive
()
{
const
{
jhubURL
,
setJhubURL
,
jnotebookURL
,
setJnotebookURL
,
batchsystemsURL
,
setBatchsystemsURL
}
=
useContext
(
IDAContext
);
let
list_of_jnotebooks
=
[
{
"
name
"
:
"
CSIC-IAA HCG-16 workflow
"
,
"
url
"
:
"
https://mybinder.org/v2/gh/AMIGA-IAA/hcg-16/master
"
},
{
"
name
"
:
"
CDS MOCPy
"
,
"
url
"
:
"
https://mybinder.org/v2/gh/cds-astro/mocpy/master
"
},
{
"
name
"
:
"
JIVE Jupyter CASA
"
,
"
url
"
:
"
https://mybinder.org/v2/gh/aardk/jupyter-casa/master
"
},
{
"
name
"
:
"
ASTRON VO Apertif
"
,
"
url
"
:
"
https://mybinder.org/v2/gh/zhengmeyer/first-binder.git/master
"
},]
let
list_of_jhubs
=
[
{
"
name
"
:
"
SKAO JupyterHub
"
,
"
url
"
:
"
https://srcdev.skatelescope.org/escape
"
},
{
"
name
"
:
"
ASTRON JupyterHub
"
,
"
url
"
:
"
https://sdc.astron.nl/hub/
"
},
{
"
name
"
:
"
IFAE-PIC JupyterHub
"
,
"
url
"
:
"
https://jupyter.pic.es
"
},
{
"
name
"
:
"
CERN SWAN Service
"
,
"
url
"
:
"
https://swan.cern.ch/
"
}]
export
default
function
Interactive
()
{
const
{
jhubURL
,
setJhubURL
,
jnotebookURL
,
setJnotebookURL
,
batchsystemsURL
,
setBatchsystemsURL
,
list_of_jnotebooks
,
setList_of_jnotebooks
,
list_of_jhubs
,
setList_of_jhubs
}
=
useContext
(
IDAContext
);
let
list_of_batchsystems
=
[
{
"
name
"
:
"
DIRAC EGI (LOFAR, KM3Net)
"
,
"
url
"
:
"
https://dirac.egi.eu
"
},
{
"
name
"
:
"
CTA DIRAC
"
,
"
url
"
:
"
https://ccdcta-web.in2p3.fr/DIRAC/
"
},
]
return
(
<
Container
fluid
>
<
Form
className
=
"
mt-5
"
>
...
...
This diff is collapsed.
Click to expand it.
src/contexts/IDAContext.js
+
41
−
3
View file @
ba016b72
import
React
,
{
useState
,
createContext
}
from
'
react
'
;
import
React
,
{
createContext
,
useState
,
useEffect
}
from
"
react
"
;
import
{
Alert
}
from
"
react-bootstrap
"
;
import
axios
from
"
axios
"
;
import
getCookie
from
"
../utils/getCookie
"
;
export
const
IDAContext
=
createContext
();
export
function
IDAContextProvider
({
children
})
{
const
api_host
=
process
.
env
.
NODE_ENV
===
"
development
"
?
"
http://localhost:5555/esap-api/
"
:
"
https://sdc-dev.astron.nl:5555/esap-api/
"
;
const
[
jhubURL
,
setJhubURL
]
=
useState
(
"
https://srcdev.skatelescope.org/escape
"
);
const
[
jnotebookURL
,
setJnotebookURL
]
=
useState
(
"
https://mybinder.org/v2/gh/AMIGA-IAA/hcg-16/master
"
);
const
[
batchsystemsURL
,
setBatchsystemsURL
]
=
useState
(
"
https://dirac.egi.eu
"
);
const
[
list_of_jnotebooks
,
setList_of_jnotebooks
]
=
useState
();
const
[
list_of_jhubs
,
setList_of_jhubs
]
=
useState
();
// Fetch Notebooks
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
ida/workflows/search
"
)
.
then
((
response
)
=>
{
setList_of_jnotebooks
(
response
.
data
.
results
);
});
},
[
api_host
]);
// Fetch JHubs
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
ida/facilities/search
"
)
.
then
((
response
)
=>
{
setList_of_jhubs
(
response
.
data
.
results
);
});
},
[
api_host
]);
return
(
<
IDAContext
.
Provider
value
=
{{
...
...
@@ -12,11 +46,15 @@ export function IDAContextProvider({ children }) {
setJhubURL
,
jnotebookURL
,
setJnotebookURL
,
batchsystemsURL
,
batchsystemsURL
,
setBatchsystemsURL
,
list_of_jnotebooks
,
setList_of_jnotebooks
,
list_of_jhubs
,
setList_of_jhubs
}}
>
{
children
}
<
/IDAContext.Provider
>
)
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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