Merge branch 'dev_jupyter' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_jupyter

chromesetting
杨树林 5 years ago
commit d4f23306b1

@ -2,15 +2,17 @@
//guange 2019.12.18
$(function(){
window.onload=function(){
console.log("开始发送消息了");
runEvery10Sec();
})
}
function runEvery10Sec() {
// 1000 * 10 = 10 秒钟
console.log("每隔10秒中一次runEvery10Sec");
console.log("每隔10秒中一次");
require(["base/js/namespace"],function(Jupyter) {
Jupyter.notebook.save_checkpoint();
});
window.parent.postMessage('jupytermessage','*');
setTimeout( runEvery10Sec, 1000 * 10 );
}

@ -52,7 +52,7 @@ export function initAxiosInterceptors(props) {
//proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net"
//proxy="https://test-jupyterweb.educoder.net"
proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

@ -75,11 +75,30 @@ function JupyterTPI (props) {
const [updateTip, setUpdateTip] = useState(true);
const [myIdentifier, setMyIdentifier] = useState('');
const [renderCtx, setRenderCtx] = useState(() => (emptyCtx));
// 保存代码
const addEventListeners = () => {
window.addEventListener('message', (e) => {
console.log("触发了jupytermessage");
if(e){
if(e.data){
if(e.data==="jupytermessage"){
saveJupyterTpi();
}
}
}
});
}
useEffect(() => {
/* jupyter TPI
* 获取 用户信息,
* 实训的 identifier, 状态 名称 是否被修改等信息
*/
addEventListeners()
getJupyterInfo(identifier);
}, [identifier]);
@ -234,6 +253,8 @@ function JupyterTPI (props) {
setRenderCtx(oUl);
}
}, [props]);
return (
<div className="jupyter_area">
<div className="jupyter_header">

@ -65,13 +65,13 @@ function RightPane (props) {
className='jupyter_iframe_style'
></iframe>
</div>
<div className="jupyter_submit">
<Button
loading={loading}
type="primary"
onClick={handleClickSubmit}
>保存</Button>
</div>
{/*<div className="jupyter_submit">*/}
{/* <Button*/}
{/* loading={loading}*/}
{/* type="primary"*/}
{/* onClick={handleClickSubmit}*/}
{/* >保存</Button>*/}
{/*</div>*/}
</div>
));

@ -147,7 +147,6 @@ class Challengesjupyter extends Component {
window.addEventListener('message', (e) => {
console.log("触发了jupytermessage");
console.log(e);
if(e){
if(e.data){
if(e.data==="jupytermessage"){

Loading…
Cancel
Save