Merge branch 'jupyter' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_jupyter

chromesetting
杨树林 5 years ago
commit adb70cdf46

@ -212,6 +212,7 @@ class Audit_situationComponent extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
<div className="padding20 edu-back-white mt20" style={{minHeight: '640px'}}> <div className="padding20 edu-back-white mt20" style={{minHeight: '640px'}}>

@ -20,7 +20,7 @@ class TPMChallenge extends Component {
} }
render() { render() {
const { loadingContent, shixun, user, match,jupyterbool const { loadingContent, shixun, user, match,jupyterbool,is_jupyter
} = this.props; } = this.props;
return ( return (
<React.Fragment> <React.Fragment>
@ -32,13 +32,15 @@ class TPMChallenge extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
{ {
jupyterbool===true? is_jupyter===true?
<Challengesjupyter <Challengesjupyter
{...this.props} {...this.props}
/> />
: <Challenges :
<Challenges
{...this.props} {...this.props}
/> />
} }

@ -15,13 +15,16 @@ class TPMChallengeContainer extends Component {
render() { render() {
const { tpmLoading } = this.props; const { tpmLoading } = this.props;
const user = this.props.current_user; const user = this.props.current_user;
// console.log("TPMChallengeContainerTPMChallengeContainer");
// console.log(this.props);
return ( return (
<React.Fragment> <React.Fragment>
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> : { tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
<TPMChallenge <TPMChallenge
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
> >
</TPMChallenge> </TPMChallenge>
} }

@ -1,53 +1,54 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import './TPMShixunDiscuss.css' import './TPMShixunDiscuss.css'
import Collaborators from './shixunchild/Collaborators/Collaborators' import Collaborators from './shixunchild/Collaborators/Collaborators'
import TPMRightSection from './component/TPMRightSection' import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav' import TPMNav from './component/TPMNav'
class TPMCollaborators extends Component { class TPMCollaborators extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
render() { render() {
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
aboutFocus, user, match aboutFocus, user, match
} = this.props; } = this.props;
return ( return (
<React.Fragment> <React.Fragment>
<div className="educontent clearfix mt30 mb80"> <div className="educontent clearfix mt30 mb80">
<div className="with65 fl edu-back-white" > <div className="with65 fl edu-back-white" >
<TPMNav <TPMNav
match={match} match={match}
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
></TPMNav> is_jupyter={this.props.is_jupyter}
<Collaborators ></TPMNav>
{...this.props} <Collaborators
/> {...this.props}
/>
</div>
</div>
<div className="with35 fr pl20">
<TPMRightSection <div className="with35 fr pl20">
{...this.props} <TPMRightSection
/> {...this.props}
</div> />
</div> </div>
</React.Fragment> </div>
</React.Fragment>
);
} );
} }
}
export default TPMCollaborators;
export default TPMCollaborators;

@ -1,47 +1,47 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import TPMCollaborators from './TPMCollaborators' import TPMCollaborators from './TPMCollaborators'
import axios from 'axios'; import axios from 'axios';
class TPMChallengeContainer extends Component { class TPMChallengeContainer extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
} }
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
} }
componentDidMount() { componentDidMount() {
// this.props.showShixun(); // this.props.showShixun();
} }
render() { render() {
const { tpmLoading } = this.props; const { tpmLoading } = this.props;
const user = this.props.current_user; const user = this.props.current_user;
return ( return (
<React.Fragment> <React.Fragment>
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> : { tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
<TPMCollaborators <TPMCollaborators
{...this.props} {...this.props}
{...this.state} {...this.state}
user={user} user={user}
aboutFocus={this.props.aboutFocus} aboutFocus={this.props.aboutFocus}
is_jupyter={this.props.is_jupyter}
> >
</TPMCollaborators> </TPMCollaborators>
} }
</React.Fragment> </React.Fragment>
); );
} }
} }
export default TPMChallengeContainer; export default TPMChallengeContainer;

@ -103,8 +103,8 @@ class TPMDataset extends Component {
selectedRowKeysdata:mydata, selectedRowKeysdata:mydata,
selectedRowKeys: datas, selectedRowKeys: datas,
}) })
console.log(mydata); // console.log(mydata);
console.log(datas); // console.log(datas);
} else { } else {
@ -237,6 +237,7 @@ class TPMDataset extends Component {
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
debugger
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList} = this.state; let {fileList} = this.state;
@ -256,6 +257,7 @@ class TPMDataset extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
debugger
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
@ -357,7 +359,7 @@ class TPMDataset extends Component {
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file, fileList) => { beforeUpload: (file, fileList) => {
debugger
if (this.state.fileList.length >= 1) { if (this.state.fileList.length >= 1) {
return false return false
} }
@ -400,6 +402,7 @@ class TPMDataset extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
<div className="padding20 edu-back-white mt20 " style={{minHeight: '463px'}}> <div className="padding20 edu-back-white mt20 " style={{minHeight: '463px'}}>

@ -1,50 +1,50 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import TPMForklist from './TPMForklist' import TPMForklist from './TPMForklist'
import axios from 'axios'; import axios from 'axios';
class TPMRanking_listContainer extends Component { class TPMRanking_listContainer extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
tpmLoading: true, tpmLoading: true,
creator: { creator: {
owner_id: '' owner_id: ''
} }
} }
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
} }
componentDidMount() { componentDidMount() {
this.props.showShixun(); this.props.showShixun();
} }
render() { render() {
const { tpmLoading } = this.props; const { tpmLoading } = this.props;
const user = this.props.current_user; const user = this.props.current_user;
return ( return (
<React.Fragment> <React.Fragment>
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> : { tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
<TPMForklist <TPMForklist
{...this.props} {...this.props}
{...this.state} {...this.state}
user={user} user={user}
aboutFocus={this.props.aboutFocus} aboutFocus={this.props.aboutFocus}
is_jupyter={this.props.is_jupyter}
> >
</TPMForklist> </TPMForklist>
} }
</React.Fragment> </React.Fragment>
); );
} }
} }
export default TPMRanking_listContainer; export default TPMRanking_listContainer;

@ -1,63 +1,64 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import './TPMShixunDiscuss.css' import './TPMShixunDiscuss.css'
import Shixunfork_list from './shixunchild/Shixunfork_list' import Shixunfork_list from './shixunchild/Shixunfork_list'
import TPMRightSection from './component/TPMRightSection' import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav' import TPMNav from './component/TPMNav'
class TPMForklist extends Component { class TPMForklist extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
} }
componentDidMount() { componentDidMount() {
} }
render() { render() {
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
aboutFocus, user, match aboutFocus, user, match
} = this.props; } = this.props;
return ( return (
<React.Fragment> <React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80"> <div className="tpmComment educontent clearfix mt30 mb80">
<div className="with65 fl edu-back-white commentsDelegateParent" > <div className="with65 fl edu-back-white commentsDelegateParent" >
<TPMNav <TPMNav
match={match} match={match}
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
></TPMNav> is_jupyter={this.props.is_jupyter}
{ loadingContent ? ></TPMNav>
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> : { loadingContent ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
<Shixunfork_list/>
} <Shixunfork_list/>
</div> }
</div>
<div className="with35 fr pl20">
<TPMRightSection {...this.props}></TPMRightSection> <div className="with35 fr pl20">
</div> <TPMRightSection {...this.props}></TPMRightSection>
</div> </div>
</React.Fragment> </div>
</React.Fragment>
);
} );
} }
}
export default TPMForklist;
export default TPMForklist;

@ -20,6 +20,8 @@ import TPMRepositoryComponent from './TPMRepositoryComponent';
import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits'; import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits';
//import TPMsettings from './TPMsettings/TPMsettings';
import TPMsettings from './TPMsettings/oldTPMsettings'; import TPMsettings from './TPMsettings/oldTPMsettings';
import TPMChallengeComponent from './TPMChallengeContainer'; import TPMChallengeComponent from './TPMChallengeContainer';
@ -29,6 +31,7 @@ import TPMCollaboratorsComponent from './TPMCollaboratorsContainer';
import Audit_situationComponent from './Audit_situationComponent'; import Audit_situationComponent from './Audit_situationComponent';
import TPMDataset from './TPMDataset'; import TPMDataset from './TPMDataset';
import '../page/tpiPage.css' import '../page/tpiPage.css'
import TPMNav from "./component/TPMNav";
const $ = window.$ const $ = window.$
//任务 //任务
@ -143,6 +146,7 @@ class TPMIndex extends Component {
TPMRightSectionData:undefined, TPMRightSectionData:undefined,
PropaedeuticsList: undefined, PropaedeuticsList: undefined,
tpmindexjupyterbool:false, tpmindexjupyterbool:false,
is_jupyter:false,
} }
} }
@ -193,7 +197,7 @@ class TPMIndex extends Component {
propaedeutics:response.data.propaedeutics, propaedeutics:response.data.propaedeutics,
status: response.data.shixun_status, status: response.data.shixun_status,
secret_repository: response.data.secret_repository, secret_repository: response.data.secret_repository,
is_jupyter:response.data.is_jupyter=== undefined||response.data.is_jupyter===null?false:response.data.is_jupyter,
}); });
} }
}).catch((error) => { }).catch((error) => {
@ -205,7 +209,8 @@ class TPMIndex extends Component {
power: undefined, power: undefined,
identity: undefined, identity: undefined,
status: undefined, status: undefined,
propaedeutics:undefined propaedeutics:undefined,
is_jupyter:false,
}); });
}); });
@ -274,6 +279,7 @@ class TPMIndex extends Component {
let url = window.location.href; let url = window.location.href;
let flag = url.indexOf("add_file")>-1; let flag = url.indexOf("add_file")>-1;
console.log(this.state.is_jupyter);
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*头部*/} {/*头部*/}
@ -295,16 +301,16 @@ class TPMIndex extends Component {
<Switch {...this.props}> <Switch {...this.props}>
<Route path="/shixuns/:shixunId/repository/:repoId/commits" render={ <Route path="/shixuns/:shixunId/repository/:repoId/commits" render={
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} (props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
<Route path="/shixuns/:shixunId/secret_repository/:repoId/commits" render={ <Route path="/shixuns/:shixunId/secret_repository/:repoId/commits" render={
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} secret_repository_tab={true} (props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
{/*任务*/}
<Route exact path="/shixuns/:shixunId/challenges" render={ <Route exact path="/shixuns/:shixunId/challenges" render={
(props) => (<TPMChallengeComponent {...this.props} jupyterbool={true} {...this.state} {...props} (props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
@ -314,24 +320,24 @@ class TPMIndex extends Component {
}></Route> }></Route>
<Route path="/shixuns/:shixunId/repository" render={ <Route path="/shixuns/:shixunId/repository" render={
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
<Route path="/shixuns/:shixunId/secret_repository" render={ <Route path="/shixuns/:shixunId/secret_repository" render={
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
{/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */} {/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */}
<Route exact path="/shixuns/:shixunId/propaedeutics" render={ <Route exact path="/shixuns/:shixunId/propaedeutics" render={
(props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props} (props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId/collaborators" render={ <Route exact path="/shixuns/:shixunId/collaborators" render={
(props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props} (props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
@ -340,7 +346,7 @@ class TPMIndex extends Component {
<Route path="/shixuns/:shixunId/shixun_discuss" render={ <Route path="/shixuns/:shixunId/shixun_discuss" render={
(props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props} (props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
initForumState={(data)=>this.initForumState(data)} initForumState={(data)=>this.initForumState(data)}
setSearchValue={this.setSearchValue} setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex} setHotLabelIndex={this.setHotLabelIndex}
@ -354,17 +360,17 @@ class TPMIndex extends Component {
{/*实训项目条目塞选*/} {/*实训项目条目塞选*/}
<Route exact path="/shixuns/:shixunId/ranking_list" render={ <Route exact path="/shixuns/:shixunId/ranking_list" render={
(props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props} (props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
{/*合作者*/}
<Route exact path="/shixuns/:shixunId/dataset" render={ <Route exact path="/shixuns/:shixunId/dataset" render={
(props) => (<TPMDataset {...this.props} {...this.state} {...props} (props) => (<TPMDataset {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId/audit_situation" render={ <Route exact path="/shixuns/:shixunId/audit_situation" render={
(props) => (<Audit_situationComponent {...this.props} {...this.state} {...props} (props) => (<Audit_situationComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>
@ -415,7 +421,7 @@ class TPMIndex extends Component {
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId" render={ <Route exact path="/shixuns/:shixunId" render={
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} (props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
/>) />)
}></Route> }></Route>

@ -1,74 +1,75 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import './TPMShixunDiscuss.css' import './TPMShixunDiscuss.css'
import Propaedeutics from './shixunchild/Propaedeutics/Propaedeu_tics' import Propaedeutics from './shixunchild/Propaedeutics/Propaedeu_tics'
import TPMRightSection from './component/TPMRightSection' import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav' import TPMNav from './component/TPMNav'
import axios from 'axios'; import axios from 'axios';
class TPMPropaedeutics extends Component { class TPMPropaedeutics extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
shixunId: undefined shixunId: undefined
} }
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
} }
componentDidMount() { componentDidMount() {
} }
render() { render() {
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
aboutFocus, user, match aboutFocus, user, match
} = this.props; } = this.props;
// <Comments // <Comments
// {...this.props} // {...this.props}
// user={_user} // user={_user}
// onPaginationChange={this.onPaginationChange} // onPaginationChange={this.onPaginationChange}
// ></Comments> // ></Comments>
return ( return (
<React.Fragment> <React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80"> <div className="tpmComment educontent clearfix mt30 mb80">
<div className="with65 fl edu-back-white commentsDelegateParent" > <div className="with65 fl edu-back-white commentsDelegateParent" >
<TPMNav <TPMNav
match={match} match={match}
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.state} {...this.state}
{...this.props} {...this.props}
/> is_jupyter={this.props.is_jupyter}
/>
<Propaedeutics
{...this.props} <Propaedeutics
{...this.state} {...this.props}
/> {...this.state}
/>
</div>
</div>
<div className="with35 fr pl20">
<TPMRightSection {...this.props}></TPMRightSection> <div className="with35 fr pl20">
</div> <TPMRightSection {...this.props}></TPMRightSection>
</div> </div>
</React.Fragment> </div>
</React.Fragment>
);
} );
} }
}
export default TPMPropaedeutics;
export default TPMPropaedeutics;

@ -1,39 +1,40 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import TPMPropaedeutics from './TPMPropaedeutics' import TPMPropaedeutics from './TPMPropaedeutics'
import axios from 'axios'; import axios from 'axios';
class TPMPropaedeuticsComponent extends Component { class TPMPropaedeuticsComponent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
// tpmLoading: true, // tpmLoading: true,
// creator: { // creator: {
// owner_id: '' // owner_id: ''
// } // }
} }
} }
render() { render() {
const { tpmLoading } = this.props; const { tpmLoading } = this.props;
return ( return (
<React.Fragment> <React.Fragment>
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> : { tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
<TPMPropaedeutics <TPMPropaedeutics
{...this.props} {...this.props}
> is_jupyter={this.props.is_jupyter}
</TPMPropaedeutics> >
} </TPMPropaedeutics>
</React.Fragment> }
</React.Fragment>
);
} );
} }
}
export default TPMPropaedeuticsComponent ;
export default TPMPropaedeuticsComponent ;

@ -1,59 +1,60 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import './TPMShixunDiscuss.css' import './TPMShixunDiscuss.css'
import Ranking_list from './shixunchild/Ranking_list/Ranking_list' import Ranking_list from './shixunchild/Ranking_list/Ranking_list'
import TPMRightSection from './component/TPMRightSection' import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav' import TPMNav from './component/TPMNav'
class TPMRanking_list extends Component { class TPMRanking_list extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
render() { render() {
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
aboutFocus, user, match aboutFocus, user, match
} = this.props; } = this.props;
// <Comments // <Comments
// {...this.props} // {...this.props}
// user={_user} // user={_user}
// onPaginationChange={this.onPaginationChange} // onPaginationChange={this.onPaginationChange}
// ></Comments> // ></Comments>
return ( return (
<React.Fragment> <React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80"> <div className="tpmComment educontent clearfix mt30 mb80">
<div className="with65 fl edu-back-white commentsDelegateParent" > <div className="with65 fl edu-back-white commentsDelegateParent" >
<TPMNav <TPMNav
match={match} match={match}
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
></TPMNav> is_jupyter={this.props.is_jupyter}
></TPMNav>
<Ranking_list
{...this.props} <Ranking_list
/> {...this.props}
/>
</div>
</div>
<div className="with35 fr pl20">
<TPMRightSection {...this.props}></TPMRightSection> <div className="with35 fr pl20">
</div> <TPMRightSection {...this.props}></TPMRightSection>
</div> </div>
</React.Fragment> </div>
</React.Fragment>
);
} );
} }
}
export default TPMRanking_list;
export default TPMRanking_list;

@ -1,37 +1,40 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import TPMRanking_list from './TPMRanking_list' import TPMRanking_list from './TPMRanking_list'
import axios from 'axios'; import axios from 'axios';
import TPMNav from "./component/TPMNav";
class TPMRanking_listContainer extends Component {
constructor(props) { class TPMRanking_listContainer extends Component {
super(props) constructor(props) {
this.state = { super(props)
} this.state = {
} }
}
render() {
const { tpmLoading } = this.props; render() {
const user = this.props.current_user; const { tpmLoading } = this.props;
const user = this.props.current_user;
return (
<React.Fragment> return (
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> : <React.Fragment>
<TPMRanking_list { tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
{...this.props} <TPMRanking_list
{...this.state} {...this.props}
user={user} {...this.state}
aboutFocus={this.props.aboutFocus} user={user}
> aboutFocus={this.props.aboutFocus}
</TPMRanking_list> is_jupyter={this.props.is_jupyter}
}
</React.Fragment> >
); </TPMRanking_list>
} }
} </React.Fragment>
);
export default TPMRanking_listContainer; }
}
export default TPMRanking_listContainer;

@ -1,58 +1,59 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import './TPMShixunDiscuss.css' import './TPMShixunDiscuss.css'
import Repository from './shixunchild/Repository/Repository' import Repository from './shixunchild/Repository/Repository'
import TPMRightSection from './component/TPMRightSection' import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav' import TPMNav from './component/TPMNav'
// import RepositoryChooseModal from './component/modal/RepositoryChooseModal' // import RepositoryChooseModal from './component/modal/RepositoryChooseModal'
class TPMRepository extends Component { class TPMRepository extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
render() { render() {
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
aboutFocus, user, match, isContentWidth100 aboutFocus, user, match, isContentWidth100
} = this.props; } = this.props;
return ( return (
<React.Fragment> <React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80"> <div className="tpmComment educontent clearfix mt30 mb80">
{/* 可能会影响到其他页面的样式,需要测试、协商 */} {/* 可能会影响到其他页面的样式,需要测试、协商 */}
<div className={`${isContentWidth100 ? 'width100': 'with65'} fl edu-back-white`} <div className={`${isContentWidth100 ? 'width100': 'with65'} fl edu-back-white`}
style={{background: 'transparent'}}> style={{background: 'transparent'}}>
<TPMNav <TPMNav
match={match} match={match}
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
></TPMNav> is_jupyter={this.props.is_jupyter}
{/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */} ></TPMNav>
{ loadingContent ? {/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */}
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> : { loadingContent ?
<Repository <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
{...this.props} <Repository
/> {...this.props}
} />
</div> }
</div>
{ !isContentWidth100 && <div className="with35 fr pl20">
<TPMRightSection {...this.props}></TPMRightSection> { !isContentWidth100 && <div className="with35 fr pl20">
</div>} <TPMRightSection {...this.props}></TPMRightSection>
</div> </div>}
</React.Fragment> </div>
</React.Fragment>
);
} );
} }
}
export default TPMRepository;
export default TPMRepository;

@ -1,229 +1,230 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import TPMRepository from './TPMRepository' import TPMRepository from './TPMRepository'
import axios from 'axios'; import axios from 'axios';
import { trace_collapse, info } from 'educoder' import { trace_collapse, info } from 'educoder'
import RepositoryCodeEditor from './shixunchild/Repository/RepositoryCodeEditor' import RepositoryCodeEditor from './shixunchild/Repository/RepositoryCodeEditor'
class TPMRepositoryComponent extends Component { class TPMRepositoryComponent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.nameTypeMap = {} this.nameTypeMap = {}
let pathArray = [] let pathArray = []
var splitArray = window.location.pathname.split('shixun_show/'); var splitArray = window.location.pathname.split('shixun_show/');
if (splitArray[1]) { if (splitArray[1]) {
pathArray = splitArray[1].split('/') pathArray = splitArray[1].split('/')
if (pathArray[pathArray.length - 1] == '') { if (pathArray[pathArray.length - 1] == '') {
// 有可能是这么访问的: http://localhost:3007/shixuns/3ozvy5f8/repository/fsu7tkaw/master/shixun_show/src/ // 有可能是这么访问的: http://localhost:3007/shixuns/3ozvy5f8/repository/fsu7tkaw/master/shixun_show/src/
pathArray.length = pathArray.length - 1; pathArray.length = pathArray.length - 1;
} }
} }
this.state = { this.state = {
repositoryLoading: true, repositoryLoading: true,
pathArray: pathArray, pathArray: pathArray,
isContentWidth100: this._isFileInPathArray(pathArray) isContentWidth100: this._isFileInPathArray(pathArray)
} }
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (this.props.secret_repository_tab != prevProps.secret_repository_tab) { if (this.props.secret_repository_tab != prevProps.secret_repository_tab) {
this.fetchRepo() this.fetchRepo()
} }
} }
componentDidMount = () => { componentDidMount = () => {
this.fetchRepo() this.fetchRepo()
} }
setContentWidth100 = (flag) => { setContentWidth100 = (flag) => {
const newFileContent = flag === false ? '' : this.state.fileContent const newFileContent = flag === false ? '' : this.state.fileContent
this.setState({ this.setState({
// isCodeFile // isCodeFile
isContentWidth100: flag, isContentWidth100: flag,
fileContent: newFileContent fileContent: newFileContent
}) })
} }
saveCode = (content) => { saveCode = (content) => {
const path = this.state.pathArray.join('/') const path = this.state.pathArray.join('/')
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_file.json`; let url = `/shixuns/${id}/update_file.json`;
axios.post(url, { axios.post(url, {
path: path, path: path,
content content
}).then((response) => { }).then((response) => {
if(response.status === 200){ if(response.status === 200){
this.setState({ this.setState({
fileContent: response.data.content, fileContent: response.data.content,
repositoryLoading: false repositoryLoading: false
}); });
} }
trace_collapse('tpm save code res: ', response) trace_collapse('tpm save code res: ', response)
this.props.showSnackbar('文件保存成功') this.props.showSnackbar('文件保存成功')
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}); });
} }
fetchCode = (newPathArray) => { fetchCode = (newPathArray) => {
const path = newPathArray.join('/') const path = newPathArray.join('/')
// https://testeduplus2.educoder.net/shixuns/3ozvy5f8/file_content.json // https://testeduplus2.educoder.net/shixuns/3ozvy5f8/file_content.json
this.setContentWidth100(true) this.setContentWidth100(true)
this.setState({ repositoryLoading: true, pathArray: newPathArray }) this.setState({ repositoryLoading: true, pathArray: newPathArray })
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/file_content.json`; let url = `/shixuns/${id}/file_content.json`;
axios.post(url, { axios.post(url, {
path: path, path: path,
secret_repository: this.props.secret_repository_tab secret_repository: this.props.secret_repository_tab
}).then((response) => { }).then((response) => {
trace_collapse('repository res: ', response) trace_collapse('repository res: ', response)
if (response.data.status == -1) { if (response.data.status == -1) {
this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!') this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!')
return; return;
} }
if(response.status === 200){ if(response.status === 200){
this.setState({ this.setState({
fileContent: response.data.content, fileContent: response.data.content,
repositoryLoading: false repositoryLoading: false
}); });
this.props.history this.props.history
.replace(`${this.props.match.url}/master/shixun_show/${newPathArray.join('/')}`) .replace(`${this.props.match.url}/master/shixun_show/${newPathArray.join('/')}`)
} }
}).catch((error)=>{ }).catch((error)=>{
this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!') this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!')
console.log(error) console.log(error)
}); });
} }
_isFileName = (name) => { _isFileName = (name) => {
return name.indexOf('.') !== -1 return name.indexOf('.') !== -1
} }
_isFileInPathArray = (array) => { _isFileInPathArray = (array) => {
if (!array || array.length === 0) { if (!array || array.length === 0) {
return false return false
} }
return this.nameTypeMap[array[array.length - 1]] !== 'tree' && this._isFileName( array[array.length - 1] ) return this.nameTypeMap[array[array.length - 1]] !== 'tree' && this._isFileName( array[array.length - 1] )
} }
// listItem 如果是num则是通过面包屑点击过来的取pathArray的子集 // listItem 如果是num则是通过面包屑点击过来的取pathArray的子集
fetchRepo = (listItem) => { fetchRepo = (listItem) => {
const { pathArray } = this.state; const { pathArray } = this.state;
let newPathArray = pathArray.slice(0) let newPathArray = pathArray.slice(0)
if (listItem === 0 || listItem) { if (listItem === 0 || listItem) {
this.setContentWidth100(false) this.setContentWidth100(false)
this.nameTypeMap[listItem.name] = listItem.type this.nameTypeMap[listItem.name] = listItem.type
if (typeof listItem == 'number') { // 参数是数字的话,做截取 if (typeof listItem == 'number') { // 参数是数字的话,做截取
// if (this._isFileName(newPathArray[listItem])) { // 面包屑中的文件不让点击了 // if (this._isFileName(newPathArray[listItem])) { // 面包屑中的文件不让点击了
// listItem--; // listItem--;
// } // }
newPathArray = newPathArray.slice(0, listItem) newPathArray = newPathArray.slice(0, listItem)
} else if (listItem.type === 'tree') { } else if (listItem.type === 'tree') {
newPathArray.push(listItem.name) newPathArray.push(listItem.name)
} else if (listItem.type === 'blob') { } else if (listItem.type === 'blob') {
newPathArray.push(listItem.name) newPathArray.push(listItem.name)
this.setState({ pathArray: newPathArray }) this.setState({ pathArray: newPathArray })
this.fetchCode(newPathArray) this.fetchCode(newPathArray)
return; return;
} }
} }
// https://testeduplus2.educoder.net/shixuns/3ozvy5f8/repository.json // https://testeduplus2.educoder.net/shixuns/3ozvy5f8/repository.json
this.setState({ repositoryLoading: true, pathArray: newPathArray }) this.setState({ repositoryLoading: true, pathArray: newPathArray })
let urlNewPathArray = newPathArray; let urlNewPathArray = newPathArray;
let fileInPathArray = false; let fileInPathArray = false;
if (newPathArray.length) { if (newPathArray.length) {
fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree' fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree'
: (listItem ? listItem.type !== 'tree' : this._isFileName( newPathArray[newPathArray.length - 1] )) : (listItem ? listItem.type !== 'tree' : this._isFileName( newPathArray[newPathArray.length - 1] ))
if ( fileInPathArray ) { if ( fileInPathArray ) {
urlNewPathArray = newPathArray.slice(0, newPathArray.length - 1) urlNewPathArray = newPathArray.slice(0, newPathArray.length - 1)
} }
} }
const path = urlNewPathArray.join('/') const path = urlNewPathArray.join('/')
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}.json`; let url = `/shixuns/${id}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}.json`;
// this.props.setLoadingContent(true) // this.props.setLoadingContent(true)
axios.post(url, { axios.post(url, {
path: path ? path : '' path: path ? path : ''
}).then((response) => { }).then((response) => {
// this.props.setLoadingContent(false) // this.props.setLoadingContent(false)
const trees = response.data.trees const trees = response.data.trees
const treeIsFileMap = {} const treeIsFileMap = {}
if (!trees || !Array.isArray(trees)) { if (!trees || !Array.isArray(trees)) {
// this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!') // this.props.showSnackbar('无法找到对应的资源,请变更地址或联系管理员!')
// return; // return;
} else { } else {
trees.forEach(item => { trees.forEach(item => {
treeIsFileMap[item.name] = item.type == 'blob' treeIsFileMap[item.name] = item.type == 'blob'
}) })
} }
if(response.status === 200){ if(response.status === 200){
this.setState({ this.setState({
treeIsFileMap, treeIsFileMap,
...response.data, ...response.data,
repositoryLoading: false repositoryLoading: false
}); });
this.props.history this.props.history
.replace(`${this.props.match.url}` + .replace(`${this.props.match.url}` +
(newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : '')) (newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : ''))
} }
// 初始化时repo接口完毕后需要看是否需要fetchCode // 初始化时repo接口完毕后需要看是否需要fetchCode
if (fileInPathArray) { if (fileInPathArray) {
this.fetchCode(newPathArray) this.fetchCode(newPathArray)
} }
// info(response) // info(response)
trace_collapse('repository res: ', response) trace_collapse('repository res: ', response)
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}); });
} }
render() { render() {
const { isContentWidth100 } = this.state; const { isContentWidth100 } = this.state;
// 需要重构 // 需要重构
return ( return (
<React.Fragment> <React.Fragment>
{ !isContentWidth100 ? <TPMRepository { !isContentWidth100 ? <TPMRepository
{...this.props} {...this.props}
{...this.state} {...this.state}
nameTypeMap={this.nameTypeMap} nameTypeMap={this.nameTypeMap}
fetchRepo={this.fetchRepo} fetchRepo={this.fetchRepo}
> is_jupyter={this.props.is_jupyter}
</TPMRepository> >
: </TPMRepository>
<div className="tpmComment educontent clearfix mt30 mb80"> :
{/* 可能会影响到其他页面的样式,需要测试、协商 */} <div className="tpmComment educontent clearfix mt30 mb80">
<div className={`width100 fl edu-back-white`} {/* 可能会影响到其他页面的样式,需要测试、协商 */}
style={{background: 'transparent'}}> <div className={`width100 fl edu-back-white`}
<RepositoryCodeEditor style={{background: 'transparent'}}>
{...this.state} <RepositoryCodeEditor
{...this.props} {...this.state}
fetchRepo={this.fetchRepo} {...this.props}
saveCode={this.saveCode} fetchRepo={this.fetchRepo}
nameTypeMap={this.nameTypeMap} saveCode={this.saveCode}
nameTypeMap={this.nameTypeMap}
></RepositoryCodeEditor>
</div> ></RepositoryCodeEditor>
</div> </div>
} </div>
}
</React.Fragment>
</React.Fragment>
);
} );
} }
}
export default TPMRepositoryComponent ;
export default TPMRepositoryComponent ;

@ -1,72 +1,73 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import './TPMShixunDiscuss.css' import './TPMShixunDiscuss.css'
import ShixunDiscuss from './shixunchild/ShixunDiscuss/ShixunDiscuss' import ShixunDiscuss from './shixunchild/ShixunDiscuss/ShixunDiscuss'
import TPMRightSection from './component/TPMRightSection' import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav' import TPMNav from './component/TPMNav'
import Comments from '../comment/Comments' import Comments from '../comment/Comments'
import { commentHOC } from '../comment/CommentsHOC' import { commentHOC } from '../comment/CommentsHOC'
class TPMShixunDiscuss extends Component { class TPMShixunDiscuss extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
} }
componentDidMount() { componentDidMount() {
// TODO 加了HOC后 mount了两次 // TODO 加了HOC后 mount了两次
this.props.fetchCommentIfNotFetched && this.props.fetchCommentIfNotFetched &&
this.props.fetchCommentIfNotFetched(); this.props.fetchCommentIfNotFetched();
} }
render() { render() {
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
aboutFocus, user, match aboutFocus, user, match
} = this.props; } = this.props;
return ( return (
<React.Fragment> <React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80"> <div className="tpmComment educontent clearfix mt30 mb80">
<div className="with65 fl edu-back-white commentsDelegateParent" > <div className="with65 fl edu-back-white commentsDelegateParent" >
<TPMNav <TPMNav
match={match} match={match}
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
></TPMNav> is_jupyter={this.props.is_jupyter}
{ loadingContent ? ></TPMNav>
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> : { loadingContent ?
<Comments <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :
{...this.props} <Comments
user={user} {...this.props}
showHiddenButton={true} user={user}
></Comments> showHiddenButton={true}
// onPaginationChange={this.onPaginationChange} ></Comments>
// <ShixunDiscuss // onPaginationChange={this.onPaginationChange}
// {...this.props} // <ShixunDiscuss
// /> // {...this.props}
} // />
</div> }
</div>
<div className="with35 fr pl20">
<TPMRightSection {...this.props}></TPMRightSection> <div className="with35 fr pl20">
</div> <TPMRightSection {...this.props}></TPMRightSection>
</div> </div>
</React.Fragment> </div>
</React.Fragment>
);
} );
} }
}
export default commentHOC ( TPMShixunDiscuss );
export default commentHOC ( TPMShixunDiscuss );

@ -1,45 +1,45 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import TPMShixunDiscuss from './TPMShixunDiscuss' import TPMShixunDiscuss from './TPMShixunDiscuss'
import axios from 'axios'; import axios from 'axios';
class TPMShixunDiscussContainer extends Component { class TPMShixunDiscussContainer extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
} }
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
} }
componentDidMount() { componentDidMount() {
} }
render() { render() {
const { tpmLoading } = this.props; const { tpmLoading } = this.props;
const user = this.props.current_user; const user = this.props.current_user;
return ( return (
<React.Fragment> <React.Fragment>
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> : { tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
<TPMShixunDiscuss <TPMShixunDiscuss
{...this.props} {...this.props}
{...this.state} {...this.state}
user={user} user={user}
aboutFocus={this.props.aboutFocus} aboutFocus={this.props.aboutFocus}
is_jupyter={this.props.is_jupyter}
> >
</TPMShixunDiscuss> </TPMShixunDiscuss>
} }
</React.Fragment> </React.Fragment>
); );
} }
} }
export default TPMShixunDiscussContainer; export default TPMShixunDiscussContainer;

@ -33,7 +33,24 @@ const Option = Select.Option;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const confirm = Modal.confirm; const confirm = Modal.confirm;
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
}
function disabledDateTime() {
return {
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
// disabledSeconds: () => [0, 60],
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
export default class Shixuninformation extends Component { export default class Shixuninformation extends Component {
@ -63,7 +80,7 @@ export default class Shixuninformation extends Component {
}) })
} }
return ( return (
<div> <div className="educontent mb50 edu-back-white padding10-20">
<div className="clearfix ml30"> <div className="clearfix ml30">
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>复制:</span> <span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>复制:</span>
<span className="fl mt5"> <span className="fl mt5">

@ -23,7 +23,7 @@ export default class Shixuninformation extends Component {
render() { render() {
return ( return (
<div> <div className="educontent mb50 edu-back-white padding10-20">
1111 1111
</div> </div>
); );

@ -11,17 +11,10 @@ import Configuration from './Configuration';
import LearningSettings from './LearningSettings'; import LearningSettings from './LearningSettings';
import Bottomsubmit from "../../modals/Bottomsubmit";
import moment from 'moment';
import axios from 'axios'; import axios from 'axios';
import './css/TPMsettings.css'; import './css/TPMsettings.css';
import {getImageUrl, toPath, getUrl, appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
const {TabPane} = Tabs; const {TabPane} = Tabs;
// 处理整点 半点 // 处理整点 半点
@ -90,9 +83,21 @@ export default class TPMsettings extends Component {
render() { render() {
return ( return (
<div>
<div className="educontent mt30 mb50 edu-back-white padding10-20"> <div>
<style>
{
`
.ant-tabs-bar{
width: 1200px;
margin: 0 auto;
background: #fff;
border-bottom: 0px;
margin-top: 30px!important;
}
`
}
</style>
<Tabs tabBarExtraContent={ <Tabs tabBarExtraContent={
<div className={"mb20"}> <div className={"mb20"}>
<Button type="primary" ghost className={"Permanentban"}> <Button type="primary" ghost className={"Permanentban"}>
@ -124,9 +129,6 @@ export default class TPMsettings extends Component {
</Tabs> </Tabs>
</div> </div>
<Bottomsubmit/>
</div>
); );
} }
} }

@ -5,7 +5,7 @@ import { BrowserRouter as Router, Route, Link } from "react-router-dom";
class TPMNav extends Component { class TPMNav extends Component {
render() { render() {
const { user, match, shixun, secret_repository } = this.props; const { user, match, shixun, secret_repository,is_jupyter} = this.props;
let isAdminOrCreator = false; let isAdminOrCreator = false;
if (user) { if (user) {
isAdminOrCreator = user.admin || user.manager isAdminOrCreator = user.admin || user.manager
@ -15,6 +15,8 @@ class TPMNav extends Component {
// console.log(this.props.propaedeutics) // console.log(this.props.propaedeutics)
const challengesPath = `/shixuns/${shixunId}/challenges`; const challengesPath = `/shixuns/${shixunId}/challenges`;
// console.log(match.path) // console.log(match.path)
console.log("TPMNavTPMNavTPMNav");
console.log(is_jupyter);
return ( return (
<div className="bor-bottom-greyE clearfix pl20 pr20 pt40 pb20 edu-back-white challengeNav"> <div className="bor-bottom-greyE clearfix pl20 pr20 pt40 pb20 edu-back-white challengeNav">
<Link <Link
@ -28,8 +30,15 @@ class TPMNav extends Component {
>背景知识</Link> >背景知识</Link>
} }
{ this.props.identity >4||this.props.identity===undefined ?"":<Link to={`/shixuns/${shixunId}/repository`} { this.props.identity >4||this.props.identity===undefined ?"":
className={`${match.url.indexOf('/repository') != -1 ? 'active' : ''} fl mr40`}>版本库</Link>} (this.props.is_jupyter===false?
<Link to={`/shixuns/${shixunId}/repository`}
className={`${match.url.indexOf('/repository') != -1 ? 'active' : ''} fl mr40`}>版本库</Link>
:"")
}
{this.props.identity >4||this.props.identity===undefined ?"": secret_repository && <Link to={`/shixuns/${shixunId}/secret_repository`} {this.props.identity >4||this.props.identity===undefined ?"": secret_repository && <Link to={`/shixuns/${shixunId}/secret_repository`}
className={`${match.url.indexOf('secret_repository') != -1 ? 'active' : ''} fl mr40`}>私密版本库</Link>} className={`${match.url.indexOf('secret_repository') != -1 ? 'active' : ''} fl mr40`}>私密版本库</Link>}
@ -37,8 +46,13 @@ class TPMNav extends Component {
className={`${match.url.indexOf('collaborators') != -1 ? 'active' : ''} fl mr40`}>合作者</Link> className={`${match.url.indexOf('collaborators') != -1 ? 'active' : ''} fl mr40`}>合作者</Link>
{/*jupyter*/} {/*jupyter*/}
<Link to={`/shixuns/${shixunId}/dataset`} {
className={`${match.url.indexOf('dataset') != -1 ? 'active' : ''} fl mr40`}>数据集</Link> this.props.is_jupyter===true?
<Link to={`/shixuns/${shixunId}/dataset`}
className={`${match.url.indexOf('dataset') != -1 ? 'active' : ''} fl mr40`}>数据集</Link>
:""
}
<Link to={`/shixuns/${shixunId}/shixun_discuss`} <Link to={`/shixuns/${shixunId}/shixun_discuss`}
className={`${match.url.indexOf('shixun_discuss') != -1 ? 'active' : ''} fl mr40`}>评论</Link> className={`${match.url.indexOf('shixun_discuss') != -1 ? 'active' : ''} fl mr40`}>评论</Link>

@ -265,7 +265,7 @@ class Newshixuns extends Component {
{ {
message: '提示', message: '提示',
description: description:
'提交成功!', '新建申请已提交,请等待管理员审核。',
} }
) )
@ -589,10 +589,12 @@ class Newshixuns extends Component {
)} )}
<span className="fl ml20 color-grey lineh-20"> <span className="fl ml20 color-grey lineh-20">
<div> <div>
{this.state.mainvalues === undefined && this.state.subvalues === undefined ? "" : {this.state.mainvalues === undefined && this.state.subvalues === undefined||this.state.mainvalues === "" && this.state.subvalues === "" ? "" :
<div className={"font-12"} style={{'max-width':'700px'}}> <div className={"font-12"} style={{'max-width':'700px'}}>
{`已安装软件:${this.state.mainvalues===undefined?"":this.state.mainvalues}${this.state.subvalues===undefined?"":this.state.subvalues}`} {`${this.state.mainvalues===undefined||this.state.mainvalues=== ""?"":`已安装软件:`+this.state.mainvalues}`}
{` 说明:添加了${this.state.mainvalues===undefined?"":this.state.mainvalues}${this.state.subvalues===undefined?"":this.state.subvalues}`} {`${this.state.subvalues===undefined||this.state.subvalues=== ""?"":this.state.mainvalues===undefined||this.state.mainvalues=== ""?`已安装软件:`+this.state.subvalues:this.state.subvalues}`}
{`${this.state.mainvalues===undefined||this.state.mainvalues=== ""?"":`说明:添加了`+this.state.mainvalues}${this.state.subvalues===undefined||this.state.subvalues=== ""?"":
this.state.mainvalues===undefined||this.state.mainvalues=== ""?`说明:添加了`+this.state.subvalues:this.state.subvalues}`}
</div>} </div>}
</div> </div>
@ -697,27 +699,6 @@ class Newshixuns extends Component {
{/*</Form>*/} {/*</Form>*/}
</Modal> </Modal>
<Modal
keyboard={false}
title="提示"
visible={postapplytitle}
closable={false}
footer={null}
>
<div>
<div className="task-popup-content"><p
className="task-popup-text-center font-16"><span
className="font-17 mt10">新建申请已提交请等待管理员的审核</span></p>
<li className="font-14 mt15 color-grey-6 edu-txt-center">我们将在1-2个工作日内与您联系
</li>
</div>
<div className="task-popup-OK clearfix">
<a className="task-btn task-btn-orange"
onClick={this.yeshidemodel}>知道啦</a>
</div>
</div>
</Modal>
</div> </div>
</div> </div>

@ -60,11 +60,26 @@ class Challengesjupyter extends Component {
componentDidMount() { componentDidMount() {
setTimeout(this.ChallengesList(), 1000); setTimeout(this.ChallengesList(), 1000);
// console.log("componentDidMount");
// console.log("Challengesjupyter");
// console.log(this.props);
let id = this.props.match.params.shixunId;
let ChallengesURL = `/jupyters/get_info_with_tpm.json`;
let datas={
identifier:id,
}
axios.get(ChallengesURL, {params: datas}).then((response) => {
if (response.status === 200) {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
console.log("componentDidMount"); }else{
console.log("Challengesjupyter"); console.log("componentDidMountChallengesjupyter");
console.log(this.props); console.log(response.data);
}
}
}).catch((error) => {
console.log(error)
});
@ -125,15 +140,21 @@ class Challengesjupyter extends Component {
console.log("propsysl"); console.log("propsysl");
console.log(propsysl); console.log(propsysl);
let id=this.props.match.params.shixunId; let id=this.props.match.params.shixunId;
var jupyter_port="";
try{
jupyter_port= parseInt(propsysl.shixunsDetails.jupyter_port);
}catch (e) {
jupyter_port=propsysl.shixunsDetails.jupyter_port;
}
const url=`/shixuns/${id}/update_jupyter.json`; const url=`/shixuns/${id}/update_jupyter.json`;
const data={ const data={
identifier:id, identifier:id,
jupyter_port:propsysl.shixunsDetails.jupyter_port jupyter_port:jupyter_port,
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status === 0) {
this.props.showNotification(`应用成功`); this.props.showNotification(`应用成功`);
} }
}).catch((error) => { }).catch((error) => {

@ -3,6 +3,11 @@
line-height: 30px; line-height: 30px;
} }
.height28 {
height: 30px;
line-height:28px;
}
.line27{ .line27{
line-height: 27px; line-height: 27px;
vertical-align: 1px; vertical-align: 1px;

@ -457,7 +457,7 @@ class Collaborators extends Component {
style={{display:this.props.identity<5?"flex":"none"}} style={{display:this.props.identity<5?"flex":"none"}}
> >
<div className="yslwushiwidth"> <div className="yslwushiwidth">
<p className="edu-default-btn edu-greenback-btn ml20 height40 yslwushiwidthcolortest">共12</p> <p className="edu-default-btn edu-greenback-btn ml20 height28 yslwushiwidthcolortest">{collaboratorList&&collaboratorList.length}</p>
</div> </div>
<div className="yslwushiwidth xaxisreverseorder"> <div className="yslwushiwidth xaxisreverseorder">
@ -469,7 +469,13 @@ class Collaborators extends Component {
<a onClick={() => this.showCollaboratorsvisible("admin")} <a onClick={() => this.showCollaboratorsvisible("admin")}
style={{display:this.props.identity===1?"flex":"none"}} style={{display:this.props.identity===1?"flex":"none"}}
data-remote="true" data-remote="true"
className="edu-default-btn edu-greenback-btn mr20 height40 yslwushiwidthbuton">更换管理员</a> className="edu-default-btn edu-greenback-btn mr20 height40 yslwushiwidthbuton">
<p style={{
textAlign: "center",
width:'100%',
lineHeight: "29px",
}}>更换管理员</p>
</a>
</div> </div>

@ -1,145 +1,146 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import axios from 'axios'; import axios from 'axios';
import TPMNav from '../../component/TPMNav' import TPMNav from '../../component/TPMNav'
import TPMRightSection from '../../component/TPMRightSection' import TPMRightSection from '../../component/TPMRightSection'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import { trace_collapse } from 'educoder' import { trace_collapse } from 'educoder'
const $ = window.$; const $ = window.$;
// 点击按钮复制功能 // 点击按钮复制功能
function jsCopy(){ function jsCopy(){
var e = document.getElementById("copy_rep_content"); var e = document.getElementById("copy_rep_content");
e.select(); e.select();
document.execCommand("Copy"); document.execCommand("Copy");
} }
class TPMRepositoryCommits extends Component { class TPMRepositoryCommits extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
RepositoryList: undefined, RepositoryList: undefined,
} }
} }
componentDidMount() { componentDidMount() {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let collaborators=`/shixuns/`+id+`/commits.json`; let collaborators=`/shixuns/`+id+`/commits.json`;
axios.post(collaborators, { axios.post(collaborators, {
secret_repository: this.props.secret_repository_tab secret_repository: this.props.secret_repository_tab
}).then((response)=> { }).then((response)=> {
if(response.status===200){ if(response.status===200){
this.setState({ this.setState({
RepositoryList: response.data RepositoryList: response.data
}); });
} }
trace_collapse('repo commits res', response.data) trace_collapse('repo commits res', response.data)
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}); });
} }
render() { render() {
const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched,
aboutFocus, user, match aboutFocus, user, match
} = this.props; } = this.props;
let { RepositoryList } = this.state; let { RepositoryList } = this.state;
return ( return (
<React.Fragment> <React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80"> <div className="tpmComment educontent clearfix mt30 mb80">
{/* 可能会影响到其他页面的样式,需要测试、协商 */} {/* 可能会影响到其他页面的样式,需要测试、协商 */}
<div className="with65 fl edu-back-white commentsDelegateParent" <div className="with65 fl edu-back-white commentsDelegateParent"
style={{background: 'transparent'}}> style={{background: 'transparent'}}>
<TPMNav <TPMNav
match={match} match={match}
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
></TPMNav> is_jupyter={this.props.is_jupyter}
{ loadingContent ? ></TPMNav>
<CircularProgress size={40} thickness={3} { loadingContent ?
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> <CircularProgress size={40} thickness={3}
: style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/>
:
<div className="" >
<div className="edu-back-white font-16 mb10 clearfix padding20"> <div className="" >
<span className="fl"><i className="iconfont icon-tijiaojilu mr5"></i> <div className="edu-back-white font-16 mb10 clearfix padding20">
提交记录 <span className="fl"><i className="iconfont icon-tijiaojilu mr5"></i>
</span> 提交记录
{/* &nbsp;35 */} </span>
<span className="color-grey-9 fr"> {/* &nbsp;35 */}
<Link to={`/shixuns/${match.params.shixunId}/repository/${match.params.repoId}`} <span className="color-grey-9 fr">
className="font-14 color-grey-9">返回</Link> <Link to={`/shixuns/${match.params.shixunId}/repository/${match.params.repoId}`}
</span> className="font-14 color-grey-9">返回</Link>
</div> </span>
</div>
<style>
{` <style>
a.pullreques_name:hover { {`
color: #666 !important a.pullreques_name:hover {
} color: #666 !important
`} }
</style> `}
<div className="edu-back-white font-16 mb10 clearfix padding20"> </style>
<ul className="pullreques_pull_list"> <div className="edu-back-white font-16 mb10 clearfix padding20">
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{ <ul className="pullreques_pull_list">
return ( { RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
<li className="clear" key={ key }> return (
<a <li className="clear" key={ key }>
style={{ cursor: 'inherit' }} <a
className="fl color-grey-6 font-16 pullreques_name task-hide" style={{ cursor: 'inherit' }}
target="_blank">{item.email}</a> className="fl color-grey-6 font-16 pullreques_name task-hide"
<p className="pullreques_pull_txt ml10 fl" style={{lineHeight: '32px'}}> target="_blank">{item.email}</a>
{item.title} <p className="pullreques_pull_txt ml10 fl" style={{lineHeight: '32px'}}>
</p> {item.title}
<a style={{ cursor: 'inherit' }} </p>
className="fr mr15 color-blue">{item.time}</a> <a style={{ cursor: 'inherit' }}
className="fr mr15 color-blue">{item.time}</a>
<div className="cl"></div>
</li>) <div className="cl"></div>
}) </li>)
} })
</ul> }
</div> </ul>
</div> </div>
} </div>
</div> }
</div>
<div className="with35 fr pl20">
<TPMRightSection {...this.props}></TPMRightSection> <div className="with35 fr pl20">
</div> <TPMRightSection {...this.props}></TPMRightSection>
</div> </div>
</div>
</React.Fragment>
</React.Fragment>
);
} );
} }
}
/**
{ RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{ /**
// {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"} { RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{
return ( // {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"}
<div> return (
<div>{item.email}</div> <div>
<div>{item.title}</div> <div>{item.email}</div>
<div>{item.id}</div> <div>{item.title}</div>
<div>{item.time}</div> <div>{item.id}</div>
</div> <div>{item.time}</div>
) </div>
}) )
*/ })
export default TPMRepositoryCommits; */
export default TPMRepositoryCommits;

Loading…
Cancel
Save