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
c972c44c
Commit
c972c44c
authored
3 years ago
by
stvoutsin
Browse files
Options
Downloads
Patches
Plain Diff
Added Loading message to Workflows search page / Move code from IDAContext to service
parent
df55c956
No related branches found
No related tags found
1 merge request
!80
Added Loading message to Workflows search page / Move code from IDAContext to service
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/services/Interactive.js
+46
-2
46 additions, 2 deletions
src/components/services/Interactive.js
src/contexts/IDAContext.js
+0
-21
0 additions, 21 deletions
src/contexts/IDAContext.js
with
46 additions
and
23 deletions
src/components/services/Interactive.js
+
46
−
2
View file @
c972c44c
import
React
,
{
useContext
}
from
"
react
"
;
import
React
,
{
createContext
,
useState
,
useEffect
,
useContext
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
{
Button
,
Form
,
Container
,
Alert
}
from
"
react-bootstrap
"
;
import
{
Button
,
Form
,
Container
,
Alert
}
from
"
react-bootstrap
"
;
import
{
IDAContext
}
from
"
../../contexts/IDAContext
"
;
import
{
IDAContext
}
from
"
../../contexts/IDAContext
"
;
import
{
GlobalContext
}
from
"
../../contexts/GlobalContext
"
;
import
{
GlobalContext
}
from
"
../../contexts/GlobalContext
"
;
import
"
../../assets/Interactive.css
"
;
import
"
../../assets/Interactive.css
"
;
import
LoadingSpinner
from
"
../LoadingSpinner
"
;
export
default
function
Interactive
()
{
export
default
function
Interactive
()
{
...
@@ -15,6 +17,32 @@ export default function Interactive() {
...
@@ -15,6 +17,32 @@ export default function Interactive() {
const
[
showMoreButton
,
setShowMoreButton
]
=
React
.
useState
(
true
);
const
[
showMoreButton
,
setShowMoreButton
]
=
React
.
useState
(
true
);
const
[
showDeploy
,
setShowDeploy
]
=
React
.
useState
(
false
);
const
[
showDeploy
,
setShowDeploy
]
=
React
.
useState
(
false
);
const
[
numberOfitemsShown
,
setNumberOfitemsShown
]
=
React
.
useState
(
3
)
const
[
numberOfitemsShown
,
setNumberOfitemsShown
]
=
React
.
useState
(
3
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
true
);
// Fetch Notebooks
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
ida/workflows/search
"
)
.
then
((
response
)
=>
{
console
.
log
(
response
);
setList_of_workflows
(
response
.
data
.
results
);
setWorkflowURL
(
response
.
data
.
results
[
0
].
url
);
setLoading
(
false
);
});
},
[
api_host
]);
// Fetch JHubs
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
ida/facilities/search
"
)
.
then
((
response
)
=>
{
setList_of_idaSystems
(
response
.
data
.
results
);
setIdaSystemURL
(
response
.
data
.
results
[
0
].
url
);
});
},
[
api_host
]);
let
list_of_batchsystems
=
[
let
list_of_batchsystems
=
[
...
@@ -22,8 +50,24 @@ export default function Interactive() {
...
@@ -22,8 +50,24 @@ export default function Interactive() {
{
"
name
"
:
"
CTA DIRAC
"
,
"
url
"
:
"
https://ccdcta-web.in2p3.fr/DIRAC/
"
},
{
"
name
"
:
"
CTA DIRAC
"
,
"
url
"
:
"
https://ccdcta-web.in2p3.fr/DIRAC/
"
},
]
]
if
(
loading
)
{
return
(
<
Container
className
=
"
ida
"
fluid
>
<
h1
>
Interactive
Analysis
<
/h1
>
{
!
showFacilities
?
<
div
class
=
"
workflow-div
"
>
<
h2
>
Workflows
<
/h2
>
<
/div
>
:
null
}
<
LoadingSpinner
/>
<
/Container
>
)
}
if
((
!
list_of_workflows
)
||
(
!
list_of_idaSystems
)
||
(
!
list_of_batchsystems
))
{
if
((
!
list_of_workflows
)
||
(
!
list_of_idaSystems
)
||
(
!
list_of_batchsystems
))
{
return
null
return
null
;
}
}
const
handleChange
=
event
=>
{
const
handleChange
=
event
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/contexts/IDAContext.js
+
0
−
21
View file @
c972c44c
...
@@ -13,27 +13,6 @@ export function IDAContextProvider({ children }) {
...
@@ -13,27 +13,6 @@ export function IDAContextProvider({ children }) {
const
[
list_of_workflows
,
setList_of_workflows
]
=
useState
();
const
[
list_of_workflows
,
setList_of_workflows
]
=
useState
();
const
[
list_of_idaSystems
,
setList_of_idaSystems
]
=
useState
();
const
[
list_of_idaSystems
,
setList_of_idaSystems
]
=
useState
();
// Fetch Notebooks
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
ida/workflows/search
"
)
.
then
((
response
)
=>
{
setList_of_workflows
(
response
.
data
.
results
);
setWorkflowURL
(
response
.
data
.
results
[
0
].
url
);
});
},
[
api_host
]);
// Fetch JHubs
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
ida/facilities/search
"
)
.
then
((
response
)
=>
{
setList_of_idaSystems
(
response
.
data
.
results
);
setIdaSystemURL
(
response
.
data
.
results
[
0
].
url
);
});
},
[
api_host
]);
return
(
return
(
<
IDAContext
.
Provider
<
IDAContext
.
Provider
...
...
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