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/5] =?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/5] . --- 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/5] =?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 b1ca2286a10b1f61dfd33e3f7b946bab532b15f1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 2 Jan 2020 11:48:33 +0800 Subject: [PATCH 4/5] fixbug --- ...s.rb => 20200102030946_modify_course_group_for_courses.rb} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename db/migrate/{20200102030945_modify_course_group_for_courses.rb => 20200102030946_modify_course_group_for_courses.rb} (86%) diff --git a/db/migrate/20200102030945_modify_course_group_for_courses.rb b/db/migrate/20200102030946_modify_course_group_for_courses.rb similarity index 86% rename from db/migrate/20200102030945_modify_course_group_for_courses.rb rename to db/migrate/20200102030946_modify_course_group_for_courses.rb index 6e71af35b..e36bc9e0b 100644 --- a/db/migrate/20200102030945_modify_course_group_for_courses.rb +++ b/db/migrate/20200102030946_modify_course_group_for_courses.rb @@ -4,7 +4,9 @@ class ModifyCourseGroupForCourses < ActiveRecord::Migration[5.2] ActiveRecord::Base.transaction do groups.each do |g| CourseGroup.where(name: g.name).where.not(id: g.id).each do |cg| - cg.course_members.update_all(course_group_id: g.id) + cg.course_members.each do |cm| + cm.update_attributes!(course_group_id: g.id) + end cg.exercise_group_settings.update_all(course_group_id: g.id) cg.attachment_group_settings.update_all(course_group_id: g.id) cg.homework_group_reviews.update_all(course_group_id: g.id) From 000585cf126b02c208b89e7ff4b5840aefaabd6b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 2 Jan 2020 11:50:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E5=88=86=E7=8F=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20200102030946_modify_course_group_for_courses.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20200102030946_modify_course_group_for_courses.rb b/db/migrate/20200102030946_modify_course_group_for_courses.rb index e36bc9e0b..8df0943b3 100644 --- a/db/migrate/20200102030946_modify_course_group_for_courses.rb +++ b/db/migrate/20200102030946_modify_course_group_for_courses.rb @@ -1,6 +1,6 @@ class ModifyCourseGroupForCourses < ActiveRecord::Migration[5.2] def change - groups = CourseGroup.where(course_id:3128).order("created_at desc").group(:name) + groups = CourseGroup.where(course_id:3429).order("created_at desc").group(:name) ActiveRecord::Base.transaction do groups.each do |g| CourseGroup.where(name: g.name).where.not(id: g.id).each do |cg|