diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 39ec3726c..79085d12d 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -27,7 +27,7 @@ import RenderHtml from '../../components/render-html'; * projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能) */ function CoderDepot(props){ - const [ projectDetail , setProjectDetail ]= useState(undefined); + // const [ projectDetail , setProjectDetail ]= useState(undefined); const [ inviteCode , setInviteCode ] = useState(undefined); const [ treeValue , setTreeValue ] = useState(undefined); const [ treeValuePath , setTreeValuePath ] = useState(undefined); @@ -42,7 +42,7 @@ function CoderDepot(props){ const [ zip_url , setZip_url ] = useState(undefined); const [ tar_url , setTar_url ] = useState(undefined); const [ readOnly , setReadOnly] = useState(undefined); - const [ isSpin , setIsSpin] = useState(true); + const [ isSpin , setIsSpin] = useState(false); const [ visible ,setVisible ] = useState(false); const [ mainFlag ,setMainFlag ] = useState(false); const [ openModal , setOpenModal ] = useState(false); @@ -61,12 +61,10 @@ function CoderDepot(props){ const projectsId = props.match.params.projectsId; let branchName = props.match.params.branchName; branchName = returnbar(branchName); - const details = props.projectDetail; let pathname = props.history.location.pathname; - const { platform , mirror_status } = props ; + const { platform , mirror_status , bannerList , projectDetail } = props ; //distribution:判断此用户是否可以创建发行版 - const distribution = details && details.type ===0 && ( details.permission && details.permission !== "Reporter"); - const { bannerList } = props; + const distribution = projectDetail && projectDetail.type ===0 && ( projectDetail.permission && projectDetail.permission !== "Reporter"); useEffect(()=>{ if(bannerList && bannerList.length>0){ let a = bannerList.filter(i=>i.menu_name === "pulls"); @@ -91,23 +89,22 @@ function CoderDepot(props){ window.open(path,"_blank"); } - useEffect(()=>{ - if(details && mirror_status===0){ - setProjectDetail(details); - setTopics(details.topics); - setDesc(details.description); - setWebsite(details.website); - setLessonUrl(details.lesson_url); - setDefaultBranch(details.default_branch); - setInviteCode(details.invite_code); + if(projectDetail){ + // setProjectDetail(projectDetail); + setTopics(projectDetail.topics); + setDesc(projectDetail.description); + setWebsite(projectDetail.website); + setLessonUrl(projectDetail.lesson_url); + setDefaultBranch(projectDetail.default_branch); + setInviteCode(projectDetail.invite_code); } - },[details,mirror_status]) + },[projectDetail,mirror_status]) useEffect(()=>{ // 设置网页标题 - if(details){ - const { author, name, description, default_branch} = details; + if(projectDetail){ + const { author, name, description, default_branch} = projectDetail; if(branchName && branchName !== default_branch){ // 处于某分支/标签 document.title = `${author.name}/${name}-${branchName}-for gitlink;for git`; @@ -115,7 +112,7 @@ function CoderDepot(props){ document.title = `${author.name}/${name}${description?': '+description:''}-for gitlink;for git` ; } } - }, [treeValuePath, details, branchName]) + }, [treeValuePath, projectDetail, branchName]) useEffect(()=>{ if(treeValue){ @@ -383,7 +380,6 @@ function CoderDepot(props){ let n = fileInfo && fileInfo.name; const mdFlag = n && n.substring(n.length-3,n.length) === ".md"; - const { current_user , checkIfLogin , showLoginDialog } = props; const baseOper = current_user && current_user.login && issuesFlag; const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type ===0 && pullsFlag && props.platform; @@ -583,7 +579,7 @@ function CoderDepot(props){ { - (!(treeValuePath && treeValuePath.length > 0) && !fileInfo) && + (!(treeValuePath && treeValuePath.length > 0) && !fileInfo ) &&
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 75cdf8871..d81a53b34 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -265,13 +265,13 @@ class Detail extends Component { }) this.deleteProjectBack(); } else { - this.getBanner(); - this.getDetail(); this.setState({ firstSync: false, secondSync: false, mirror_status:0 }) + this.getBanner(); + this.getDetail(); } } }) @@ -304,7 +304,6 @@ class Detail extends Component { }, received: data => { console.log(`###### ---received data--- ######`); - console.log(data); if (data) { if (deleteFlag) { this.props.showNotification("镜像同步成功!"); @@ -318,6 +317,7 @@ class Detail extends Component { } this.setState({ firstSync: false, + mirror_status:data.project && data.project.mirror_status, secondSync: false }); cable.subscriptions.consumer.disconnect(); @@ -668,205 +668,204 @@ class Detail extends Component {
{ - firstSync ? - - - - : - - - {/* 服务 */} - () - } - > - {/* 资源 */} - () - } - > - {/* 主页 */} - () - } - > - {/* wiki新增文件 */} - () - } - > - {/* wiki编辑文件 */} - () - } - > - {/* wiki具体某一个地址 */} - () - } - > - {/* wiki */} - () - } - > - {/* 工作流 */} - () - } - > - {/* 标签列表 */} - {/* () - } - > */} - {/* 仓库设置 */} - () - } - > - - {/*修改里程碑*/} - () - } - > - {/* 新建里程碑 */} - () - } - > - {/*里程碑详情*/} - () - } - > - {/* 里程碑 */} - () - } - > - {/* 动态 */} - () - } - > - {/* 代码Index */} - () - } - > - () - } - > - () - } - > - {/* review */} - () - } - > - () - } - > - () - } - > - () - } - > - () - } - > - - () - } - > - () - } - > - () - } - > - () - } - > - {/* 贡献者列表 */} - () - } - > - - {/* 代码库----详情页面 */} - () - } - > - () - } - > - {/* 邀请 */} - () - } - > - - () - } - > - - } - > - - + firstSync && + + + } + + + {/* 服务 */} + () + } + > + {/* 资源 */} + () + } + > + {/* 主页 */} + () + } + > + {/* wiki新增文件 */} + () + } + > + {/* wiki编辑文件 */} + () + } + > + {/* wiki具体某一个地址 */} + () + } + > + {/* wiki */} + () + } + > + {/* 工作流 */} + () + } + > + {/* 标签列表 */} + {/* () + } + > */} + {/* 仓库设置 */} + () + } + > + + {/*修改里程碑*/} + () + } + > + {/* 新建里程碑 */} + () + } + > + {/*里程碑详情*/} + () + } + > + {/* 里程碑 */} + () + } + > + {/* 动态 */} + () + } + > + {/* 代码Index */} + () + } + > + () + } + > + () + } + > + {/* review */} + () + } + > + () + } + > + () + } + > + () + } + > + () + } + > + + () + } + > + () + } + > + () + } + > + () + } + > + {/* 贡献者列表 */} + () + } + > + + {/* 代码库----详情页面 */} + () + } + > + () + } + > + {/* 邀请 */} + () + } + > + + () + } + > + + } + > + + ) } diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index 6502016a0..6c715468f 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -217,6 +217,7 @@ class Index extends Component { const {blockchain_init} = values; axios.post(url, { ...values, + clone_addr:values.clone_addr.trim(), auth_password:decoderPass, project_language_id:languageFlag ? project_language_id : undefined, project_category_id:categoreFlag ? project_category_id : undefined,