UNPKG

@maap-jupyterlab/dps-jupyter-extension

Version:

A JupyterLab extension for submitting and viewing jobs.

33 lines (32 loc) 1.17 kB
import React from 'react'; import { ReactWidget } from '@jupyterlab/apputils'; import { Provider } from 'react-redux'; import { JobsApp } from '../components/JobsApp'; import { JUPYTER_EXT } from '../constants'; import store from '../redux/store'; import 'regenerator-runtime/runtime'; import { JobSubmissionForm } from '../components/JobSubmissionForm'; export class ViewJobsReactAppWidget extends ReactWidget { constructor(uname, jupyterApp) { super(); this.addClass(JUPYTER_EXT.EXTENSION_CSS_CLASSNAME); this.uname = uname; this.jupyterApp = jupyterApp; } render() { return (React.createElement(Provider, { store: store }, React.createElement(JobsApp, { uname: this.uname, jupyterApp: this.jupyterApp }))); } } export class SubmitJobsReactAppWidget extends ReactWidget { constructor(data, uname) { super(); this.addClass(JUPYTER_EXT.EXTENSION_CSS_CLASSNAME); this.data = data; this.uname = uname; } render() { return (React.createElement(Provider, { store: store }, React.createElement(JobSubmissionForm, { uname: this.uname }))); } }