jupyter 监听底层传来的消息进行绑定

chromesetting
杨树林 5 years ago
parent 6bbce2ca8e
commit 5919d65056

@ -72,6 +72,7 @@ class Challengesjupyter extends Component {
} }
componentDidMount() { componentDidMount() {
var that=this;
setTimeout(this.ChallengesList(), 1000); setTimeout(this.ChallengesList(), 1000);
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`;
@ -115,6 +116,14 @@ class Challengesjupyter extends Component {
}, 600) }, 600)
}); });
window.addEventListener('jupytermessage', (e) => {
console.log("触发了jupytermessage");
console.log("触发了jupytermessage");
that.modifyjupyter();
});
} }
updatamakedowns = () => { updatamakedowns = () => {
@ -184,6 +193,7 @@ class Challengesjupyter extends Component {
.then((result) => { .then((result) => {
if (result.data.status === 0) { if (result.data.status === 0) {
this.props.showNotification(`应用成功`); this.props.showNotification(`应用成功`);
console.log("触发了jupytermessage调用了应用成功");
} }
}).catch((error) => { }).catch((error) => {
}) })
@ -328,7 +338,7 @@ class Challengesjupyter extends Component {
marginLeft: '30px', marginLeft: '30px',
}} onClick={()=>this.onclki(true)}></i> }} onClick={()=>this.onclki(true)}></i>
} }
<div className="challenbaocun" onClick={() => this.modifyjupyter(this.state)}><p <div className="challenbaocun" ><p
className="challenbaocuntest">导入</p> className="challenbaocuntest">导入</p>
</div> </div>
</div> </div>

Loading…
Cancel
Save