|
|
|
@ -25,6 +25,7 @@ class Challengesjupyter extends Component {
|
|
|
|
|
boxoffsetHeigh:0,
|
|
|
|
|
opentitletype:true,
|
|
|
|
|
isopentitletype:"Less",
|
|
|
|
|
enlarge:false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -79,6 +80,7 @@ class Challengesjupyter extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
var that=this;
|
|
|
|
|
setTimeout(this.ChallengesList(), 1000);
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let ChallengesURL = `/jupyters/get_info_with_tpm.json`;
|
|
|
|
@ -122,6 +124,14 @@ class Challengesjupyter extends Component {
|
|
|
|
|
}, 600)
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener('jupytermessage', (e) => {
|
|
|
|
|
console.log("触发了jupytermessage");
|
|
|
|
|
console.log("触发了jupytermessage");
|
|
|
|
|
that.modifyjupyter();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updatamakedowns = () => {
|
|
|
|
@ -191,6 +201,7 @@ class Challengesjupyter extends Component {
|
|
|
|
|
.then((result) => {
|
|
|
|
|
if (result.data.status === 0) {
|
|
|
|
|
this.props.showNotification(`应用成功`);
|
|
|
|
|
console.log("触发了jupytermessage调用了应用成功");
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
})
|
|
|
|
@ -202,9 +213,15 @@ class Challengesjupyter extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onclki=(bool)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
enlarge:bool
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let{ChallengesDataList,booljupyterurls}=this.state;
|
|
|
|
|
let{ChallengesDataList,booljupyterurls,enlarge}=this.state;
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
//老师
|
|
|
|
|
const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
|
|
|
|
@ -212,6 +229,8 @@ class Challengesjupyter extends Component {
|
|
|
|
|
const business = this.props&&this.props.current_user&&this.props.current_user.business?this.props.current_user.business:false;
|
|
|
|
|
//管理员
|
|
|
|
|
const admin = this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
|
|
|
|
|
//用户
|
|
|
|
|
const login = this.props&&this.props.current_user&&this.props.current_user.login?this.props.current_user.login:"";
|
|
|
|
|
|
|
|
|
|
let mysidentity =false;
|
|
|
|
|
try {
|
|
|
|
@ -310,8 +329,9 @@ class Challengesjupyter extends Component {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction:row-reverse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
@ -321,16 +341,33 @@ class Challengesjupyter extends Component {
|
|
|
|
|
:
|
|
|
|
|
(
|
|
|
|
|
admin===true||business===true||mysidentity===true?
|
|
|
|
|
<div className={"shixunjianjiecballenges edu-back-white sortinxdirection mt20"}>
|
|
|
|
|
<div style={{
|
|
|
|
|
height: '63px',
|
|
|
|
|
}} className={enlarge?"shixunjianjiecballenges edu-back-white intermediatecenter fangdaone":"shixunjianjiecballenges edu-back-white mt20"}>
|
|
|
|
|
|
|
|
|
|
<div className={enlarge?"sortinxdirection jupyterswidth":"sortinxdirection"} >
|
|
|
|
|
<div className="renwuxiangssi sortinxdirection">
|
|
|
|
|
<div><p className="renwuxiangqdiv">任务详情</p></div>
|
|
|
|
|
<div><p className="renwuxiangqdivtest ml1 shixunbingbaocun">(请将实训题目写在下方并保存)</p></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="renwuxiangssit xaxisreverseorder">
|
|
|
|
|
<div className="challenbaocun" onClick={() => this.modifyjupyter(this.state)}><p
|
|
|
|
|
className="challenbaocuntest">应用到实训</p></div>
|
|
|
|
|
{
|
|
|
|
|
enlarge===true?
|
|
|
|
|
<i className="iconfont icon-suoxiao2 font-20 ml2 ysliconfont" style={{
|
|
|
|
|
marginLeft: '30px',
|
|
|
|
|
}} onClick={()=>this.onclki(false)}></i>
|
|
|
|
|
:
|
|
|
|
|
<i className="iconfont icon-fangda font-20 ml2 ysliconfont" style={{
|
|
|
|
|
marginLeft: '30px',
|
|
|
|
|
}} onClick={()=>this.onclki(true)}></i>
|
|
|
|
|
}
|
|
|
|
|
<div className="challenbaocun" ><p
|
|
|
|
|
className="challenbaocuntest">导入</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
)
|
|
|
|
@ -365,7 +402,7 @@ class Challengesjupyter extends Component {
|
|
|
|
|
{
|
|
|
|
|
admin===true||business===true||mysidentity===true?
|
|
|
|
|
<div>
|
|
|
|
|
<div className="pb47">
|
|
|
|
|
<div className={"pb47"}>
|
|
|
|
|
{
|
|
|
|
|
this.state.jupyter_url===null || this.state.jupyter_url===undefined?
|
|
|
|
|
(
|
|
|
|
@ -374,10 +411,19 @@ class Challengesjupyter extends Component {
|
|
|
|
|
:""
|
|
|
|
|
)
|
|
|
|
|
:
|
|
|
|
|
<iframe src={this.state.jupyter_url}
|
|
|
|
|
sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame"
|
|
|
|
|
name="framename" width="100%" height="700" frameBorder="0"
|
|
|
|
|
></iframe>
|
|
|
|
|
(
|
|
|
|
|
login==="innov"?
|
|
|
|
|
<iframe src={"http://121.41.4.83:46666/notebooks/root/work/01.ipynb"} className={enlarge?"fangdatwo":""}
|
|
|
|
|
sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame"
|
|
|
|
|
name="framename" width="100%" height="700" frameBorder="0"
|
|
|
|
|
></iframe>
|
|
|
|
|
:
|
|
|
|
|
<iframe src={this.state.jupyter_url} className={enlarge?"fangdatwo":""}
|
|
|
|
|
sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame"
|
|
|
|
|
name="framename" width="100%" height="700" frameBorder="0"
|
|
|
|
|
></iframe>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|