|
|
|
@ -20,6 +20,8 @@ import TPMShixunDiscussContainer from './TPMShixunDiscussContainer';
|
|
|
|
|
|
|
|
|
|
import TPMRepositoryComponent from './TPMRepositoryComponent';
|
|
|
|
|
|
|
|
|
|
import TPMRepositoryComponentdetails from './TPMRepositoryComponentdetails';
|
|
|
|
|
|
|
|
|
|
import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits';
|
|
|
|
|
|
|
|
|
|
import TPMsettings from './TPMsettings/TPMsettings';
|
|
|
|
@ -132,6 +134,11 @@ const AddFile = Loadable({
|
|
|
|
|
loader: () => import('./shixunchild/Repository/RepositoryAddFile'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
// 版本库上传文件
|
|
|
|
|
const Uploadfile = Loadable({
|
|
|
|
|
loader: () => import('./shixunchild/Repository/RepositoryAddFileupload_file'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json'
|
|
|
|
|
, 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json']
|
|
|
|
@ -235,36 +242,25 @@ class TPMIndex extends Component {
|
|
|
|
|
public: response.data.public,
|
|
|
|
|
is_jupyter: response.data.is_jupyter === undefined || response.data.is_jupyter === null ? false : response.data.is_jupyter,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (userid) {
|
|
|
|
|
if (response.data.identity < 4) {
|
|
|
|
|
if (newTPMsettings === undefined || newTPMsettings === false || newTPMsettings === null) {
|
|
|
|
|
console.log()
|
|
|
|
|
this.setState({
|
|
|
|
|
openknows: true
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
openknows: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsDetails: undefined,
|
|
|
|
|
shixunId: undefined,
|
|
|
|
|
star_info: undefined,
|
|
|
|
|
star_infos: undefined,
|
|
|
|
|
power: undefined,
|
|
|
|
|
identity: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
propaedeutics: undefined,
|
|
|
|
|
is_jupyter: false,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
|
|
|
|
|
// let url = config.url;
|
|
|
|
|
// // console.log('tpmContentRequestInterceptor:', url)
|
|
|
|
|
// for ( let i = 0; i < interceptorUrlArray.length; i++ ) {
|
|
|
|
|
// if (url.indexOf(interceptorUrlArray[i]) != -1) {
|
|
|
|
|
// url = url.split('?')[0]
|
|
|
|
|
// console.log('loadingContent, url:', url)
|
|
|
|
|
//
|
|
|
|
|
// this.setState({ loadingContent: true })
|
|
|
|
|
//
|
|
|
|
|
// cacheInterceptorUrlMap[url] = true
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return config;
|
|
|
|
|
// }, function (error) {
|
|
|
|
|
// return Promise.reject(error);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
|
|
|
|
|
let url = config.url;
|
|
|
|
@ -386,7 +382,8 @@ class TPMIndex extends Component {
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
let url = window.location.href;
|
|
|
|
|
let flag = url.indexOf("add_file") > -1;
|
|
|
|
|
let flag = false;
|
|
|
|
|
// url.indexOf("add_file")>-1;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
@ -464,150 +461,177 @@ class TPMIndex extends Component {
|
|
|
|
|
<Link to={`/shixuns/${this.props.match.params.shixunId}/audit_situation`}
|
|
|
|
|
className={`${this.props.match.url.indexOf('audit_situation') != -1 ? 'font-16 audit_situationactive' : 'font-16 audit_situationactive'} fl`}>审核情况</Link>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</Menu>
|
|
|
|
|
</Col>
|
|
|
|
|
</div>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
{/*筛选*/}
|
|
|
|
|
{/*{*/}
|
|
|
|
|
{/* tpmindexjupyterbool===false?*/}
|
|
|
|
|
|
|
|
|
|
{/* :""*/}
|
|
|
|
|
{/*}*/}
|
|
|
|
|
{/* */}
|
|
|
|
|
|
|
|
|
|
<Switch {...this.props}>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository/:repoId/commits" render={
|
|
|
|
|
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository/:repoId/commits" render={
|
|
|
|
|
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
{/*任务*/}
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/challenges" render={
|
|
|
|
|
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository/add_file" render={
|
|
|
|
|
(props) => (<AddFile {...this.props} {...this.state} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */}
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/propaedeutics" render={
|
|
|
|
|
(props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/collaborators" render={
|
|
|
|
|
(props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* <Route exact path="/shixuns/:shixunId/repository/:shixunId/" component={TPMRepositoryComponent}></Route> */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/shixun_discuss" render={
|
|
|
|
|
(props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
initForumState={(data) => this.initForumState(data)}
|
|
|
|
|
setSearchValue={this.setSearchValue}
|
|
|
|
|
setHotLabelIndex={this.setHotLabelIndex}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/settings" render={
|
|
|
|
|
(props) => (<TPMsettings {...this.props} {...this.state} {...props} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*实训项目条目塞选*/}
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/ranking_list" render={
|
|
|
|
|
(props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
{/*合作者*/}
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/dataset" render={
|
|
|
|
|
(props) => (<TPMDataset {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/audit_situation" render={
|
|
|
|
|
(props) => (<Audit_situationComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/fork_list" render={
|
|
|
|
|
(props) => (<TPMFork_listComponent {...this.props} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/update_propaedeutics" render={
|
|
|
|
|
(props) => (<TPMUpdatepropaede {...this.props} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*评测设置*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={
|
|
|
|
|
(props) => (<TPMevaluation {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*参考答案*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={
|
|
|
|
|
(props) => (<TPManswer {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*新建关卡*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/new" render={
|
|
|
|
|
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*编辑关卡*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editcheckpoint" render={
|
|
|
|
|
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*新建选择题*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/newquestion" render={
|
|
|
|
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*修改选择题*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={
|
|
|
|
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*修改选择题*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={
|
|
|
|
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId" render={
|
|
|
|
|
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
{/*筛选*/}
|
|
|
|
|
{/*{*/}
|
|
|
|
|
{/* tpmindexjupyterbool===false?*/}
|
|
|
|
|
|
|
|
|
|
{/* :""*/}
|
|
|
|
|
{/*}*/}
|
|
|
|
|
{/* */}
|
|
|
|
|
|
|
|
|
|
<Switch {...this.props}>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository/:repoId/commits" render={
|
|
|
|
|
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository/:repoId/commits" render={
|
|
|
|
|
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
{/*任务*/}
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/challenges" render={
|
|
|
|
|
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository/upload_file" render={
|
|
|
|
|
(props) => (<Uploadfile {...this.props} {...this.state} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository/add_file" render={
|
|
|
|
|
(props) => (<AddFile {...this.props} {...this.state} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository/upload_file" render={
|
|
|
|
|
(props) => (<Uploadfile {...this.props} {...this.state} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository/add_file" render={
|
|
|
|
|
(props) => (<AddFile {...this.props} {...this.state} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository/master/shixun_show/:fileId" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponentdetails {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository/master/shixun_show/:fileId" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponentdetails {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */}
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/propaedeutics" render={
|
|
|
|
|
(props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/collaborators" render={
|
|
|
|
|
(props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* <Route exact path="/shixuns/:shixunId/repository/:shixunId/" component={TPMRepositoryComponent}></Route> */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/shixun_discuss" render={
|
|
|
|
|
(props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
initForumState={(data) => this.initForumState(data)}
|
|
|
|
|
setSearchValue={this.setSearchValue}
|
|
|
|
|
setHotLabelIndex={this.setHotLabelIndex}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/settings" render={
|
|
|
|
|
(props) => (<TPMsettings {...this.props} {...this.state} {...props} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*实训项目条目塞选*/}
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/ranking_list" render={
|
|
|
|
|
(props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
{/*合作者*/}
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/dataset" render={
|
|
|
|
|
(props) => (<TPMDataset {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/audit_situation" render={
|
|
|
|
|
(props) => (<Audit_situationComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/fork_list" render={
|
|
|
|
|
(props) => (<TPMFork_listComponent {...this.props} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/update_propaedeutics" render={
|
|
|
|
|
(props) => (<TPMUpdatepropaede {...this.props} {...props}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*评测设置*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={
|
|
|
|
|
(props) => (<TPMevaluation {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*参考答案*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={
|
|
|
|
|
(props) => (<TPManswer {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*新建关卡*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/new" render={
|
|
|
|
|
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*编辑关卡*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editcheckpoint" render={
|
|
|
|
|
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*新建选择题*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/newquestion" render={
|
|
|
|
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*修改选择题*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={
|
|
|
|
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*修改选择题*/}
|
|
|
|
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={
|
|
|
|
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId" render={
|
|
|
|
|
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*<Route exact path="/shixuns/:shixunId" component={TPMChallengeComponent}></Route>*/}
|
|
|
|
|
</Switch>
|
|
|
|
|
{/*<Route exact path="/shixuns/:shixunId" component={TPMChallengeComponent}></Route>*/}
|
|
|
|
|
</Switch>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|