diff --git a/reana-ui/src/client.js b/reana-ui/src/client.js index b9a20e2..9093f7e 100644 --- a/reana-ui/src/client.js +++ b/reana-ui/src/client.js @@ -56,6 +56,8 @@ export const INTERACTIVE_SESSIONS_CLOSE_URL = (id) => `${api}/api/workflows/${id}/close/`; export const INTERACTIVE_SESSION_URL = (sessionUri, reanaToken) => `${api}${sessionUri}?token=${reanaToken}`; +export const DASK_DASHBOARD_URL = (workflow_id) => + `${api}/${workflow_id}/dashboard/status`; export const LAUNCH_ON_REANA_URL = `${api}/api/launch`; class Client { diff --git a/reana-ui/src/components/DaskIcon.js b/reana-ui/src/components/DaskIcon.js new file mode 100644 index 0000000..2ae5eb6 --- /dev/null +++ b/reana-ui/src/components/DaskIcon.js @@ -0,0 +1,61 @@ +/* + -*- coding: utf-8 -*- + + This file is part of REANA. + Copyright (C) 2024 CERN. + + REANA is free software; you can redistribute it and/or modify it + under the terms of the MIT License; see LICENSE file for more details. +*/ +import PropTypes from "prop-types"; + +import styles from "./DaskIcon.module.scss"; + +const DaskIcon = ({ size, className }) => { + // Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) + return ( + + ); +}; + +DaskIcon.defaultProps = { + size: 22, + className: "", +}; + +DaskIcon.propTypes = { + size: PropTypes.number, + className: PropTypes.string, +}; + +export default DaskIcon; diff --git a/reana-ui/src/components/DaskIcon.module.scss b/reana-ui/src/components/DaskIcon.module.scss new file mode 100644 index 0000000..ef56dc6 --- /dev/null +++ b/reana-ui/src/components/DaskIcon.module.scss @@ -0,0 +1,16 @@ +/* + -*- coding: utf-8 -*- + + This file is part of REANA. + Copyright (C) 2024 CERN. + + REANA is free software; you can redistribute it and/or modify it + under the terms of the MIT License; see LICENSE file for more details. +*/ + +@import "@palette"; + +.icon { + display: inline-block; + vertical-align: middle; +} diff --git a/reana-ui/src/components/WorkflowBadges.js b/reana-ui/src/components/WorkflowBadges.js index 06ec072..01bf76c 100644 --- a/reana-ui/src/components/WorkflowBadges.js +++ b/reana-ui/src/components/WorkflowBadges.js @@ -10,8 +10,8 @@ import styles from "./WorkflowBadges.module.scss"; import { Label, Popup } from "semantic-ui-react"; -import { JupyterNotebookIcon } from "~/components"; -import { INTERACTIVE_SESSION_URL } from "~/client"; +import { JupyterNotebookIcon, DaskIcon } from "~/components"; +import { INTERACTIVE_SESSION_URL, DASK_DASHBOARD_URL } from "~/client"; import { LauncherLabel } from "~/components"; import { getReanaToken, getUserEmail } from "~/selectors"; import { useSelector } from "react-redux"; @@ -22,11 +22,14 @@ export default function WorkflowBadges({ workflow }) { const { size, launcherURL, + services: services, session_uri: sessionUri, session_status: sessionStatus, } = workflow; const hasDiskUsage = size.raw > 0; const isSessionOpen = sessionStatus === "Running"; + const isDaskClusterUp = + services.length > 0 && services[0].status === "running"; return (