From 91b3706d42c16430f1a54f85f58f53187ff69a7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Wed, 25 Dec 2019 12:41:06 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/tpm/TPMIndex.js | 18 +++++-----
.../Challenges/Challengesjupyter.js | 36 ++++++++++++-------
.../Collaborators/Collaborators.js | 4 +--
3 files changed, 36 insertions(+), 22 deletions(-)
diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js
index a8e869a3c..cf674a220 100644
--- a/public/react/src/modules/tpm/TPMIndex.js
+++ b/public/react/src/modules/tpm/TPMIndex.js
@@ -423,22 +423,24 @@ class TPMIndex extends Component {
{ this.state.is_jupyter===false?
排行榜
:""}
-
- {this.state.identity >4||this.state.identity===undefined ? "":
-
-
+
- 更多设置在这里,点击“配置”看一看~
-
-
+ 更多设置在这里,点击“配置”看一看~
+
+
}
trigger="click"
placement="top"
visible={this.state.openknows}
>
+
+
+
+ {this.state.identity >4||this.state.identity===undefined ? "":
+
配置
-
}
diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js
index 6eb9c128b..573f30d4d 100644
--- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js
+++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js
@@ -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() {
diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js
index 0404bc0fe..1d88bf32a 100644
--- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js
+++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js
@@ -525,9 +525,9 @@ class Collaborators extends Component {