|
|
|
@ -30,7 +30,7 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
http_url:undefined,
|
|
|
|
|
subFileType:"",
|
|
|
|
|
readMeContent:undefined,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isSpin:true,
|
|
|
|
|
|
|
|
|
|
branchList:undefined,
|
|
|
|
@ -64,7 +64,8 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
getProjectRoot=(branch)=>{
|
|
|
|
|
const { current_user } = this.props;
|
|
|
|
|
const { projectsId } = this.props.match.params;
|
|
|
|
|
const url = `/${current_user && current_user.login}/${projectsId}/entries.json`;
|
|
|
|
|
const { state } = this.props.history.location;
|
|
|
|
|
const url = `/${state}/${projectsId}/entries.json`;
|
|
|
|
|
axios.get((url),{
|
|
|
|
|
params:{
|
|
|
|
|
branch
|
|
|
|
@ -83,7 +84,7 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
rootData:result.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error)=>{})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -128,7 +129,7 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
const { branch } = this.state;
|
|
|
|
|
const { state } = this.props.history.location;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const url =`/${state}/${projectsId}/sub_entries.json`;
|
|
|
|
|
|
|
|
|
|
axios.get(url,{
|
|
|
|
@ -183,7 +184,7 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
<div className="commonBox-title">{readMeContent[0].name}</div>
|
|
|
|
|
<div className="commonBox-info">
|
|
|
|
|
{
|
|
|
|
|
readMeContent[0].content ?
|
|
|
|
|
readMeContent[0].content ?
|
|
|
|
|
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(readMeContent[0].content).replace(/▁/g, "▁▁▁")}}></div>
|
|
|
|
|
:
|
|
|
|
|
<span>暂无~</span>
|
|
|
|
@ -197,7 +198,7 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
// 选择分支
|
|
|
|
|
changeBranch=(value)=>{
|
|
|
|
|
const { branchList } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let branchLastCommit = branchList && branchList.length >0 && branchList[parseInt(value.key)];
|
|
|
|
|
this.setState({
|
|
|
|
|
branch:branchLastCommit.name,
|
|
|
|
@ -255,13 +256,13 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
</Menu>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const urlRoot = filePath && filePath.length > 0 ? `/${filePath[filePath.length - 1].path}` : "";
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{
|
|
|
|
|
rootData &&
|
|
|
|
|
rootData &&
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{
|
|
|
|
|
rootData.length > 0 ?
|
|
|
|
@ -288,10 +289,10 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div className="f-wrap-alignCenter">
|
|
|
|
|
{
|
|
|
|
@ -330,4 +331,4 @@ class CoderRootDirectory extends Component{
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
export default CoderRootDirectory;
|
|
|
|
|
export default CoderRootDirectory;
|
|
|
|
|