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,6 +15,8 @@ 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>
@ -22,6 +24,7 @@ class TPMChallengeContainer extends Component {
{ 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>
} }

@ -31,6 +31,7 @@ class TPMCollaborators extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
<Collaborators <Collaborators
{...this.props} {...this.props}

@ -35,7 +35,7 @@ class TPMChallengeContainer extends Component {
{...this.state} {...this.state}
user={user} user={user}
aboutFocus={this.props.aboutFocus} aboutFocus={this.props.aboutFocus}
is_jupyter={this.props.is_jupyter}
> >
</TPMCollaborators> </TPMCollaborators>
} }

@ -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'}}>

@ -38,7 +38,7 @@ class TPMRanking_listContainer extends Component {
{...this.state} {...this.state}
user={user} user={user}
aboutFocus={this.props.aboutFocus} aboutFocus={this.props.aboutFocus}
is_jupyter={this.props.is_jupyter}
> >
</TPMForklist> </TPMForklist>
} }

@ -42,6 +42,7 @@ class TPMForklist extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
{ loadingContent ? { loadingContent ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> : <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :

@ -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>

@ -52,6 +52,7 @@ class TPMPropaedeutics extends Component {
shixun={shixun} shixun={shixun}
{...this.state} {...this.state}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
/> />
<Propaedeutics <Propaedeutics

@ -26,6 +26,7 @@ class TPMPropaedeuticsComponent extends Component {
{ 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>
} }

@ -38,6 +38,7 @@ class TPMRanking_list extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
<Ranking_list <Ranking_list

@ -6,6 +6,7 @@ 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 { class TPMRanking_listContainer extends Component {
constructor(props) { constructor(props) {
@ -26,6 +27,8 @@ class TPMRanking_listContainer extends Component {
{...this.state} {...this.state}
user={user} user={user}
aboutFocus={this.props.aboutFocus} aboutFocus={this.props.aboutFocus}
is_jupyter={this.props.is_jupyter}
> >
</TPMRanking_list> </TPMRanking_list>
} }

@ -35,6 +35,7 @@ class TPMRepository extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
{/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */} {/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */}
{ loadingContent ? { loadingContent ?

@ -200,6 +200,7 @@ class TPMRepositoryComponent extends Component {
{...this.state} {...this.state}
nameTypeMap={this.nameTypeMap} nameTypeMap={this.nameTypeMap}
fetchRepo={this.fetchRepo} fetchRepo={this.fetchRepo}
is_jupyter={this.props.is_jupyter}
> >
</TPMRepository> </TPMRepository>
: :

@ -44,6 +44,7 @@ class TPMShixunDiscuss extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
{ loadingContent ? { loadingContent ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> : <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> :

@ -33,7 +33,7 @@ class TPMShixunDiscussContainer extends Component {
{...this.state} {...this.state}
user={user} user={user}
aboutFocus={this.props.aboutFocus} aboutFocus={this.props.aboutFocus}
is_jupyter={this.props.is_jupyter}
> >
</TPMShixunDiscuss> </TPMShixunDiscuss>
} }

@ -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>
); );

@ -25,9 +25,9 @@ import axios from 'axios';
import TPMMDEditor from "../challengesnew/TPMMDEditor"; import TPMMDEditor from "../challengesnew/TPMMDEditor";
import Bottomsubmit from "../../modals/Bottomsubmit";
import {getImageUrl, toPath, getUrl, appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder'; import {getUploadActionUrl} from 'educoder';
import {TPMIndexHOC} from "../TPMIndexHOC";
import './css/TPMsettings.css'; import './css/TPMsettings.css';
@ -43,9 +43,36 @@ class Shixuninformation extends Component {
NAME_COUNT: 60, NAME_COUNT: 60,
shixunmemoMDvalue: "", shixunmemoMDvalue: "",
language: "java", language: "java",
testscripttiptype:false,
shixunName:'',
trainee:undefined,
choice_small_type:[]
} }
} }
componentDidMount() {
}
componentDidUpdate(prevProps, prevState) {
if(prevProps.data!=this.props.data){
console.log(this.props.data)
if(this.props.data){
this.setState({
shixunName:this.props.data.shixun.name,
trainee:this.props.data.shixun.trainee,
choice_main_type:this.props.data.shixun.choice_main_type,
choice_small_type:this.props.data.shixun.choice_small_type,
choice_standard_scripts:this.props.data.shixun.choice_standard_scripts,
})
this.props.form.setFieldsValue({
name:this.props.data.shixun.name,
})
this.contentMdRef.current.setValue(this.props.data.shixun.description);
}
}
}
getshixunmemoMDvalue = (value, e) => { getshixunmemoMDvalue = (value, e) => {
@ -54,13 +81,243 @@ class Shixuninformation extends Component {
}) })
} }
testscripttip=(val)=>{
if(val===0){
this.setState({
testscripttiptype:true
})
}else if(val===1){
this.setState({
testscripttiptype:false
})
}
}
post_apply = () => {
this.setState({
postapplyvisible: true
})
}
sendhideModaly = () => {
this.setState({
postapplyvisible: false,
})
if (this.state.file !== undefined) {
// this.deleteAttachment(this.state.file);
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
} else {
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
}
}
sendsure_apply = () => {
let {language, runtime, run_method} = this.state;
if (!language || language === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言`);
this.setState({
languagewritetype: true
})
return
}
if (!runtime || runtime === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
this.setState({
systemenvironmenttype: true
})
return;
}
if (!run_method || run_method === "") {
// this.props.showNotification(`请填写该镜像中测试代码运行方式`);
this.setState({
testcoderunmodetype: true
})
return;
}
var attachment_ids = undefined;
if (this.state.fileList) {
attachment_ids = this.state.fileList.map(item => {
return item.response ? item.response.id : item.id
})
}
if (attachment_ids === undefined || attachment_ids.length === 0) {
this.setState({
attachmentidstype: true
})
return;
}
var data = {
language: language,
runtime: runtime,
run_method: run_method,
attachment_id: attachment_ids[0],
}
var url = `/shixuns/apply_shixun_mirror.json`;
axios.post(url, data
).then((response) => {
try {
if (response.data) {
if (this.state.file !== undefined) {
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
} else {
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
}
notification.open(
{
message: '提示',
description:
'提交成功!',
}
)
this.sendhideModaly()
}
} catch (e) {
}
})
}
bigClass = (value) => {
let list=[]
list.push(this.props.data.shixun.choice_main_type)
this.props.data.shixun.choice_small_type.map((item,key)=>{
list.push(item)
})
let newshixun_service_configs=this.props.data.shixun.shixun_service_configs;
let newshixun_service_configsagin=[];
newshixun_service_configs.map((item,key)=>{
list.map((its,index)=>{
if(item.mirror_repository_id===its){
newshixun_service_configsagin.push(item)
}
})
})
this.props.data.shixun.main_type.some((item,key)=> {
if (item.id === value) {
newshixun_service_configsagin[0]={
mirror_repository_id:value,
name:item.type_name,
cpu_limit:1,
lower_cpu_limit:0.1,
memory_limit:1024,
request_limit:10
}
return true
}
}
)
let url = `/shixuns/get_mirror_script.json?mirror_id=`+value;
axios.get(url).then((response) => {
if (response.status === 200) {
// console.log(response.data)
this.setState({
choice_main_type: value,
standard_scripts:response.data,
choice_standard_scripts:null,
shixun_service_configs:newshixun_service_configsagin,
shixun_service_configlist:newshixun_service_configsagin,
})
}
}).catch((error) => {
console.log(error)
});
}
littleClass = (value) => {
let newshixun_service_configs=this.props.data.shixun.shixun_service_configs;
let newchoice_small_type=this.props.data.shixun.choice_small_type;
let list=[]
list.push(this.props.data.shixun.choice_main_type)
newchoice_small_type.map((item,key)=>{
list.push(item)
})
let newshixun_service_configsagin=[]
newshixun_service_configs.map((item,key)=>{
list.map((its,index)=>{
if(item.mirror_repository_id===its){
newshixun_service_configsagin.push(item)
}
})
})
this.props.data.shixun.small_type.some((items,keys)=> {
if (items.id === value) {
newshixun_service_configsagin.push({
mirror_repository_id:value,
name:items.type_name,
cpu_limit:1,
lower_cpu_limit:0.1,
memory_limit:1024,
request_limit:10
})
return true
}
}
)
newchoice_small_type.push(value)
this.setState({
choice_small_type: newchoice_small_type,
shixun_service_configs:newshixun_service_configsagin,
shixun_service_configlist:newshixun_service_configsagin,
})
}
render() { render() {
console.log(this.props.data)
let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.props.data.shixun.status==0?true:false;
console.log(operateauthority)
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
const {newshixunlist, languagewrite, systemenvironment, testcoderunmode, fileList, postapplytitle, postapplyvisible, shixunmemoMDvalue} = this.state; const {newshixunlist, languagewrite, systemenvironment, testcoderunmode, fileList, choice_standard_scripts, postapplyvisible, shixunmemoMDvalue} = this.state;
const {shixun_service_configs}=this.props; const {shixun_service_configs}=this.props;
let operateauthority = this.props.identity === 1 ? true : this.props.identity < 5 && this.state.status == 0 ? true : false;
const uploadProps = { const uploadProps = {
width: 600, width: 600,
fileList, fileList,
@ -105,8 +362,12 @@ class Shixuninformation extends Component {
}, },
} }
return ( return (
<div> <div>
<div className="educontent mb50 edu-back-white padding10-20">
<Form> <Form>
<Form.Item <Form.Item
label="名称" label="名称"
@ -148,13 +409,14 @@ class Shixuninformation extends Component {
style={{"borderBottom": 'none'}} style={{"borderBottom": 'none'}}
className="chooseDes pr" className="chooseDes pr"
> >
{getFieldDecorator('select', { {getFieldDecorator('trainee', {
rules: [{required: true, message: '请选择难易度'}], rules: [{required: true, message: '请选择难易度'}],
})( })(
<div className="with15 fl pr"> <div className="with15 fl pr">
<Select placeholder="请选择难易度" <Select placeholder="请选择难易度"
style={{width: 180}} style={{width: 180}}
onChange={this.Selectthestudent} onChange={this.Selectthestudent}
value={this.state.trainee}
> >
<Option value={1}>初级</Option> <Option value={1}>初级</Option>
<Option value={2}>中级</Option> <Option value={2}>中级</Option>
@ -178,18 +440,20 @@ class Shixuninformation extends Component {
rules: [{required: true, message: '请选择主类别'}], rules: [{required: true, message: '请选择主类别'}],
})( })(
<div className="width100 fl mr20"> <div className="width100 fl mr20">
<Select placeholder="请选择主类别" value={this.state.choice_main_type === "" ? undefined : this.state.choice_main_type}
<Select placeholder="请选择主类别"
style={{width: 180}} style={{width: 180}}
onChange={this.selectleft} onChange={operateauthority?this.bigClass:""}
defaultOpen={false} optionFilterProp="children"
filterOption={(input, option) =>
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
> >
{ {
newshixunlist === undefined ? "" : newshixunlist.main_type.map((item, key) => { this.props.data === undefined ? "" : this.props.data.shixun.main_type.map((item, key) => {
return ( return (
<Option value={item.id} key={key} > <Option value={item.id} key={key} >
<Tooltip placement="right" <Tooltip placement="right" title={item.description=== ""?"无描述":item.description} >
title={item.description === "" ? "无描述" : item.description}>
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
</Option> </Option>
@ -214,16 +478,19 @@ class Shixuninformation extends Component {
})( })(
<div className=" fl pr mr20"> <div className=" fl pr mr20">
<Select placeholder="请选择小类别" <Select placeholder="请选择小类别"
style={{width: 180}}
onChange={this.selectright} onChange={this.selectright}
value={this.state.choice_small_type.length===0||this.state.choice_small_type[0]===""||this.state.choice_small_type===[]?undefined:this.state.choice_small_type}
style={{width: 180,height:30}}
disabled={operateauthority?false:true}
onDeselect={operateauthority?this.Deselectlittle:""}
onSelect={operateauthority?this.littleClass:""}
defaultOpen={false} defaultOpen={false}
> >
{ {
newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => { this.props.data === undefined ? "" : this.props.data.shixun.small_type.map((item, key) => {
return( return(
<Option value={item.id} key={key}> <Option value={item.id} key={key}>
<Tooltip placement="right" <Tooltip placement="right" title={item.description=== ""?"无描述":item.description} >
title={item.description === "" ? "无描述" : item.description}>
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
</Option> </Option>
@ -258,27 +525,70 @@ class Shixuninformation extends Component {
style={{"borderBottom": 'none'}} style={{"borderBottom": 'none'}}
className="chooseDes pr" className="chooseDes pr"
> >
{getFieldDecorator('select', { {getFieldDecorator('select123', {
rules: [{required: true, message: '请选择评测脚本'}], rules: [{required: true, message: '请选择评测脚本'}],
})( })(
<div className="with15 fl pr"> <div className="with15 fl pr">
<Select placeholder="请选择评测脚本" <Select placeholder="请选择选择脚本"
style={{width: 180}} style={{width: 180}}
onChange={this.Selectthestudent} className="fl"
> disabled={operateauthority?false:true}
<Option value={1}>初级</Option> value={choice_standard_scripts === undefined||choice_standard_scripts === null ? undefined :choice_standard_scripts.id===undefined?choice_standard_scripts:choice_standard_scripts.id}
<Option value={2}>中级</Option> onChange={operateauthority?this.SelectScput:""}>
<Option value={3}>中高级</Option> {
<Option value={4}>高级</Option> this.props.data === undefined ? "" : this.props.data.shixun.standard_scripts.map((item, key) => {
</Select> return (
<Option value={parseInt(item.id)} name={item.scptname} key={key}>{item.scptname}</Option>
)
})
}
</Select>
</div> </div>
)} )}
<span className="fl ml20 color-blue"> <span className="fl ml20 color-blue">
使用自定义脚本 使用自定义脚本
<span className={"color-grey ml10"}> <span className={"color-grey ml10"} onClick={()=>this.testscripttip(0)}>
<Icon type="exclamation-circle"/> <Icon type="exclamation-circle"/>
</span> </span>
<div className="invite-tip clearfix none " id="test_script_tip"
style={{top: '33px', left: '-15px',width: '450px',zIndex: '10',display: this.state.testscripttiptype===true?'block':"none"}}>
<style>
{
`
.top-black-trangle{
right: auto;
left: 0px;
}
`
}
</style>
<span className="top-black-trangle"></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">
使用自定义模板平台无法自动更新脚本请在关卡创建完后手动更新脚本中的必填参<br/>
数和以下2个数组元素<br/>
challengeProgramNames<br/>
sourceClassNames<br/><br/>
示例有2个关卡的实训<br/><br/>
各关卡的待编译文件为<br/>
src/step1/HelloWorld.java<br/>
src/step2/Other.java<br/><br/>
各关卡的编译后生成的执行文件为<br/>
step1.HelloWorld<br/>
step2.Other<br/><br/>
则数组元素更新如下<br/>
challengeProgramNames=("src/step1/<br/>
HelloWorld.java" "src/step2/Other.java")<br/>
sourceClassNames=("step1.HelloWorld<br/>
" "step2.Other")<br/><br/>
其它参数可按实际需求定制
</p>
</div>
<p className="inviteTipbtn with100 fl">
<a onClick={()=>this.testscripttip(1)}>知道了</a>
</p>
</div>
</span> </span>
</Form.Item> </Form.Item>
@ -290,7 +600,7 @@ class Shixuninformation extends Component {
<div className="fl" style={{border: '1px solid #ccc'}}> <div className="fl" style={{border: '1px solid #ccc'}}>
<MonacoEditor <MonacoEditor
height="450" height="450"
width="1100" width="1150"
language={this.state.language} language={this.state.language}
value={shixunmemoMDvalue} value={shixunmemoMDvalue}
options={{ options={{
@ -449,30 +759,10 @@ class Shixuninformation extends Component {
</div> </div>
{/*</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>
<Bottomsubmit url={`/shixuns/${this.props.match.params.shixunId}/challenges`} onSubmits={ this.sendsure_apply}/>
</div> </div>
</Modal>
</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*/}
{
this.props.is_jupyter===true?
<Link to={`/shixuns/${shixunId}/dataset`} <Link to={`/shixuns/${shixunId}/dataset`}
className={`${match.url.indexOf('dataset') != -1 ? 'active' : ''} fl mr40`}>数据集</Link> 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>

@ -67,6 +67,7 @@ class TPMRepositoryCommits extends Component {
user={user} user={user}
shixun={shixun} shixun={shixun}
{...this.props} {...this.props}
is_jupyter={this.props.is_jupyter}
></TPMNav> ></TPMNav>
{ loadingContent ? { loadingContent ?
<CircularProgress size={40} thickness={3} <CircularProgress size={40} thickness={3}

Loading…
Cancel
Save