Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions reana-ui/src/components/WorkflowBadges.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
*/

import styles from "./WorkflowBadges.module.scss";
import PropTypes from "prop-types";
import { Label } from "semantic-ui-react";
import { JupyterNotebookIcon } from "~/components";
import { INTERACTIVE_SESSION_URL } from "~/client";
import { LauncherLabel } from "~/components";
import { getReanaToken } from "~/selectors";
import { useSelector } from "react-redux";

export default function WorkflowBadges({ workflow }) {
export default function WorkflowBadges({ workflow, badgeSize = "tiny" }) {
const reanaToken = useSelector(getReanaToken);
const {
size,
Expand All @@ -32,23 +33,23 @@ export default function WorkflowBadges({ workflow }) {
{workflow.duration && (
<Label
basic
size="tiny"
size={badgeSize}
content={`CPU ${workflow.duration}`}
icon="clock"
/>
)}
{hasDiskUsage && (
<Label
basic
size="tiny"
size={badgeSize}
content={`Disk ${size.human_readable}`}
icon="hdd"
/>
)}
<LauncherLabel url={launcherURL} />
{isSessionOpen && (
<Label
size="tiny"
size={badgeSize}
content={"Notebook"}
icon={
<i className="icon">
Expand All @@ -64,3 +65,8 @@ export default function WorkflowBadges({ workflow }) {
</div>
);
}

WorkflowBadges.propTypes = {
workflow: PropTypes.object.isRequired,
badgeSize: PropTypes.string,
};
6 changes: 5 additions & 1 deletion reana-ui/src/pages/workflowDetails/WorkflowDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ export default function WorkflowDetails() {
</div>
</div>
<div className={styles.badges}>
<WorkflowBadges className={styles.badges} workflow={workflow} />
<WorkflowBadges
className={styles.badges}
workflow={workflow}
badgeSize="medium"
/>
</div>
<Tab
menu={{ secondary: true, pointing: true }}
Expand Down
12 changes: 4 additions & 8 deletions reana-ui/src/pages/workflowDetails/components/WorkflowLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ function JobLogs({ logs }) {

const steps = Object.entries(logs).map(([id, log]) => ({
key: id,
text: log.job_name || log.backend_job_id,
text:
(log.job_name || log.backend_job_id) +
(log.duration !== null ? ` (${log.duration})` : ``),
icon: {
name: "dot circle outline",
size: "small",
Expand Down Expand Up @@ -100,14 +102,8 @@ function JobLogs({ logs }) {
</div>
{log && (
<div className={styles["step-tags"]}>
<Label color={statusMapping[log.status].color}>
<Label basic color={statusMapping[log.status].color}>
{log.status}
{log.duration && (
<span className={styles["step-duration"]}>
{" "}
{statusMapping[log.status].preposition} {log.duration}
</span>
)}
</Label>
<Label>
<Icon name="cloud" />
Expand Down