|
1 |
| -import CircularProgress from "@material-ui/core/CircularProgress" |
2 | 1 | import { makeStyles } from "@material-ui/core/styles"
|
3 | 2 | import dayjs from "dayjs"
|
4 | 3 | import { FC } from "react"
|
@@ -40,33 +39,29 @@ const getStageDurationInSeconds = (logs: ProvisionerJobLog[]) => {
|
40 | 39 |
|
41 | 40 | export interface WorkspaceBuildLogsProps {
|
42 | 41 | logs: ProvisionerJobLog[]
|
43 |
| - isWaitingForLogs: boolean |
44 | 42 | }
|
45 | 43 |
|
46 |
| -export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({ logs, isWaitingForLogs }) => { |
| 44 | +export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({ logs }) => { |
47 | 45 | const groupedLogsByStage = groupLogsByStage(logs)
|
48 | 46 | const stages = Object.keys(groupedLogsByStage)
|
49 | 47 | const styles = useStyles()
|
50 | 48 |
|
51 | 49 | return (
|
52 | 50 | <div className={styles.logs}>
|
53 |
| - {stages.map((stage, stageIndex) => { |
| 51 | + {stages.map((stage) => { |
54 | 52 | const logs = groupedLogsByStage[stage]
|
55 | 53 | const isEmpty = logs.every((log) => log.output === "")
|
56 | 54 | const lines = logs.map((log) => ({
|
57 | 55 | time: log.created_at,
|
58 | 56 | output: log.output,
|
59 | 57 | }))
|
60 | 58 | const duration = getStageDurationInSeconds(logs)
|
61 |
| - const isLastStage = stageIndex === stages.length - 1 |
62 |
| - const shouldDisplaySpinner = isWaitingForLogs && isLastStage |
63 |
| - const shouldDisplayDuration = !isWaitingForLogs && duration |
| 59 | + const shouldDisplayDuration = duration !== undefined |
64 | 60 |
|
65 | 61 | return (
|
66 | 62 | <div key={stage}>
|
67 | 63 | <div className={styles.header}>
|
68 | 64 | <div>{stage}</div>
|
69 |
| - {shouldDisplaySpinner && <CircularProgress size={14} className={styles.spinner} />} |
70 | 65 | {shouldDisplayDuration && (
|
71 | 66 | <div className={styles.duration}>
|
72 | 67 | {duration} {Language.seconds}
|
@@ -109,8 +104,4 @@ const useStyles = makeStyles((theme) => ({
|
109 | 104 | padding: theme.spacing(2),
|
110 | 105 | paddingLeft: theme.spacing(4),
|
111 | 106 | },
|
112 |
| - |
113 |
| - spinner: { |
114 |
| - marginLeft: "auto", |
115 |
| - }, |
116 | 107 | }))
|
0 commit comments