/** * Copyright (c) OpenSpug Organization. https://github.com/openspug/spug * Copyright (c) * Released under the MIT License. */ import React from 'react'; import { Modal, Form, Tabs, Spin } from 'antd'; import { StatisticsCard } from 'components'; import http from 'libs/http'; import store from './store'; import moment from 'moment'; class ComForm extends React.Component { constructor(props) { super(props); this.state = { loading: true, info: {} } } componentDidMount() { http.get(`/api/schedule/${store.record.id}/?id=${store.record.h_id}`) .then(info => this.setState({info})) .finally(() => this.setState({loading: false})) } render() { const {run_time, success, failure, duration, outputs} = this.state.info; const preStyle = { marginTop: 5, backgroundColor: '#eee', borderRadius: 5, padding: 10, maxHeight: 215, }; return ( store.infoVisible = false} footer={null}> {success}}/> {failure}}/> {duration}}/> {outputs && ( {outputs.map((item, index) => ( {item.name}}>
执行时间: {run_time}({moment(run_time).fromNow()})
运行耗时: {item.duration} s
返回状态: {item.code}(非 0 则判定为失败)
执行输出:
{item.output}
))}
)}
) } } export default Form.create()(ComForm)