File tree 3 files changed +19
-13
lines changed
3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 9
9
*/
10
10
11
11
import styles from "./WorkflowBadges.module.scss" ;
12
+ import PropTypes from "prop-types" ;
12
13
import { Label } from "semantic-ui-react" ;
13
14
import { JupyterNotebookIcon } from "~/components" ;
14
15
import { INTERACTIVE_SESSION_URL } from "~/client" ;
15
16
import { LauncherLabel } from "~/components" ;
16
17
import { getReanaToken } from "~/selectors" ;
17
18
import { useSelector } from "react-redux" ;
18
19
19
- export default function WorkflowBadges ( { workflow } ) {
20
+ export default function WorkflowBadges ( { workflow, badgeSize = "tiny" } ) {
20
21
const reanaToken = useSelector ( getReanaToken ) ;
21
22
const {
22
23
size,
@@ -32,23 +33,23 @@ export default function WorkflowBadges({ workflow }) {
32
33
{ workflow . duration && (
33
34
< Label
34
35
basic
35
- size = "tiny"
36
+ size = { badgeSize }
36
37
content = { `CPU ${ workflow . duration } ` }
37
38
icon = "clock"
38
39
/>
39
40
) }
40
41
{ hasDiskUsage && (
41
42
< Label
42
43
basic
43
- size = "tiny"
44
+ size = { badgeSize }
44
45
content = { `Disk ${ size . human_readable } ` }
45
46
icon = "hdd"
46
47
/>
47
48
) }
48
49
< LauncherLabel url = { launcherURL } />
49
50
{ isSessionOpen && (
50
51
< Label
51
- size = "tiny"
52
+ size = { badgeSize }
52
53
content = { "Notebook" }
53
54
icon = {
54
55
< i className = "icon" >
@@ -64,3 +65,8 @@ export default function WorkflowBadges({ workflow }) {
64
65
</ div >
65
66
) ;
66
67
}
68
+
69
+ WorkflowBadges . propTypes = {
70
+ workflow : PropTypes . object . isRequired ,
71
+ badgeSize : PropTypes . string ,
72
+ } ;
Original file line number Diff line number Diff line change @@ -160,7 +160,11 @@ export default function WorkflowDetails() {
160
160
</ div >
161
161
</ div >
162
162
< div className = { styles . badges } >
163
- < WorkflowBadges className = { styles . badges } workflow = { workflow } />
163
+ < WorkflowBadges
164
+ className = { styles . badges }
165
+ workflow = { workflow }
166
+ badgeSize = "medium"
167
+ />
164
168
</ div >
165
169
< Tab
166
170
menu = { { secondary : true , pointing : true } }
Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ function JobLogs({ logs }) {
71
71
72
72
const steps = Object . entries ( logs ) . map ( ( [ id , log ] ) => ( {
73
73
key : id ,
74
- text : log . job_name || log . backend_job_id ,
74
+ text :
75
+ ( log . job_name || log . backend_job_id ) +
76
+ ( log . duration !== null ? ` (${ log . duration } )` : `` ) ,
75
77
icon : {
76
78
name : "dot circle outline" ,
77
79
size : "small" ,
@@ -100,14 +102,8 @@ function JobLogs({ logs }) {
100
102
</ div >
101
103
{ log && (
102
104
< div className = { styles [ "step-tags" ] } >
103
- < Label color = { statusMapping [ log . status ] . color } >
105
+ < Label basic color = { statusMapping [ log . status ] . color } >
104
106
{ log . status }
105
- { log . duration && (
106
- < span className = { styles [ "step-duration" ] } >
107
- { " " }
108
- { statusMapping [ log . status ] . preposition } { log . duration }
109
- </ span >
110
- ) }
111
107
</ Label >
112
108
< Label >
113
109
< Icon name = "cloud" />
You can’t perform that action at this time.
0 commit comments