From 73f1eb8463929c989d19170f909d813e8bcee667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 13 Dec 2019 00:04:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=9E=E8=AE=AD=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Challenges/Challengesjupyter.js | 88 ++++++++++++------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index ea241b479..e10eb6161 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -13,7 +13,7 @@ import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder' import { CircularProgress } from 'material-ui/Progress'; import { Modal, Spin, Tooltip ,message,Icon} from 'antd'; - +import LoadingSpin from '../../../../common/LoadingSpin'; import 'antd/lib/pagination/style/index.css'; import '../shixunchildCss/Challenges.css' @@ -69,28 +69,47 @@ class Challengesjupyter extends Component { } axios.get(ChallengesURL, {params: datas}).then((response) => { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + setTimeout(() => { + this.setState({ + booljupyterurls:true, + }) + }, 600) }else{ if(response.data.status===0){ - this.setState({ - jupyter_url:response.data.url, - jupyter_port:response.data.port, - }) + + setTimeout(() => { + this.setState({ + jupyter_url:response.data.url, + jupyter_port:response.data.port, + booljupyterurls:true, + }) + }, 800) + }else{ + setTimeout(() => { + this.setState({ + booljupyterurls:true, + }) + }, 600) + } } + + + }).catch((error) => { + setTimeout(() => { this.setState({ booljupyterurls:true, }) - }).catch((error) => { - this.setState({ - booljupyterurls:true, - }) + }, 600) + }); } updatamakedowns = () => { this.setState({ loading:true, + booljupyterurls:false }) let id = this.props.match.params.shixunId; let ChallengesURL = `/jupyters/get_info_with_tpm.json`; @@ -99,38 +118,43 @@ class Challengesjupyter extends Component { } axios.get(ChallengesURL, {params: datas}).then((response) => { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + setTimeout(() => { + this.setState({ + booljupyterurls:true, + }) + }, 600) }else{ if(response.data.status===0){ + setTimeout(() => { + this.setState({ + jupyter_url:response.data.url, + jupyter_port:response.data.port, + booljupyterurls:true, + }) + }, 800) this.setState({ - jupyter_url:response.data.url, - jupyter_port:response.data.port, + }) }else{ + setTimeout(() => { + this.setState({ + booljupyterurls:true, + }) + }, 600) } } - this.setState({ - booljupyterurls:true, - loading:false, - }) }).catch((error) => { - this.setState({ - booljupyterurls:true, - loading:false, - }) + setTimeout(() => { + this.setState({ + booljupyterurls:true, + }) + }, 600) + }); } - - - - - - - - - modifyjupyter=()=>{ let id=this.props.match.params.shixunId; var jupyter_port=""; @@ -165,7 +189,6 @@ class Challengesjupyter extends Component { return (
-

简介 @@ -272,7 +295,11 @@ class Challengesjupyter extends Component {

{ this.state.jupyter_url===null || this.state.jupyter_url===undefined? - "" + ( + booljupyterurls===false? + + :"" + ) :