mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-14 20:15:21 +00:00
Pull in frontend
This commit is contained in:
37
web/src/shared/components/build_time.js
Normal file
37
web/src/shared/components/build_time.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import React, { Component } from "react";
|
||||
import { ScheduleIcon, TimelapseIcon } from "shared/components/icons/index";
|
||||
|
||||
import TimeAgo from "react-timeago";
|
||||
import Duration from "./duration";
|
||||
|
||||
import styles from "./build_time.less";
|
||||
|
||||
export default class Runtime extends Component {
|
||||
render() {
|
||||
const { start, finish } = this.props;
|
||||
return (
|
||||
<div className={styles.host}>
|
||||
<div className={styles.row}>
|
||||
<div>
|
||||
<ScheduleIcon />
|
||||
</div>
|
||||
<div>{start ? <TimeAgo date={start * 1000} /> : <span>--</span>}</div>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<div>
|
||||
<TimelapseIcon />
|
||||
</div>
|
||||
<div>
|
||||
{finish ? (
|
||||
<Duration start={start} finished={finish} />
|
||||
) : start ? (
|
||||
<TimeAgo date={start * 1000} />
|
||||
) : (
|
||||
<span>--</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user