Skip to content
Snippets Groups Projects
Commit 38925c84 authored by stvoutsin's avatar stvoutsin
Browse files

Change to use api_host & fixed default workflow select location

parent f8ba0366
No related branches found
No related tags found
2 merge requests!32Master,!31Change to use api_host & fixed default workflow select location
Pipeline #14862 passed
import React, { useContext } from "react";
import { Button, Form, Container, Alert } from "react-bootstrap";
import { IDAContext } from "../contexts/IDAContext";
import { GlobalContext } from "../contexts/GlobalContext";
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);
const { api_host } = useContext(GlobalContext);
let list_of_batchsystems = [
{"name" : "DIRAC EGI (LOFAR, KM3Net)", "url" : "https://dirac.egi.eu"},
......@@ -21,13 +24,12 @@ export default function Interactive() {
(event) => setJnotebookURL(list_of_jnotebooks.find((item) => item.name === event.target.value).url)
}>
<Form.Label>
<h3>Run ESCAPE ESFRI Jupyter Notebooks</h3>
<h3>Select ESCAPE ESFRI Jupyter Workflows (Notebooks)</h3>
</Form.Label>
<Form.Control className="mt-1" as="select">
{list_of_jnotebooks.map((option) => <option>{option.name}</option>)}
</Form.Control>
</Form.Group>
<Button href={jnotebookURL} target="_blank">Run selected notebook</Button>
</Form>
<Form className="mt-5">
<Form.Group controlId="jhub" onChange={
......@@ -40,21 +42,10 @@ export default function Interactive() {
{list_of_jhubs.map((option) => <option>{option.name}</option>)}
</Form.Control>
</Form.Group>
<Button href={jhubURL} target="_blank">Launch JupyterHub</Button>
</Form>
<Form className="mt-5">
<Form.Group controlId="batchsystems" onChange={
(event) => setBatchsystemsURL(list_of_batchsystems.find((item) => item.name === event.target.value).url)
}>
<Form.Label>
<h3>Select HPC/HTC Services</h3>
</Form.Label>
<Form.Control className="mt-1" as="select">
{list_of_batchsystems.map((option) => <option>{option.name}</option>)}
</Form.Control>
</Form.Group>
<Button href={batchsystemsURL} target="_blank">Start HPC/HTC service</Button>
</Form>
<Button href={api_host + "ida/deploy?facility=" + jhubURL + "&workflow=" + jnotebookURL} target="_blank">Deploy</Button>
</Container>
);
}
import React, { createContext, useState, useEffect } from "react";
import React, { createContext, useState, useEffect, useContext } from "react";
import { Alert } from "react-bootstrap";
import axios from "axios";
import getCookie from "../utils/getCookie";
import { GlobalContext } from "./GlobalContext";
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 { api_host } = useContext(GlobalContext);
const [jhubURL, setJhubURL] = useState("https://srcdev.skatelescope.org/escape");
const [jnotebookURL, setJnotebookURL] = useState("https://mybinder.org/v2/gh/AMIGA-IAA/hcg-16/master");
const [jnotebookURL, setJnotebookURL] = useState("https://github.com/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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment