2020-05-20 18:11:32 +08:00
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
import { Spin, Tooltip } from 'antd';
|
|
|
|
|
|
import { Link, Route, Switch, withRouter } from 'react-router-dom';
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
|
|
|
|
|
import '../css/index.css'
|
|
|
|
|
|
import './list.css';
|
|
|
|
|
|
|
|
|
|
|
|
import Loadable from 'react-loadable';
|
|
|
|
|
|
import Loading from '../../Loading';
|
|
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
import img_1 from '../Images/1.png';
|
|
|
|
|
|
import img_2 from '../Images/2.png';
|
|
|
|
|
|
import img_3 from '../Images/3.png';
|
|
|
|
|
|
import img_6 from '../Images/6.png';
|
|
|
|
|
|
import img_7 from '../Images/7.png';
|
|
|
|
|
|
import img_parise from '../Images/parise.png';
|
|
|
|
|
|
import img_focus from '../Images/focus.png';
|
|
|
|
|
|
import img_parised from '../Images/parised.png';
|
|
|
|
|
|
import img_focused from '../Images/focused.png';
|
|
|
|
|
|
import img_fork from '../Images/fork.png';
|
2020-04-09 18:13:26 +08:00
|
|
|
|
import img_milepost from '../Images/milepost.png';
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const FileNew = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Newfile/Index'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
2020-06-04 18:28:26 +08:00
|
|
|
|
const UploadFile = Loadable({
|
|
|
|
|
|
loader: () => import('../Newfile/upload_file'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const Setting = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Settings/Index'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const TagList = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/Tags'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderNew = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/New'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/Detail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderIndex = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/order'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const CoderRootIndex = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('./CoderRootIndex'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderMilepost = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/Milepost'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrdernewMilepost = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/newMilepost'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrderupdateMilepost = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/UpdateMilepost'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrderupdateDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/UpdateDetail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrdercopyDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/CopyDetail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
//合并请求
|
|
|
|
|
|
const MergeIndexDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Merge/merge'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const CreateMerge = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Merge/NewMerge'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const MessageCount = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Merge/MessageCount'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const MilepostDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/MilepostDetail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
2020-05-18 16:46:51 +08:00
|
|
|
|
const WatchUsers = Loadable({
|
|
|
|
|
|
loader: () => import('../UsersList/watch_users'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
|
|
|
|
|
const PraiseUsers = Loadable({
|
|
|
|
|
|
loader: () => import('../UsersList/praise_users'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
|
|
|
|
|
const ForkUsers = Loadable({
|
|
|
|
|
|
loader: () => import('../UsersList/fork_users'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TrendsIndex = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Activity/Activity'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
2020-06-02 18:54:46 +08:00
|
|
|
|
|
2020-03-16 14:12:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外)
|
|
|
|
|
|
*/
|
2020-03-24 15:08:57 +08:00
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
class Detail extends Component {
|
|
|
|
|
|
constructor(props) {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
super(props);
|
2020-05-20 18:11:32 +08:00
|
|
|
|
this.state = {
|
2020-06-04 18:27:19 +08:00
|
|
|
|
isSpin: true,
|
2020-05-20 18:11:32 +08:00
|
|
|
|
projectDetail: undefined,
|
|
|
|
|
|
isManager: false,
|
|
|
|
|
|
isReporter: false,
|
|
|
|
|
|
isDeveloper: false,
|
|
|
|
|
|
project_id: undefined,
|
|
|
|
|
|
watchers_count: undefined,
|
|
|
|
|
|
praises_count: undefined,
|
|
|
|
|
|
forked_count: undefined,
|
|
|
|
|
|
watched: false,
|
|
|
|
|
|
praised: false,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
http_url: undefined,
|
2020-05-20 18:11:32 +08:00
|
|
|
|
author: undefined,
|
|
|
|
|
|
branchs: undefined,
|
|
|
|
|
|
branchList: undefined,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
componentDidMount = () => {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
this.getDetail();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
componentDidUpdate = (prevState) => {
|
|
|
|
|
|
if ((prevState.match.params.projectsId !== this.props.match.params.projectsId)) {
|
2020-03-24 16:51:34 +08:00
|
|
|
|
this.getDetail();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
getDetail = () => {
|
2020-03-20 20:50:30 +08:00
|
|
|
|
const { projectsId } = this.props.match.params;
|
|
|
|
|
|
const url = `/repositories/${projectsId}.json`;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
|
|
if (result) {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
this.setState({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
projectDetail: result.data,
|
|
|
|
|
|
project_id: result.data.project_id,
|
|
|
|
|
|
isManager: result.data.permission && result.data.permission === "Manager",
|
|
|
|
|
|
isReporter: result.data.permission && result.data.permission === "Reporter",
|
|
|
|
|
|
isDeveloper: result.data.permission && result.data.permission === "Developer",
|
2020-03-16 14:12:11 +08:00
|
|
|
|
http_url: result.data.clone_url,
|
2020-05-20 18:11:32 +08:00
|
|
|
|
author: result.data.author,
|
|
|
|
|
|
praised: result.data.praised,
|
|
|
|
|
|
watched: result.data.watched,
|
|
|
|
|
|
watchers_count: result.data.watchers_count,
|
|
|
|
|
|
praises_count: result.data.praises_count,
|
|
|
|
|
|
forked_count: result.data.forked_count,
|
2020-06-03 09:56:07 +08:00
|
|
|
|
isSpin:false
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
}).catch((error) => { })
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 关注和取消关注
|
2020-05-20 18:11:32 +08:00
|
|
|
|
focusFunc = (flag) => {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const { project_id } = this.state;
|
2020-05-18 16:46:51 +08:00
|
|
|
|
|
2020-03-27 17:30:16 +08:00
|
|
|
|
axios({
|
|
|
|
|
|
method: flag? 'delete' : 'post',
|
2020-05-18 16:46:51 +08:00
|
|
|
|
url: `/watchers/${flag? 'unfollow' : 'follow'}.json`,
|
|
|
|
|
|
params: {
|
|
|
|
|
|
target_type: "project",
|
|
|
|
|
|
id: project_id
|
|
|
|
|
|
}
|
2020-03-27 17:30:16 +08:00
|
|
|
|
})
|
|
|
|
|
|
.then(result => {
|
|
|
|
|
|
if(result && result.data.status === 0){
|
|
|
|
|
|
this.setWatchersCount(result.data.watchers_count, result.data.watched);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(error => {
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
});
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 点赞和取消点赞
|
2020-05-20 18:11:32 +08:00
|
|
|
|
pariseFunc = (flag) => {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const { project_id } = this.state;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
axios({
|
|
|
|
|
|
method: flag ? 'delete' : 'post',
|
|
|
|
|
|
url: `/projects/${project_id}/praise_tread/${flag ? 'unlike' : 'like'}.json`
|
|
|
|
|
|
})
|
|
|
|
|
|
.then(result => {
|
|
|
|
|
|
if (result && result.data.status === 0) {
|
|
|
|
|
|
this.setPraisesCount(result.data.praises_count, result.data.praised)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(error => {
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
});
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
setWatchersCount = (count, is_watched) => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
watched: is_watched,
|
|
|
|
|
|
watchers_count: count
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-03-27 17:30:16 +08:00
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
setPraisesCount = (count, is_praised) => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
praised: is_praised,
|
|
|
|
|
|
praises_count: count
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-03-27 17:30:16 +08:00
|
|
|
|
|
2020-03-16 14:12:11 +08:00
|
|
|
|
// fork项目
|
2020-05-20 18:11:32 +08:00
|
|
|
|
forkFunc = () => {
|
2020-05-29 18:08:25 +08:00
|
|
|
|
// if (!checkIfLogin) {
|
|
|
|
|
|
// this.props.showLoginDialog();
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
2020-03-24 16:51:34 +08:00
|
|
|
|
this.setState({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
isSpin: true
|
2020-03-24 16:51:34 +08:00
|
|
|
|
})
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const { project_id } = this.state;
|
|
|
|
|
|
const url = `/projects/${project_id}/forks.json`;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
axios.post(url).then(result => {
|
|
|
|
|
|
if (result && result.data.status === 0) {
|
2020-04-07 15:58:45 +08:00
|
|
|
|
this.props.history.push(`/projects/${result.data.id}/coders`);
|
2020-04-07 14:03:16 +08:00
|
|
|
|
this.props.showNotification(result.data.message);
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
2020-04-24 14:59:25 +08:00
|
|
|
|
this.setState({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
isSpin: false
|
2020-04-24 14:59:25 +08:00
|
|
|
|
})
|
2020-05-20 18:11:32 +08:00
|
|
|
|
}).catch(error => {
|
2020-04-01 18:23:57 +08:00
|
|
|
|
this.setState({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
isSpin: false
|
2020-04-01 18:23:57 +08:00
|
|
|
|
})
|
2020-03-16 14:12:11 +08:00
|
|
|
|
console.log(error);
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
// 获取分支列表
|
2020-05-20 18:11:32 +08:00
|
|
|
|
getBranch = (id) => {
|
|
|
|
|
|
const url = `/projects/${id}/branches.json`;
|
|
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
|
|
if (result && result.data.length > 0) {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const branchs = [];
|
2020-05-20 18:11:32 +08:00
|
|
|
|
result.data.map((item, key) => {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
branchs.push({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
index: key,
|
|
|
|
|
|
name: item.name
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
this.setState({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
branchList: result.data,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
branchs,
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
}).catch((error) => { })
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-06-03 09:56:07 +08:00
|
|
|
|
// 同步镜像
|
|
|
|
|
|
synchronismMirror=()=>{
|
|
|
|
|
|
const { repo_id } = this.state.projectDetail;
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
isSpin:true
|
|
|
|
|
|
})
|
|
|
|
|
|
const url = `/repositories/${repo_id}/sync_mirror.json`;
|
|
|
|
|
|
axios.post(url).then(result=>{
|
|
|
|
|
|
if(result && result.data && result.data.status === 0){
|
|
|
|
|
|
this.props.showNotification("镜像同步成功!");
|
|
|
|
|
|
this.getDetail();
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.props.showNotification("镜像同步失败!");
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
isSpin:false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(error=>{
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
render() {
|
|
|
|
|
|
const { projectDetail, watchers_count, praises_count, forked_count, isSpin, isManager, watched, praised } = this.state;
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const url = this.props.history.location.pathname;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
const urlArr = url.split("/");
|
2020-03-20 21:40:43 +08:00
|
|
|
|
const urlFlag = (urlArr.length === 3);
|
2020-03-24 15:40:22 +08:00
|
|
|
|
|
2020-03-20 21:40:43 +08:00
|
|
|
|
const { projectsId } = this.props.match.params;
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
|
|
|
|
|
const { state } = this.props.history.location;
|
2020-06-05 11:46:56 +08:00
|
|
|
|
const { current_user } = this.props;
|
|
|
|
|
|
const checkLogin = current_user && current_user.login;
|
2020-04-24 18:22:45 +08:00
|
|
|
|
const text = (
|
|
|
|
|
|
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
|
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
|
<span>forked from </span>
|
|
|
|
|
|
<Link to={`/users/${projectDetail.fork_info.fork_project_user_login}/projects`} className="show-user-link color-grey-ccc">{projectDetail.fork_info.fork_project_user_name}</Link>
|
|
|
|
|
|
<span> / </span>
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<Link to={`/projects/${projectDetail.forked_from_project_id}/coders`} className="color-grey-ccc">{projectDetail.fork_info.fork_form_name}</Link>
|
|
|
|
|
|
</React.Fragment> : ""
|
|
|
|
|
|
);
|
2020-06-04 18:27:19 +08:00
|
|
|
|
|
|
|
|
|
|
const mirror = (
|
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
|
<span>镜像自 </span>
|
|
|
|
|
|
<a href={projectDetail && projectDetail.mirror_url} target="_blank" style={{color:"#fff"}}>{projectDetail && projectDetail.mirror_url}</a>
|
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
|
)
|
2020-05-28 11:35:57 +08:00
|
|
|
|
const common ={
|
|
|
|
|
|
getDetail:this.getDetail
|
|
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
return (
|
2020-03-16 14:12:11 +08:00
|
|
|
|
<div>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<Spin spinning={isSpin}>
|
|
|
|
|
|
<div className="detailHeader-wrapper">
|
|
|
|
|
|
<div className="normal">
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<div className="f-wrap-between mb15" style={{ position: "relative" }}>
|
|
|
|
|
|
<p className="font-18 color-white df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
|
2020-04-23 16:26:42 +08:00
|
|
|
|
{projectDetail && projectDetail.author &&
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<Link to={`/users/${projectDetail.author.login}/projects`} className="show-user-link color-white">
|
|
|
|
|
|
{projectDetail.author.name}
|
|
|
|
|
|
</Link>
|
2020-04-23 16:26:42 +08:00
|
|
|
|
}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<span className="ml5 mr5">/</span>
|
2020-04-24 18:01:09 +08:00
|
|
|
|
<span className="hide-1 flex-1 df">
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<Link to={`/projects/${projectsId}/coders`} className="color-white font-22">{projectDetail && projectDetail.name}</Link>
|
2020-04-24 18:01:09 +08:00
|
|
|
|
{
|
|
|
|
|
|
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<Tooltip placement={'right'} title={text}>
|
|
|
|
|
|
<Link to={`/projects/${projectDetail.forked_from_project_id}/coders`}
|
|
|
|
|
|
className="ml10" >
|
|
|
|
|
|
<i className="iconfont icon-fork font-18 fl mt6" style={{ color: "#8D90E3" }}></i>
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
</Tooltip> : ""
|
2020-04-24 18:01:09 +08:00
|
|
|
|
}
|
2020-06-04 18:27:19 +08:00
|
|
|
|
{
|
2020-06-05 11:46:56 +08:00
|
|
|
|
projectDetail && checkLogin && projectDetail.type && projectDetail.type === 2 ?
|
2020-06-04 18:27:19 +08:00
|
|
|
|
<Tooltip placement={'right'} title={mirror}>
|
|
|
|
|
|
<i className="iconfont icon-jingxiang font-18 fl mt6 ml10" style={{ color: "#8D90E3" }}></i>
|
|
|
|
|
|
</Tooltip>:""
|
|
|
|
|
|
}
|
2020-04-24 18:01:09 +08:00
|
|
|
|
</span>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</p>
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<span className="df mt25">
|
2020-06-03 09:56:07 +08:00
|
|
|
|
{
|
2020-06-04 18:28:26 +08:00
|
|
|
|
projectDetail && projectDetail.type && projectDetail.type === 2 ?
|
2020-06-04 18:27:19 +08:00
|
|
|
|
<a className="synchronism ml30" onClick={this.synchronismMirror}>同步镜像</a>:""
|
2020-06-03 09:56:07 +08:00
|
|
|
|
}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<span className="detail_tag_btn">
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<a className="detail_tag_btn_name" onClick={() => this.focusFunc(watched)}>
|
|
|
|
|
|
<img src={watched ? img_focused : img_focus} alt="" width="14px" />
|
|
|
|
|
|
{watched ? '取消关注' : '关注'}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</a>
|
2020-05-18 16:46:51 +08:00
|
|
|
|
<Link className="detail_tag_btn_count" to={{pathname:`/projects/${projectsId}/watch_users`, state}}>
|
|
|
|
|
|
{watchers_count}
|
2020-06-03 09:56:07 +08:00
|
|
|
|
</Link>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
<span className="detail_tag_btn">
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<a className="detail_tag_btn_name" onClick={() => this.pariseFunc(praised)}>
|
|
|
|
|
|
<img src={praised ? img_parised : img_parise} width="13px" alt="" />
|
|
|
|
|
|
{praised ? '取消点赞' : '点赞'}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</a>
|
2020-05-18 16:46:51 +08:00
|
|
|
|
<Link className="detail_tag_btn_count" to={{pathname:`/projects/${projectsId}/praise_users`,state}}>
|
|
|
|
|
|
{praises_count}
|
|
|
|
|
|
</Link>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
<span className="detail_tag_btn">
|
|
|
|
|
|
<a className="detail_tag_btn_name" onClick={this.forkFunc}>
|
|
|
|
|
|
<img src={img_fork} alt="" width="10px"/>Fork</a>
|
2020-05-18 16:46:51 +08:00
|
|
|
|
<Link className="detail_tag_btn_count" to={{pathname:`/projects/${projectsId}/fork_users`,state}}>
|
|
|
|
|
|
{forked_count}
|
|
|
|
|
|
</Link>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</span>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</span>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</div>
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<div className="f-wrap-between">
|
|
|
|
|
|
<ul className="headerMenu-wrapper">
|
|
|
|
|
|
<li className={(url.indexOf("coders") > -1 || urlFlag) ? "active" : ""}>
|
|
|
|
|
|
<Link to={{ pathname: `/projects/${projectsId}/coders`, state }}>
|
|
|
|
|
|
<img alt="" src={img_1} width="18" />代码库
|
2020-05-21 17:13:08 +08:00
|
|
|
|
{ projectDetail && projectDetail.commits_count ? <span>{projectDetail.commits_count}</span>:""}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
</Link>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li className={(url.indexOf("orders") > -1 && !(url.indexOf("Milepost") > 0 || url.indexOf("meilpost") > 0 || url.indexOf("tags") > 0)) ? "active" : ""}>
|
|
|
|
|
|
<Link to={{ pathname: `/projects/${projectsId}/orders`, state }}>
|
|
|
|
|
|
<img alt="" src={img_2} width="12" />任务
|
2020-05-21 17:13:08 +08:00
|
|
|
|
{ projectDetail && projectDetail.issues_count ? <span>{projectDetail.issues_count}</span> :""}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
</Link>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li className={url.indexOf("merge") > -1 ? "active" : ""}>
|
|
|
|
|
|
<Link to={{ pathname: `/projects/${projectsId}/merge`, state }}>
|
|
|
|
|
|
<img alt="" src={img_3} width="13" />合并请求
|
2020-05-21 17:13:08 +08:00
|
|
|
|
{ projectDetail && projectDetail.pull_requests_count ? <span>{projectDetail.issues_count}</span> : "" }
|
2020-05-20 18:11:32 +08:00
|
|
|
|
</Link>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li className={(url.indexOf("Milepost") > -1 || url.indexOf("meilpost") > -1) ? "active" : ""}>
|
|
|
|
|
|
<Link to={{ pathname: `/projects/${projectsId}/orders/Milepost`, state }}>
|
|
|
|
|
|
<img alt="" src={img_milepost} width="16" />里程碑
|
|
|
|
|
|
{projectDetail && projectDetail.version_count && <span>{projectDetail.version_count}</span>}
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li className={url.indexOf("trends") > -1 ? "active" : ""}>
|
|
|
|
|
|
<Link to={{ pathname: `/projects/${projectsId}/trends`, state }}>
|
|
|
|
|
|
<img alt="" src={img_6} width="16" />动态
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
{
|
|
|
|
|
|
isManager &&
|
|
|
|
|
|
<li className={url.indexOf("setting") > 0 ? "active" : ""}><Link to={`/projects/${projectsId}/setting`}><img alt="" src={img_7} width="19" />仓库设置</Link></li>
|
|
|
|
|
|
}
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
|
|
|
|
|
|
<Switch {...this.props}>
|
|
|
|
|
|
{/* 新建文件 */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/coders/:branch/newfile/:path"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<FileNew {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-06-04 18:28:26 +08:00
|
|
|
|
<Route path="/projects/:projectsId/coders/:branch/uploadfile"
|
|
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<UploadFile {...this.props} {...props} {...this.state} {...common}/>)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<Route path="/projects/:projectsId/coders/:branch/newfile"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<FileNew {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 标签列表 */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/orders/tags"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<TagList {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 仓库设置 */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/setting"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<Setting {...this.props} {...props} {...this.state} {...common} />)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-04-09 18:13:26 +08:00
|
|
|
|
{/* 任务详情 */}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<Route path="/projects/:projectsId/orders/:orderId/detail"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrderDetail {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 里程碑 */}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<Route path="/projects/:projectsId/orders/Milepost"
|
2020-03-24 16:51:34 +08:00
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrderMilepost {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 新建里程碑 */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/orders/meilpost"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-05-20 18:11:32 +08:00
|
|
|
|
{/*里程碑详情*/}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<Route path="/projects/:projectsId/orders/:meilid/MilepostDetail"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<MilepostDetail {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-05-20 18:11:32 +08:00
|
|
|
|
{/*修改里程碑*/}
|
|
|
|
|
|
<Route path="/projects/:projectsId/orders/:meilid/meilpost"
|
2020-03-24 16:51:34 +08:00
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrderupdateMilepost {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-27 18:49:50 +08:00
|
|
|
|
{/* 里程碑页面新建任务 */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/orders/:milepostId/new"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common}/>)
|
2020-04-27 18:49:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-04-09 18:13:26 +08:00
|
|
|
|
{/* 新建任务 */}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<Route path="/projects/:projectsId/orders/new"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 修改详情 */}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<Route path="/projects/:projectsId/orders/:orderId/updatedetail"
|
2020-03-24 16:51:34 +08:00
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
{/* 复制详情 */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/orders/:orderId/copyetail"
|
2020-03-24 16:51:34 +08:00
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 动态 */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/trends"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<TrendsIndex {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* 代码Index */}
|
|
|
|
|
|
<Route path="/projects/:projectsId/orders"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/projects/:projectsId/merge/new"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/projects/:projectsId/merge/:mergeId/UpdateMerge"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/projects/:projectsId/merge/:mergeId/Messagecount"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/projects/:projectsId/merge/:mergeId/MergeSubmit"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
<Route path="/projects/:projectsId/merge"
|
2020-03-24 16:51:34 +08:00
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-04-17 17:35:47 +08:00
|
|
|
|
<Route path="/projects/:projectsId/coders/filesurl"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
2020-04-17 17:35:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<Route path="/projects/:projectsId/coders"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
2020-06-03 14:42:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
<Route path="/projects/:projectsId"
|
|
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-05-18 16:46:51 +08:00
|
|
|
|
<Route path="/projects/:projectsId/watch_users"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common}/>)
|
2020-05-18 16:46:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
<Route path="/projects/:projectsId/praise_users"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<PraiseUsers {...this.props} {...props} {...this.state} {...common}/>)
|
2020-05-18 16:46:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
<Route path="/projects/:projectsId/fork_users"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common}/>)
|
2020-05-18 16:46:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<Route path="/projects/:projectsId"
|
|
|
|
|
|
render={
|
2020-05-28 11:35:57 +08:00
|
|
|
|
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
</Switch>
|
|
|
|
|
|
</Spin>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-24 15:08:57 +08:00
|
|
|
|
export default withRouter(Detail);
|