From f5aa02a775f65e5110f2e024d9a279b539492657 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 Dec 2019 14:04:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?jupyter=20get=E6=97=B6=E4=BC=A0=E5=85=A5git?= =?UTF-8?q?url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/jupyter_service.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index 29f54cb02..66869d275 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -8,7 +8,7 @@ module JupyterService uri = "#{shixun_tomcat}/bridge/jupyter/get" tpiID = "tpm#{shixun.id}" mount = shixun.data_sets.present? - params = {tpiID: tpiID, identifier: shixun.identifier, needMount: mount, + params = {tpiID: tpiID, identifier: shixun.identifier, needMount: mount, gitUrl: '', :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"} logger.info "test_juypter: uri->#{uri}, params->#{params}" @@ -48,8 +48,14 @@ module JupyterService tpiID = myshixun.id mount = myshixun.shixun.data_sets.present? - params = {tpiID: tpiID, identifier: shixun.identifier, myshixunIdentifier: myshixun.identifier, needMount: mount, - :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"} + + gitUrl = "#{edu_setting('git_address_domain')}/#{myshixun.repo_path}" + params = { tpiID: tpiID, + identifier: shixun.identifier, + myshixunIdentifier: myshixun.identifier, + gitUrl: giturl, + needMount: mount, + :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"} res = uri_post uri, params logger.info "test_juypter: #{res}" From cdd402c2706cf22aa2d2ad447bc55b53c603cbb7 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 Dec 2019 21:56:56 +0800 Subject: [PATCH 2/4] . --- app/services/jupyter_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index 66869d275..2d43a0987 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -53,7 +53,7 @@ module JupyterService params = { tpiID: tpiID, identifier: shixun.identifier, myshixunIdentifier: myshixun.identifier, - gitUrl: giturl, + gitUrl: gitUrl, needMount: mount, :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"} res = uri_post uri, params From 1f070d0dc073178dd741d31c145f96c77c93fc4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 2 Jan 2020 11:45:56 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4jupyter=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunchild/Challenges/Challengesjupyter.js | 15 ++++++++------- public/react/src/redux/actions/jupyter.js | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 3fa98e88c..221f90764 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -113,16 +113,16 @@ class Challengesjupyter extends Component { }else{ if(response.data.status===0){ - if(response.data.useSeconds===null){ + if(response.data.remainingSeconds===null){ this.handleClickResetTpi() }else{ - let useSeconds=response.data.useSeconds; - let summain=3600 * 1000; - let sums= useSeconds * 1000; - let sum=summain-sums; + let remainingSeconds=response.data.remainingSeconds; + // let summain=3600 * 1000; + let sums= remainingSeconds * 1000; + // let sum=summain-sums; setTimeout(()=>{ this.setState({ - jupytertime:Date.now() +sum + jupytertime:Date.now() +sums }) },500); } @@ -420,6 +420,7 @@ class Challengesjupyter extends Component { onFinish=()=>{ let id=this.props.match.params.shixunId; + let that=this; Modal.confirm({ title: '倒计时截止', content: ( @@ -430,7 +431,7 @@ class Challengesjupyter extends Component { okText: '确定', cancelText: '取消', onOk () { - this.handleClickResetTpisync_code(id) + that.handleClickResetTpisync_code(id) } }) } diff --git a/public/react/src/redux/actions/jupyter.js b/public/react/src/redux/actions/jupyter.js index bb56ac6c8..47ddb2149 100644 --- a/public/react/src/redux/actions/jupyter.js +++ b/public/react/src/redux/actions/jupyter.js @@ -259,11 +259,11 @@ export const timeinfo_with_tpi = (identifier, dispatch) => { onCancel() {} }) }else{ - let useSeconds=res.data.useSeconds; - let summain=3600 * 1000; - let sums= useSeconds * 1000; - let sum=summain-sums; - setTimeout(()=>{ dispatch(addjypertime(Date.now() +sum))},500); + let remainingSeconds=res.data.remainingSeconds; + // let summain=3600 * 1000; + let sums= remainingSeconds * 1000; + // let sum=summain-sums; + setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums))},500); } } } From 7f4989a039cf65a82b13d106acc6759c6ae470fc Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Thu, 2 Jan 2020 12:39:35 +0800 Subject: [PATCH 4/4] update test-code style --- public/react/src/modules/page/VNC.css | 27 +++++++ public/react/src/modules/page/VNCContainer.js | 24 ++++-- .../src/modules/page/main/ActionView.css | 2 + .../src/modules/page/main/CodeEvaluateView.js | 62 ++++++++------- .../page/main/CodeRepositoryViewContainer.js | 76 +++++++++++++------ 5 files changed, 130 insertions(+), 61 deletions(-) diff --git a/public/react/src/modules/page/VNC.css b/public/react/src/modules/page/VNC.css index 58a45d735..637cc3589 100644 --- a/public/react/src/modules/page/VNC.css +++ b/public/react/src/modules/page/VNC.css @@ -39,6 +39,7 @@ user-select: none; } + .btn_test_case, .btn_test_case_active{ display: inline-block; @@ -80,6 +81,32 @@ bottom: 4px; } +.blacktab_con_abs{ + position: absolute !important; + left: 150px; + right: 150px; + top: 0; + height: 34px; + background: gold; +} +.code_evalute_icon{ + position: absolute; + top: 0; + width: 56px; + height: 28px; + left: 50%; + margin-left: -28px; + background: rgba(42,58,79,1); + z-index: 10; + border-bottom-left-radius: 100px; + border-bottom-right-radius: 100px; + color: #fff; + text-align: center; + cursor: pointer; + opacity: .4; + transition: all .3s; +} + @keyframes mymove { from {right:0px;} diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index 30e439e8d..93da489d5 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -224,6 +224,10 @@ class VNCContainer extends Component { >