|
|
|
@ -144,22 +144,24 @@ const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.j
|
|
|
|
|
, 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json']
|
|
|
|
|
const cacheInterceptorUrlMap = {}
|
|
|
|
|
class TPMIndex extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
loadingContent: false,
|
|
|
|
|
power: false,
|
|
|
|
|
shixunsDetails: {},
|
|
|
|
|
shixunId: undefined,
|
|
|
|
|
star_info: [0, 0, 0, 0, 0, 0],
|
|
|
|
|
star_infos: [0, 0, 0, 0, 0, 0],
|
|
|
|
|
identity: undefined,
|
|
|
|
|
TPMRightSectionData: undefined,
|
|
|
|
|
PropaedeuticsList: undefined,
|
|
|
|
|
tpmindexjupyterbool: false,
|
|
|
|
|
is_jupyter: false,
|
|
|
|
|
selectedKeys: "",
|
|
|
|
|
openknows: false
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
loadingContent: false,
|
|
|
|
|
power: false,
|
|
|
|
|
shixunsDetails: {},
|
|
|
|
|
shixunId: undefined,
|
|
|
|
|
star_info: [0, 0, 0, 0, 0, 0],
|
|
|
|
|
star_infos: [0, 0, 0, 0, 0, 0],
|
|
|
|
|
identity:undefined,
|
|
|
|
|
TPMRightSectionData:undefined,
|
|
|
|
|
PropaedeuticsList: undefined,
|
|
|
|
|
tpmindexjupyterbool:false,
|
|
|
|
|
is_jupyter:false,
|
|
|
|
|
selectedKeys:"",
|
|
|
|
|
openknows:false,
|
|
|
|
|
newathArray:[]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -379,23 +381,28 @@ class TPMIndex extends Component {
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/settings`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
let url = window.location.href;
|
|
|
|
|
let flag = false;
|
|
|
|
|
// url.indexOf("add_file")>-1;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
|
{/*头部*/}
|
|
|
|
|
{
|
|
|
|
|
!flag &&
|
|
|
|
|
<TPMBanner
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
is_jupyter={this.state.is_jupyter}
|
|
|
|
|
></TPMBanner>
|
|
|
|
|
}
|
|
|
|
|
setpathArray=(list)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
newathArray:list
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
let url = window.location.href;
|
|
|
|
|
let flag =false;
|
|
|
|
|
// url.indexOf("add_file")>-1;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
|
{/*头部*/}
|
|
|
|
|
{
|
|
|
|
|
!flag &&
|
|
|
|
|
<TPMBanner
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
is_jupyter={this.state. is_jupyter}
|
|
|
|
|
></TPMBanner>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
@ -545,24 +552,24 @@ class TPMIndex extends Component {
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository/master/shixun_show/:fileId" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter} setpathArray={(value)=>this.setpathArray(value)}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/secret_repository/master/shixun_show/:fileId" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter} setpathArray={(value)=>this.setpathArray(value)}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Route path="/shixuns/:shixunId/repository" render={
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter} setpathArray={(value)=>this.setpathArray(value)}
|
|
|
|
|
/>)
|
|
|
|
|
}></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}
|
|
|
|
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter} setpathArray={(value)=>this.setpathArray(value)}
|
|
|
|
|
/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
@ -570,94 +577,97 @@ class TPMIndex extends Component {
|
|
|
|
|
{/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></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 exact path="/shixuns/:shixunId/repository/:shixunId/" component={TPMRepositoryComponent}></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 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 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 path="/shixuns/:shixunId/settings" render={
|
|
|
|
|
(props) => (<TPMsettings {...this.props} {...this.state} {...props} getcomponentdidmount={()=>this.getcomponentdidmount()} />)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
<Route exact path="/shixuns/:shixunId/update_propaedeutics" render={
|
|
|
|
|
(props) => (<TPMUpdatepropaede {...this.props} {...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 path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={
|
|
|
|
|
(props) => (<TPMevaluation {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}></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/tab=3" render={
|
|
|
|
|
(props) => (<TPManswer {...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/new" 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/editcheckpoint" render={
|
|
|
|
|
(props) => (<TPMchallengesnew {...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/newquestion" 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 path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" 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 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>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default SnackbarHOC()(TPMIndexHOC(TPMIndex));
|
|
|
|
|