|
|
|
@ -1,23 +1,13 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import { markdownToHTML, configShareForCustom,getImageUrl,getUploadActionUrlthree,appendFileSizeToUploadFileAll} from 'educoder'
|
|
|
|
|
import { Divider, Tooltip,Upload,Modal} from 'antd';
|
|
|
|
|
import { Divider, Tooltip,Upload,Modal,Spin} from 'antd';
|
|
|
|
|
import LoadingSpin from '../../../../common/LoadingSpin';
|
|
|
|
|
import 'antd/lib/pagination/style/index.css';
|
|
|
|
|
import '../shixunchildCss/Challenges.css';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
const $ = window.$;
|
|
|
|
|
|
|
|
|
|
function handleClickResetTpisync_code(id){
|
|
|
|
|
const url = `/jupyters/reset_with_tpm.json`;
|
|
|
|
|
axios.post(url,{
|
|
|
|
|
identifier:id
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
return response
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
class Challengesjupyter extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
@ -326,9 +316,31 @@ class Challengesjupyter extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleClickResetTpisync_code=(id)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
jupyter_url : null,
|
|
|
|
|
booljupyterurls:false,
|
|
|
|
|
})
|
|
|
|
|
const url = `/jupyters/reset_with_tpm.json`;
|
|
|
|
|
axios.get(url,{params:{
|
|
|
|
|
identifier:id
|
|
|
|
|
}}).then((response) => {
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
jupyter_url :response.data.url,
|
|
|
|
|
booljupyterurls:true,
|
|
|
|
|
})
|
|
|
|
|
},1000);
|
|
|
|
|
this.props.showNotification('重置实训成功!');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 重置实训
|
|
|
|
|
handleClickResetTpi = () => {
|
|
|
|
|
let id=this.props.match.params.shixunId;
|
|
|
|
|
let that=this;
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '重置实训',
|
|
|
|
|
content: (
|
|
|
|
@ -340,7 +352,7 @@ class Challengesjupyter extends Component {
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk () {
|
|
|
|
|
console.log(handleClickResetTpisync_code(id))
|
|
|
|
|
that.handleClickResetTpisync_code(id)
|
|
|
|
|
},
|
|
|
|
|
onCancel() {
|
|
|
|
|
|
|
|
|
|