yapi/client/containers/Project/Activity/Activity.js

52 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-08-14 15:17:05 +08:00
import './Activity.scss'
import React, { Component } from 'react'
import TimeTree from './Timeline/Timeline'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { Button } from 'antd'
@connect(
state => {
return {
2017-08-22 16:37:24 +08:00
uid: state.user.uid + '',
curdata: state.inter.curdata,
currProject: state.project.currProject
2017-08-14 15:17:05 +08:00
}
}
)
class Activity extends Component {
constructor(props) {
super(props);
}
static propTypes = {
uid: PropTypes.string,
getMockUrl: PropTypes.func,
2017-08-22 16:37:24 +08:00
match: PropTypes.object,
curdata: PropTypes.object,
currProject: PropTypes.object
2017-08-14 15:17:05 +08:00
}
render () {
2017-08-22 16:37:24 +08:00
let {currProject} = this.props;
2017-08-14 15:17:05 +08:00
return (
2017-08-17 12:14:58 +08:00
<div className="g-row">
<section className="news-box">
2017-08-22 16:37:24 +08:00
<div style={{display: "none"}} className="logHead">
2017-08-17 12:14:58 +08:00
{/*<Breadcrumb />*/}
2017-08-22 16:37:24 +08:00
<div className = "projectDes">
<p>高效易用可部署的API管理平台</p>
</div>
2017-08-17 12:14:58 +08:00
<div className="Mockurl">
<span>Mock地址</span>
2017-08-22 16:37:24 +08:00
<p>{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${currProject._id}${currProject.basepath}/yourPath`}</p>
2017-08-17 12:14:58 +08:00
<Button type="primary"><a href = {`/api/project/download?project_id=${this.props.match.params.id}`}>下载Mock数据</a></Button>
2017-08-14 15:17:05 +08:00
</div>
2017-08-17 12:14:58 +08:00
</div>
<TimeTree typeid = {+this.props.match.params.id} />
</section>
2017-08-14 15:17:05 +08:00
</div>
)
}
}
export default Activity