forked from Gitlink/forgeplus-react
Merge branch 'gitlink_server' of https://gitlink.org.cn/Gitlink/forgeplus-react into feature_websiteBuild
This commit is contained in:
commit
cf4f5be9ed
|
|
@ -19,6 +19,7 @@ function SelfList(props){
|
|||
const [ deleId , setDeleId] = useState(undefined);
|
||||
const pathname = props.location.pathname;
|
||||
const { id , temp } = props;
|
||||
const { deptId } = props.match.params;
|
||||
const limit = 15;
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
@ -57,7 +58,7 @@ function SelfList(props){
|
|||
|
||||
function getNew(){
|
||||
getNewsMyList(id,{
|
||||
auditStatus:status,
|
||||
auditStatus:status===0 ? 2 : status === 2 ? 0 : 1,
|
||||
pageSize:limit
|
||||
}).then(result=>{
|
||||
setList(result.data.rows);
|
||||
|
|
@ -109,7 +110,7 @@ function SelfList(props){
|
|||
</div>
|
||||
</Modal>
|
||||
<Breadcrumb separator=">" style={{paddingTop:"20px"}}>
|
||||
<Breadcrumb.Item><Link className="primaryColor" to={pathname.replace("/self","")}>{source ? "资源发布":"领域资讯"}</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item><Link className="primaryColor" to={pathname.replace("/self","")}>{source ? "资源发布": temp==="zone1" ? "新闻资讯":"领域资讯"}</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item>我的{source ? "资源":"文章"}</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<ul className="selfMenu">
|
||||
|
|
|
|||
|
|
@ -501,22 +501,30 @@ class Detail extends Component {
|
|||
|
||||
// 同步镜像
|
||||
synchronismMirror = () => {
|
||||
const { platform } = this.state;
|
||||
if (!platform) return;
|
||||
const { projectsId, owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/sync_mirror.json`;
|
||||
axios.post(url).then(result => {
|
||||
if (result && result.data && result.data.status === 0) {
|
||||
this.setState({
|
||||
secondSync: true
|
||||
})
|
||||
this.canvasChannel(true);
|
||||
} else {
|
||||
this.props.showNotification("镜像同步失败!");
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
const { isManager } = this.state;
|
||||
const { current_user , showLoginDialog } = this.props;
|
||||
if(!(current_user && current_user.login)){
|
||||
showLoginDialog();
|
||||
return
|
||||
}
|
||||
if((current_user && current_user.admin) || isManager){
|
||||
const { platform } = this.state;
|
||||
if (!platform) return;
|
||||
const { projectsId, owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/sync_mirror.json`;
|
||||
axios.post(url).then(result => {
|
||||
if (result && result.data && result.data.status === 0) {
|
||||
this.setState({
|
||||
secondSync: true
|
||||
})
|
||||
this.canvasChannel(true);
|
||||
} else {
|
||||
this.props.showNotification("镜像同步失败!");
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
textFunc = (forked_from_project_id, fork_info) => {
|
||||
|
|
@ -580,7 +588,7 @@ class Detail extends Component {
|
|||
firstSync ? "" :
|
||||
<span className="df">
|
||||
{
|
||||
((current_user && current_user.admin) || isManager) && (projectDetail && projectDetail.type && projectDetail.type === 2) ?
|
||||
(projectDetail && projectDetail.type && projectDetail.type === 2) ?
|
||||
<a className="synchronism ml30" onClick={this.synchronismMirror}>同步镜像</a> : ""
|
||||
}
|
||||
<span className="detail_tag_btn">
|
||||
|
|
|
|||
Loading…
Reference in New Issue