调整实训项目

chromesetting
杨树林 6 years ago
parent d2008a6607
commit 73f1eb8463

@ -13,7 +13,7 @@ import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import { Modal, Spin, Tooltip ,message,Icon} from 'antd'; import { Modal, Spin, Tooltip ,message,Icon} from 'antd';
import LoadingSpin from '../../../../common/LoadingSpin';
import 'antd/lib/pagination/style/index.css'; import 'antd/lib/pagination/style/index.css';
import '../shixunchildCss/Challenges.css' import '../shixunchildCss/Challenges.css'
@ -69,28 +69,47 @@ class Challengesjupyter extends Component {
} }
axios.get(ChallengesURL, {params: datas}).then((response) => { axios.get(ChallengesURL, {params: datas}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
setTimeout(() => {
this.setState({
booljupyterurls:true,
})
}, 600)
}else{ }else{
if(response.data.status===0){ if(response.data.status===0){
this.setState({
jupyter_url:response.data.url, setTimeout(() => {
jupyter_port:response.data.port, this.setState({
}) jupyter_url:response.data.url,
jupyter_port:response.data.port,
booljupyterurls:true,
})
}, 800)
}else{ }else{
setTimeout(() => {
this.setState({
booljupyterurls:true,
})
}, 600)
} }
} }
}).catch((error) => {
setTimeout(() => {
this.setState({ this.setState({
booljupyterurls:true, booljupyterurls:true,
}) })
}).catch((error) => { }, 600)
this.setState({
booljupyterurls:true,
})
}); });
} }
updatamakedowns = () => { updatamakedowns = () => {
this.setState({ this.setState({
loading:true, loading:true,
booljupyterurls:false
}) })
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let ChallengesURL = `/jupyters/get_info_with_tpm.json`; let ChallengesURL = `/jupyters/get_info_with_tpm.json`;
@ -99,38 +118,43 @@ class Challengesjupyter extends Component {
} }
axios.get(ChallengesURL, {params: datas}).then((response) => { axios.get(ChallengesURL, {params: datas}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
setTimeout(() => {
this.setState({
booljupyterurls:true,
})
}, 600)
}else{ }else{
if(response.data.status===0){ if(response.data.status===0){
setTimeout(() => {
this.setState({
jupyter_url:response.data.url,
jupyter_port:response.data.port,
booljupyterurls:true,
})
}, 800)
this.setState({ this.setState({
jupyter_url:response.data.url,
jupyter_port:response.data.port,
}) })
}else{ }else{
setTimeout(() => {
this.setState({
booljupyterurls:true,
})
}, 600)
} }
} }
this.setState({
booljupyterurls:true,
loading:false,
})
}).catch((error) => { }).catch((error) => {
this.setState({ setTimeout(() => {
booljupyterurls:true, this.setState({
loading:false, booljupyterurls:true,
}) })
}, 600)
}); });
} }
modifyjupyter=()=>{ modifyjupyter=()=>{
let id=this.props.match.params.shixunId; let id=this.props.match.params.shixunId;
var jupyter_port=""; var jupyter_port="";
@ -165,7 +189,6 @@ class Challengesjupyter extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<div className="mt30 pl20 pr20" > <div className="mt30 pl20 pr20" >
<Spin spinning={this.state.loading}>
<p className="clearfix mb20"> <p className="clearfix mb20">
<span className="font-16 fl">简介</span> <span className="font-16 fl">简介</span>
<Tooltip placement="bottom" title={"编辑"}> <Tooltip placement="bottom" title={"编辑"}>
@ -272,7 +295,11 @@ class Challengesjupyter extends Component {
<div className="pb47"> <div className="pb47">
{ {
this.state.jupyter_url===null || this.state.jupyter_url===undefined? this.state.jupyter_url===null || this.state.jupyter_url===undefined?
"" (
booljupyterurls===false?
<LoadingSpin></LoadingSpin>
:""
)
: :
<iframe src={this.state.jupyter_url} <iframe src={this.state.jupyter_url}
sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame" sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame"
@ -284,7 +311,6 @@ class Challengesjupyter extends Component {
:"" :""
} }
</div> </div>
</Spin>
</div> </div>
</React.Fragment> </React.Fragment>

Loading…
Cancel
Save