From 16d8db7b5acf4bc19b09df4bb57752734cddd34d 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, 20 Dec 2019 12:58:39 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunchild/Challenges/Challengesjupyter.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index b571b3101..9f28f2757 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -118,12 +118,17 @@ class Challengesjupyter extends Component { }); + let self = this; //为了避免作用域及缓存 + window.receiveMessageFromIndex = function ( event ) { + if(event!=undefined){ + console.log("触发了jupytermessage"); + console.log("触发了jupytermessage"); + // self.modifyjupyter(); - window.addEventListener('jupytermessage', (e) => { - console.log("触发了jupytermessage"); - console.log("触发了jupytermessage"); - that.modifyjupyter(); - }); + } + } + //监听message事件 + window.addEventListener("jupytermessage", receiveMessageFromIndex, false); } updatamakedowns = () => { From b7abe189bff2d22c6017d74d577aa7567b2331e0 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, 20 Dec 2019 13:02:54 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tpm/shixunchild/Challenges/Challengesjupyter.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index c68493163..8e03f75e9 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -125,13 +125,13 @@ class Challengesjupyter extends Component { }); - - - window.addEventListener('jupytermessage', (e) => { + let self = this; //为了避免作用域及缓存 + window.receiveMessageFromIndex = function ( event ) { console.log("触发了jupytermessage"); console.log("触发了jupytermessage"); - that.modifyjupyter(); - }); + } + //监听message事件 + window.addEventListener("message", receiveMessageFromIndex, false); } updatamakedowns = () => { From 1954a2467c0228376eab88349f2cdc925ae18439 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 20 Dec 2019 13:03:55 +0800 Subject: [PATCH 03/20] update style --- .../modules/developer/recordDetail/index.js | 8 +++-- .../leftpane/commitRecord/index.js | 32 ++++++++++++------- .../leftpane/commitRecord/index.scss | 2 ++ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/developer/recordDetail/index.js b/public/react/src/modules/developer/recordDetail/index.js index 7a3fc13e1..e4002004a 100644 --- a/public/react/src/modules/developer/recordDetail/index.js +++ b/public/react/src/modules/developer/recordDetail/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-04 08:36:21 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 10:38:00 + * @LastEditTime: 2019-12-20 10:52:36 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -87,9 +87,11 @@ function RecordDetail (props) { - 语言: C + 语言: {detail.language} + + + 执行用时: {`${detail.execute_time && (+detail.execute_time * 1000)}ms`} - {/* */}
diff --git a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js index 7fc061765..7b6cce9f8 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js +++ b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 09:49:33 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 09:35:00 + * @LastEditTime: 2019-12-20 11:44:22 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -149,19 +149,27 @@ const CommitRecord = (props) => { setRenderCtx(() => (renderRecordDetail)) }, [commitRecordDetail]); // 复制功能 - + let count = 0; useEffect(() => { - if (!clipboard) { - clipboard = new ClipboardJS('.copy_error'); - } - if (commitRecordDetail.status !== 0) { - clipboard.on('success', (e) => { - message.success('复制成功'); - e.clearSelection(); - }); - } - }, [commitRecordDetail.status]); + clipboard = new ClipboardJS('.copy_error'); + clipboard.on('success', (e) => { + e.clearSelection(); + if (count > 0) return; + count++; + message.success('复制成功'); + setTimeout(() => { + message.destroy(); + }, 300); + }); + }, []); + // if (commitRecordDetail.status !== 0) { + // clipboard.on('success', (e) => { + // console.log('成功=====》》》》》'); + // message.success('复制成功'); + // e.clearSelection(); + // }); + // } // const handleTableChange = (pagination) => { setPagination(Object.assign({}, pagination)); diff --git a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss index 283617445..fb099445e 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss +++ b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss @@ -1,6 +1,8 @@ .commit_record_area{ // padding: 20px 30px; padding: 0 20px; + overflow-y: auto; + height: calc(100vh - 177px); .record_header{ display: flex; // justify-content: space-between; From 5048423aee06de7ae14f6c14a0a6a1aff5731cc1 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, 20 Dec 2019 13:05:29 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/jupyter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/jupyter.js b/public/javascripts/jupyter.js index 7b2313139..a2de37ce5 100644 --- a/public/javascripts/jupyter.js +++ b/public/javascripts/jupyter.js @@ -8,5 +8,5 @@ $(function(){ $(function(){ console.log("开始发送消息了"); - window.parent.postMessage('jupytermessage','*'); + window.parent.postMessage('message','*'); }) From baa5ec685d301249820dd75cf54bf25a928758ea 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, 20 Dec 2019 13:41:36 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/shixunchild/Challenges/Challengesjupyter.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 0e243e6d8..ee3f9a0e9 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -152,8 +152,8 @@ class Challengesjupyter extends Component { window.addEventListener('message', (e) => { console.log("触发了jupytermessage"); - console.log("触发了jupytermessage"); - that.modifyjupyter(); + console.log(e); + // that.modifyjupyter(); }); setTimeout(this.getjianjiesize(), 1000); @@ -410,8 +410,6 @@ class Challengesjupyter extends Component {
- - : "" ) From 7171b5cba36def4e50bc695921ca449c90143d1c 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, 20 Dec 2019 13:42:44 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/jupyter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/jupyter.js b/public/javascripts/jupyter.js index a2de37ce5..7b2313139 100644 --- a/public/javascripts/jupyter.js +++ b/public/javascripts/jupyter.js @@ -8,5 +8,5 @@ $(function(){ $(function(){ console.log("开始发送消息了"); - window.parent.postMessage('message','*'); + window.parent.postMessage('jupytermessage','*'); }) From 8250d5fccb73a6fed9a2dffa5d13a488419501e3 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, 20 Dec 2019 13:48:39 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tpm/shixunchild/Challenges/Challengesjupyter.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index ee3f9a0e9..d03a0ea89 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -153,7 +153,15 @@ class Challengesjupyter extends Component { window.addEventListener('message', (e) => { console.log("触发了jupytermessage"); console.log(e); - // that.modifyjupyter(); + if(e){ + if(e.data){ + if(e.data==="jupytermessage"){ + that.modifyjupyter(); + } + } + + } + }); setTimeout(this.getjianjiesize(), 1000); From 1e078211b0ba325957c4a60042ec4f929ca8eebb 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, 20 Dec 2019 13:57:50 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/shixunchild/Challenges/Challengesjupyter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 861b93c88..e9674b2ac 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -413,9 +413,9 @@ class Challengesjupyter extends Component { marginLeft: '30px', }} onClick={()=>this.onclki(true)}> } -

导入

-
+ {/*
导入

*/} + {/*
*/} : From a44e06b50671c91368329715440028b3595e79d8 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, 20 Dec 2019 14:12:00 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Challenges/Challengesjupyter.js | 234 +++++++----------- 1 file changed, 91 insertions(+), 143 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index e9674b2ac..d3aa910b8 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -8,7 +8,7 @@ import '../shixunchildCss/Challenges.css'; import axios from 'axios'; const $ = window.$; - +//12.20,14:11 class Challengesjupyter extends Component { constructor(props) { super(props) @@ -48,54 +48,33 @@ class Challengesjupyter extends Component { isopentitletype:"Less", }) } - this.getjianjiesize() } } }).catch((error) => { //console.log(error) }); } - - - getjianjiesize=()=>{ - let {ChallengesDataList}=this.state; - let boxoffsetHeigh; - let box=document.getElementById("shixunchallengesid"); - - if(box){ - boxoffsetHeigh=box.offsetHeight - if(ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined){ - - }else{ - if(this.state.isopentitletype==="greater"){ - - }else{ - if(boxoffsetHeigh>=300){ - this.setState({ - opentitletype:true, - isopentitletype:"greater", - boxoffsetHeigh:boxoffsetHeigh - }) - }else{ - this.setState({ - isopentitletype:"Less", - boxoffsetHeigh:boxoffsetHeigh - }) - } - } - - } - - } - } componentDidUpdate = (prevProps,prevState) => { //防止陷入无限循环 if(prevState.ChallengesDataList!=this.state.ChallengesDataList){ - if(this.state.isopentitletype==="greater"){ + let boxoffsetHeigh; + let box=document.getElementById("shixunchallengesid"); + if(box){ + boxoffsetHeigh=box.offsetHeight + if(boxoffsetHeigh<300){ + this.setState({ + isopentitletype:"Less", + boxoffsetHeigh:boxoffsetHeigh + }) + }else{ + this.setState({ + isopentitletype:"greater", + opentitletype:true, + boxoffsetHeigh:boxoffsetHeigh + }) + } - }else{ - this.getjianjiesize() } } @@ -105,9 +84,9 @@ class Challengesjupyter extends Component { setTimeout(this.ChallengesList(), 1000); let id = this.props.match.params.shixunId; let ChallengesURL = `/jupyters/get_info_with_tpm.json`; - let datas={ - identifier:id, - } + let datas={ + identifier:id, + } axios.get(ChallengesURL, {params: datas}).then((response) => { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { setTimeout(() => { @@ -115,26 +94,26 @@ class Challengesjupyter extends Component { 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) + }else{ - if(response.data.status===0){ - - setTimeout(() => { - this.setState({ - jupyter_url:response.data.url, - jupyter_port:response.data.port, - booljupyterurls:true, - }) - }, 800) - - }else{ - setTimeout(() => { - this.setState({ - booljupyterurls:true, - }) - }, 600) + setTimeout(() => { + this.setState({ + booljupyterurls:true, + }) + }, 600) - } } + } }).catch((error) => { @@ -145,10 +124,6 @@ class Challengesjupyter extends Component { }, 600) }); - setTimeout(this.getjianjiesize(), 1000); - - - window.addEventListener('message', (e) => { console.log("触发了jupytermessage"); @@ -163,8 +138,6 @@ class Challengesjupyter extends Component { } }); - setTimeout(this.getjianjiesize(), 1000); - } updatamakedowns = () => { @@ -218,13 +191,13 @@ class Challengesjupyter extends Component { modifyjupyter=()=>{ let id=this.props.match.params.shixunId; - var jupyter_port=""; - try{ - jupyter_port= parseInt(this.state.jupyter_port); - }catch (e) { - jupyter_port=this.state.jupyter_port; + var jupyter_port=""; + try{ + jupyter_port= parseInt(this.state.jupyter_port); + }catch (e) { + jupyter_port=this.state.jupyter_port; - } + } const url=`/jupyters/save_with_tpm.json`; const data={ identifier:id, @@ -234,7 +207,6 @@ class Challengesjupyter extends Component { .then((result) => { if (result.data.status === 0) { this.props.showNotification(`应用成功`); - console.log("触发了jupytermessage调用了应用成功"); } }).catch((error) => { }) @@ -245,15 +217,12 @@ class Challengesjupyter extends Component { opentitletype:!this.state.opentitletype }) } - onclki=(bool)=>{ this.setState({ enlarge:bool }) } - - render() { let{ChallengesDataList,booljupyterurls,enlarge}=this.state; let id = this.props.match.params.shixunId; @@ -263,8 +232,6 @@ 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 { @@ -286,39 +253,17 @@ class Challengesjupyter extends Component { - -
- - - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?:""} - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?"":this.state.isopentitletype==="greater"&&this.state.opentitletype===true? - :""} + } + :""} +

@@ -385,9 +330,8 @@ class Challengesjupyter extends Component { display: flex; flex-direction:row-reverse; } - ; - } + } ` } @@ -396,29 +340,33 @@ class Challengesjupyter extends Component { "" : ( - admin===true||business===true||mysidentity===true? -

-
-

任务详情

-

(请将实训题目写在下方并保存)

-
-
- { - enlarge===true? - this.onclki(false)}> - : - this.onclki(true)}> - } - {/*
导入

*/} - {/*
*/} + admin===true||business===true||mysidentity===true? +
+ +
+
+

任务详情

+

(请将实训题目写在下方并保存)

+
+
+ { + enlarge===true? + this.onclki(false)}> + : + this.onclki(true)}> + } + {/*
this.modifyjupyter(this.state)}>导入

*/} + {/*
*/} +
- : + + : "" ) @@ -450,25 +398,25 @@ class Challengesjupyter extends Component { } { - admin===true||business===true||mysidentity===true? -
-
- { - this.state.jupyter_url===null || this.state.jupyter_url===undefined? - ( - booljupyterurls===false? - - :"" - ) - : + admin===true||business===true||mysidentity===true? +
+
+ { + this.state.jupyter_url===null || this.state.jupyter_url===undefined? + ( + booljupyterurls===false? + + :"" + ) + : - } -
+ }
- :"" +
+ :"" }
From 9bcc7c810630902274b7afc2837950969caffbe3 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, 20 Dec 2019 14:15:45 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tpm/shixunchild/Challenges/Challengesjupyter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index d3aa910b8..804c485b5 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -341,9 +341,11 @@ class Challengesjupyter extends Component { : ( admin===true||business===true||mysidentity===true? -
+
-
+

任务详情

(请将实训题目写在下方并保存)

@@ -359,7 +361,7 @@ class Challengesjupyter extends Component { marginLeft: '30px', }} onClick={()=>this.onclki(true)}> } - {/*
this.modifyjupyter(this.state)}>导入

*/} {/*
*/}
From 16d95d842b79831b67b057387d6f32c192860dba 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, 20 Dec 2019 14:25:04 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/jupyter.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/javascripts/jupyter.js b/public/javascripts/jupyter.js index 7b2313139..50541f6e7 100644 --- a/public/javascripts/jupyter.js +++ b/public/javascripts/jupyter.js @@ -4,9 +4,18 @@ $(function(){ console.log("educoder jupyter js init"); + runEvery10Sec(); }) $(function(){ console.log("开始发送消息了"); window.parent.postMessage('jupytermessage','*'); + }) + +function runEvery10Sec() { + // 1000 * 10 = 10 秒钟 + console.log("每隔10秒中一次runEvery10Sec"); + setTimeout( runEvery10Sec, 1000 * 10 ); + +} From 4e803c511426cf1e1414dbb614039f176e1eb2a1 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, 20 Dec 2019 14:33:47 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/jupyter.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/public/javascripts/jupyter.js b/public/javascripts/jupyter.js index 50541f6e7..021d46a2e 100644 --- a/public/javascripts/jupyter.js +++ b/public/javascripts/jupyter.js @@ -2,20 +2,15 @@ //guange 2019.12.18 -$(function(){ - console.log("educoder jupyter js init"); - runEvery10Sec(); -}) - $(function(){ console.log("开始发送消息了"); - window.parent.postMessage('jupytermessage','*'); - + runEvery10Sec(); }) function runEvery10Sec() { // 1000 * 10 = 10 秒钟 console.log("每隔10秒中一次runEvery10Sec"); + window.parent.postMessage('jupytermessage','*'); setTimeout( runEvery10Sec, 1000 * 10 ); } From 71551ec21d421b82b2c9001576d9ca4c9672791f 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, 20 Dec 2019 14:43:25 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/shixunchild/Challenges/Challengesjupyter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 804c485b5..5e26ac86e 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -206,7 +206,8 @@ class Challengesjupyter extends Component { axios.get(url, {params: data}) .then((result) => { if (result.data.status === 0) { - this.props.showNotification(`应用成功`); + // this.props.showNotification(`应用成功`); + console.log("应用成功了"); } }).catch((error) => { }) From 6912f31c767f254ed6c6a8e99105a58a0d679e95 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 20 Dec 2019 14:56:07 +0800 Subject: [PATCH 14/20] update code --- .../components/controlSetting/index.js | 10 ++--- .../modules/developer/newOrEditTask/index.js | 4 +- .../modules/developer/studentStudy/index.js | 14 ++++-- .../leftpane/commitRecord/index.js | 15 ++++--- .../developer/studentStudy/rightpane/index.js | 6 ++- public/react/src/redux/actions/actionTypes.js | 2 + public/react/src/redux/actions/index.js | 4 ++ public/react/src/redux/actions/ojForUser.js | 23 +++++++++- .../src/redux/reducers/ojForUserReducer.js | 45 ++++++++++++++++--- 9 files changed, 100 insertions(+), 23 deletions(-) diff --git a/public/react/src/modules/developer/components/controlSetting/index.js b/public/react/src/modules/developer/components/controlSetting/index.js index 1d4d7834c..502f3ae09 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.js +++ b/public/react/src/modules/developer/components/controlSetting/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 16:02:36 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 19:47:32 + * @LastEditTime: 2019-12-20 14:37:39 */ import './index.scss'; import React, { useState, useRef, useEffect } from 'react'; @@ -24,7 +24,7 @@ const ControlSetting = (props) => { identifier, excuteState, showOrHideControl, - commitRecordDetail, + commitTestRecordDetail, changeLoadingState, changeSubmitLoadingStatus, changeShowOrHideControl, @@ -102,7 +102,7 @@ const ControlSetting = (props) => { @@ -137,14 +137,14 @@ const ControlSetting = (props) => { const mapStateToProps = (state) => { const {commonReducer, ojForUserReducer} = state; const {loading, excuteState, submitLoading, showOrHideControl } = commonReducer; - const { commitRecordDetail } = ojForUserReducer; + const { commitTestRecordDetail } = ojForUserReducer; return { loading, submitLoading, excuteState, showOrHideControl, // identifier: user_program_identifier, - commitRecordDetail // 提交详情 + commitTestRecordDetail // 提交详情 }; }; // changeSubmitLoadingStatus diff --git a/public/react/src/modules/developer/newOrEditTask/index.js b/public/react/src/modules/developer/newOrEditTask/index.js index 1c451c669..b498abe0d 100644 --- a/public/react/src/modules/developer/newOrEditTask/index.js +++ b/public/react/src/modules/developer/newOrEditTask/index.js @@ -70,13 +70,13 @@ const NewOrEditTask = (props) => { // 模拟挑战 const imitationChallenge = () => { // 调用 start 接口, 成功后跳转到模拟页面 - startProgramQuestion(identifier, props); + identifier && startProgramQuestion(identifier, props); } // 开始挑战 const startChallenge = () => { // 调用 start 接口, 成功后跳转到开启实战 // TODO - startProgramQuestion(identifier, props); + identifier && startProgramQuestion(identifier, props); } // 取消 diff --git a/public/react/src/modules/developer/studentStudy/index.js b/public/react/src/modules/developer/studentStudy/index.js index 15c87e64c..9039bf3ac 100644 --- a/public/react/src/modules/developer/studentStudy/index.js +++ b/public/react/src/modules/developer/studentStudy/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-23 10:53:19 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 19:48:20 + * @LastEditTime: 2019-12-20 14:54:39 */ import './index.scss'; import React, { useEffect, useState } from 'react'; @@ -92,9 +92,12 @@ function StudentStudy (props) { changeShowOrHideControl(false); props.saveEditorCodeForDetail(); props.history.push(`/problems/${_hack_id}/edit`); + props.clearOjForUserReducer(); } // 处理退出 const handleClickQuit = () => { + // 退出时,清空内容 + props.clearOjForUserReducer(); // 将控制台关闭 changeShowOrHideControl(false); props.saveEditorCodeForDetail(); @@ -116,7 +119,11 @@ function StudentStudy (props) {
{/* to={`/problems/${_hack_id}/edit`} */} - + 编辑 {/* to="/problems" */} @@ -168,7 +175,8 @@ const mapDispatchToProps = (dispatch) => ({ saveEditorCodeForDetail: (code) => dispatch(actions.saveEditorCodeForDetail(code)), // 恢复初始代码 restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)), - changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)) + changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)), + clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer()) }); export default withRouter(connect( diff --git a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js index 7b6cce9f8..90c486cca 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js +++ b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 09:49:33 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 11:44:22 + * @LastEditTime: 2019-12-20 13:55:07 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -73,6 +73,7 @@ const CommitRecord = (props) => { commitRecord, // excuteState, language, + operateType, commitRecordDetail, getUserCommitRecord } = props; @@ -146,8 +147,10 @@ const CommitRecord = (props) => { // 提交详情变化时,显示当前提交信息 useEffect(() => { // setRecordDetail(commitRecordDetail); - setRenderCtx(() => (renderRecordDetail)) - }, [commitRecordDetail]); + if (operateType === 'submit') { + setRenderCtx(() => (renderRecordDetail)) + } + }, [commitRecordDetail, operateType]); // 复制功能 let count = 0; useEffect(() => { @@ -198,7 +201,8 @@ const mapStateToProps = (state) => { user_program_identifier, commitRecordDetail, commitRecord, - hack + hack, + operateType } = ojForUserReducer; const { excuteState } = commonReducer; return { @@ -206,7 +210,8 @@ const mapStateToProps = (state) => { commitRecordDetail, commitRecord, // 提交记录 excuteState, // 代码执行状态 - language: hack.language + language: hack.language, + operateType } } const mapDispatchToProps = (dispatch) => ({ diff --git a/public/react/src/modules/developer/studentStudy/rightpane/index.js b/public/react/src/modules/developer/studentStudy/rightpane/index.js index af46d0aef..054997359 100644 --- a/public/react/src/modules/developer/studentStudy/rightpane/index.js +++ b/public/react/src/modules/developer/studentStudy/rightpane/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 14:59:51 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 19:13:05 + * @LastEditTime: 2019-12-20 14:01:57 */ import React, { useState, useEffect } from 'react'; import {connect} from 'react-redux'; @@ -27,6 +27,7 @@ const RightPane = (props) => { updateNotice, saveUserInputCode, restoreInitialCode, + saveOpacityType, saveUserCodeForInterval } = props; @@ -43,6 +44,7 @@ const RightPane = (props) => { const handleSubmitForm = () => { // 提交时, 先调用提交接口,提交成功后,循环调用测评接口 + // saveOpacityType('submit'); submitUserCode(identifier, submitInput, 'submit'); // // 提交时,先调用评测接口, 评测通过后才调用保存接口 // updateCode(identifier, submitInput, 'submit'); @@ -71,6 +73,7 @@ const RightPane = (props) => { // 代码调试 const handleDebuggerCode = (value) => { // 调用保存代码块接口,成功后,调用调试接口 + // saveOpacityType('debug'); updateCode(identifier, value, 'debug'); } // 恢复初始代码 @@ -137,6 +140,7 @@ const mapDispatchToProps = (dispatch) => ({ saveUserCodeForInterval: (identifier, code) => dispatch(actions.saveUserCodeForInterval(identifier, code)), // 恢复初始代码 restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)), + // saveOpacityType: (type) => dispatch(actions.saveOpacityType(type)) }); export default connect( diff --git a/public/react/src/redux/actions/actionTypes.js b/public/react/src/redux/actions/actionTypes.js index 1129a3235..144558c1d 100644 --- a/public/react/src/redux/actions/actionTypes.js +++ b/public/react/src/redux/actions/actionTypes.js @@ -51,6 +51,8 @@ const types = { SAVE_USER_INFO: 'SAVE_USER_INFO', // 只在用户信息 SAVE_HACK_IDENTIFIER: 'SAVE_HACK_IDENTIFIER', // 用户界面跑到编辑界面需要用的id值 SAVE_EDITOR_CODE: 'SAVE_EDITOR_CODE', // 保存详情页面中编辑时的代码 + CLICK_OPERATE_TYPE: 'CLICK_OPERATE_TYPE', // 点击类型 + CLEAR_OJ_FOR_USER_REDUCER: 'CLEAR_OJ_FOR_USER_REDUCER', // 退出时清空 ojForUserReducer保存内容 /*** jupyter */ GET_JUPYTER_DATA_SETS: 'GET_JUPYTER_DATA_SETS', // jupyter 数据集 GET_JUPYTER_TPI_URL: 'GET_JUPYTER_TPI_URL', // 获取 jupyter url diff --git a/public/react/src/redux/actions/index.js b/public/react/src/redux/actions/index.js index b42c4c2b6..93a0788cf 100644 --- a/public/react/src/redux/actions/index.js +++ b/public/react/src/redux/actions/index.js @@ -48,6 +48,8 @@ import { restoreInitialCode, saveUserCodeForInterval, saveEditorCodeForDetail, + saveOpacityType, + clearOjForUserReducer // isUpdateCodeCtx } from './ojForUser'; @@ -116,6 +118,8 @@ export default { getUserInfoForNew, saveUserCodeForInterval, saveEditorCodeForDetail, + saveOpacityType, + clearOjForUserReducer, // jupyter getJupyterTpiDataSet, getJupyterTpiUrl, diff --git a/public/react/src/redux/actions/ojForUser.js b/public/react/src/redux/actions/ojForUser.js index 994830280..89d826e69 100644 --- a/public/react/src/redux/actions/ojForUser.js +++ b/public/react/src/redux/actions/ojForUser.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:42:11 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-20 10:25:42 + * @LastEditTime: 2019-12-20 14:47:26 */ import types from "./actionTypes"; import { Base64 } from 'js-base64'; @@ -208,7 +208,10 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => { // 返回评测结果 dispatch({ type: types.COMMIT_RECORD_DETAIL, - payload: returnData + payload: { + type, + data: returnData + } }); if (!type || type === 'debug') { dispatch({ // 改变 loading 值 @@ -233,6 +236,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => { }); // 重新调用一下提交记录接口 dispatch(getUserCommitRecord(identifier)); + dispatch(saveOpacityType(type)); } } }).catch(err => { // 评测异常时 @@ -454,5 +458,20 @@ export const saveEditorCodeForDetail = (code) => { } } +// 保存操作类型: 提交或调试 +export const saveOpacityType = (type) => { + return { + type: types.CLICK_OPERATE_TYPE, + payload: type + } +} + + +export const clearOjForUserReducer = () => { + return { + type: types.CLEAR_OJ_FOR_USER_REDUCER + }; +} + // 更新通知状态 diff --git a/public/react/src/redux/reducers/ojForUserReducer.js b/public/react/src/redux/reducers/ojForUserReducer.js index 0c7594dd2..7e3740c19 100644 --- a/public/react/src/redux/reducers/ojForUserReducer.js +++ b/public/react/src/redux/reducers/ojForUserReducer.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:41:48 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 20:10:39 + * @LastEditTime: 2019-12-20 14:46:07 */ import types from "../actions/actionTypes"; import { Base64 } from 'js-base64'; @@ -13,6 +13,7 @@ const initialState = { user_program_identifier: '', // 开启OJ题的唯一标题 hack: {}, // 编程题主要内容 test_case: {}, // 测试用例 + commitTestRecordDetail: {}, // 调试代码执行结果 commitRecordDetail: {}, // 提交成功后记录提交的详情 commitRecord: [], // 提交记录 userCode: '', // 保存当前用户输入的代码 @@ -24,6 +25,7 @@ const initialState = { editor_code: '', // 保存编辑代码 notice: false, // 通知 hadCodeUpdate: false, // 更新代码 + operateType: '', // 点击类型: 调度或提交 }; const ojForUserReducer = (state = initialState, action) => { @@ -51,7 +53,7 @@ const ojForUserReducer = (state = initialState, action) => { test_case: Object.assign({}, test_case) } case types.COMMIT_RECORD_DETAIL: - let result = action.payload; + let result = action.payload.data; if (result['expected_output']) { result['expected_output'] = Base64.decode(result['expected_output']) } @@ -63,10 +65,18 @@ const ojForUserReducer = (state = initialState, action) => { } catch (e) { console.log('错误信息:', e); } - return { - ...state, - commitRecordDetail: Object.assign({}, result) + if (action.payload.type === 'submit') { + return { + ...state, + commitRecordDetail: Object.assign({}, result) + } + } else { + return { + ...state, + commitTestRecordDetail: Object.assign({}, result) + } } + case types.COMMIT_RECORD: return { ...state, @@ -144,6 +154,31 @@ const ojForUserReducer = (state = initialState, action) => { ...state, hadCodeUpdate: action.payload }; + case types.CLICK_OPERATE_TYPE: + return { + ...state, + operateType: action.payload + } + case types.CLEAR_OJ_FOR_USER_REDUCER: + return { + ...state, + user_program_identifier: '', // 开启OJ题的唯一标题 + hack: {}, // 编程题主要内容 + test_case: {}, // 测试用例 + commitTestRecordDetail: {}, // 调试代码执行结果 + commitRecordDetail: {}, // 提交成功后记录提交的详情 + commitRecord: [], // 提交记录 + userCode: '', // 保存当前用户输入的代码 + isUpdateCode: false, // 是否更新了代码内容 + userCodeTab: 'task', // 学员测评tab位置: task | record | comment + userTestInput: '', // 用户自定义输入值 + recordDetail: {}, // 根据id号获取的记录详情 + hack_identifier: '', // 用户界面编辑时 + editor_code: '', // 保存编辑代码 + notice: false, // 通知 + hadCodeUpdate: false, // 更新代码 + operateType: '', // 点击类型: 调度或提交 + }; default: return state; } From 8fcb7b9e259c2f9fbc6ec15624ceb9cf0d400470 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, 20 Dec 2019 14:56:09 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index c122289bb..bb07df5df 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -868,8 +868,8 @@ class TPMBanner extends Component { - { - this.props.is_jupyter===true?"": + {/*{*/} + {/* this.props.is_jupyter===true?"":*/} @@ -934,7 +934,7 @@ class TPMBanner extends Component {
- } + // } { From 5cf64eb4c12e07235edf223ce0283a5c1fd8af5f 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, 20 Dec 2019 14:57:52 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/shixunchild/Challenges/Challengesjupyter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 5e26ac86e..e137dc883 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -354,11 +354,11 @@ class Challengesjupyter extends Component {
{ enlarge===true? - this.onclki(false)}> : - this.onclki(true)}> } From de957b68d753287027e6b5e00e85bb7a936d5b40 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, 20 Dec 2019 14:59:49 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/tpm/shixunchild/shixunchildCss/Challenges.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css b/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css index d18370a51..1e1945f89 100644 --- a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css +++ b/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css @@ -187,7 +187,7 @@ } .ysliconfont{ text-align: center; - line-height: 30px; + line-height: 29px; } .fangdaone{ From f33bc9e22dc2b95407de906068c31e34e25c3082 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, 20 Dec 2019 15:07:03 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index bb07df5df..0a123e73a 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -934,7 +934,7 @@ class TPMBanner extends Component {
- // } + {/*// }*/} { From 674e30e2a364fa9d18e9a2d97f616f0b7e3de775 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 20 Dec 2019 15:15:46 +0800 Subject: [PATCH 19/20] update style --- .../src/modules/developer/components/controlSetting/index.scss | 2 +- .../react/src/modules/developer/components/userInfo/index.scss | 1 + .../src/modules/developer/studentStudy/leftpane/index.scss | 2 +- public/react/src/modules/tpm/jupyter/rightPane/index.scss | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/developer/components/controlSetting/index.scss b/public/react/src/modules/developer/components/controlSetting/index.scss index 31beda8a5..231358ea0 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.scss +++ b/public/react/src/modules/developer/components/controlSetting/index.scss @@ -51,7 +51,7 @@ align-items: center; z-index: 20; height: 56px; - padding-right: 30px; + padding-right: 20px; padding-left: 10px; background: rgba(18,28,36,1); // background:rgba(48,48,48,1); diff --git a/public/react/src/modules/developer/components/userInfo/index.scss b/public/react/src/modules/developer/components/userInfo/index.scss index f9ea713f8..25c85d0e3 100644 --- a/public/react/src/modules/developer/components/userInfo/index.scss +++ b/public/react/src/modules/developer/components/userInfo/index.scss @@ -3,6 +3,7 @@ position: absolute; color: #fff; line-height: 65px; + left: 20px; // height: 65px; .student_img, .student_nicker{ diff --git a/public/react/src/modules/developer/studentStudy/leftpane/index.scss b/public/react/src/modules/developer/studentStudy/leftpane/index.scss index a48d021f9..b5362429f 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/index.scss +++ b/public/react/src/modules/developer/studentStudy/leftpane/index.scss @@ -65,7 +65,7 @@ .student_study_header{ .study_quit{ position: absolute; - right: 30px; + right: 20px; } .quit-btn{ cursor: pointer; diff --git a/public/react/src/modules/tpm/jupyter/rightPane/index.scss b/public/react/src/modules/tpm/jupyter/rightPane/index.scss index 4facded6b..fe2d52456 100644 --- a/public/react/src/modules/tpm/jupyter/rightPane/index.scss +++ b/public/react/src/modules/tpm/jupyter/rightPane/index.scss @@ -68,7 +68,7 @@ align-items: center; height: 56px; justify-content: flex-end; - padding-right: 30px; + padding-right: 20px; } } } \ No newline at end of file From 76a67e76711d7752ec3abce64ec0388715ec36f7 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, 20 Dec 2019 16:10:33 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/shixunchild/Challenges/Challengesjupyter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index e137dc883..bf98054d7 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -98,8 +98,11 @@ class Challengesjupyter extends Component { if(response.data.status===0){ setTimeout(() => { + + var url=response.data.url; + var url2=url.replace("http://","https://"); this.setState({ - jupyter_url:response.data.url, + jupyter_url:url2, jupyter_port:response.data.port, booljupyterurls:true, })