From 293a0c2e33412355deb9b108b9714eb2416d70f5 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 13 Dec 2019 21:03:34 +0800 Subject: [PATCH 01/43] cancel status --- public/react/src/redux/actions/jupyter.js | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/public/react/src/redux/actions/jupyter.js b/public/react/src/redux/actions/jupyter.js index 5df1babf6..f641bb20f 100644 --- a/public/react/src/redux/actions/jupyter.js +++ b/public/react/src/redux/actions/jupyter.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-12 09:01:30 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-13 15:27:13 + * @LastEditTime: 2019-12-13 21:02:48 */ import types from "./actionTypes"; import { message } from 'antd'; @@ -25,18 +25,18 @@ export const getJupyterInfo = (id) => { if (res.data.status === 401) return; if (res.status === 200) { const { data } = res; - if (data.status === 0) { - dispatch({ - type: types.SAVE_JUPYTER_INFO, - payload: data - }); - const { identifier, myshixun_identifier } = data; - dispatch(saveJupyterIdentifier(identifier)); - // 调用获取数据集接口 - dispatch(getJupyterTpiDataSet(identifier, jupyter_pagination)); - // 调用获取url接口 - dispatch(getJupyterTpiUrl({identifier: myshixun_identifier})); - } + // if (data.status === 0) { + dispatch({ + type: types.SAVE_JUPYTER_INFO, + payload: data + }); + const { identifier, myshixun_identifier } = data; + dispatch(saveJupyterIdentifier(identifier)); + // 调用获取数据集接口 + dispatch(getJupyterTpiDataSet(identifier, jupyter_pagination)); + // 调用获取url接口 + dispatch(getJupyterTpiUrl({identifier: myshixun_identifier})); + // } } }) } From 3f0e90ef0c1aa19721ef05bd96df3d327e1bfd2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Dec 2019 21:04:21 +0800 Subject: [PATCH 02/43] =?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/TPMsettings/TPMsettings.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 2b389245b..651818da7 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -96,8 +96,8 @@ export default class TPMsettings extends Component { operateshixunstype: false, }); - // window.location.href = "/shixuns"; - this.props.history.replace( "/shixuns/"); + window.location.href = "/shixuns"; + // this.props.history.replace( "/shixuns/"); } }).catch((error) => { console.log(error) @@ -114,8 +114,8 @@ export default class TPMsettings extends Component { operateshixunstype: false, }); - // window.location.href = "/shixuns/" + id + "/challenges"; - this.props.history.replace( "/shixuns/" + id + "/challenges"); + window.location.href = "/shixuns/" + id + "/challenges"; + // this.props.history.replace( "/shixuns/" + id + "/challenges"); } }).catch((error) => { console.log(error) From 758bb904addafb68ac49c2cf14471bb6108454b4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 21:13:06 +0800 Subject: [PATCH 03/43] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/jupyter_service.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index d35d9a041..ef31b8a14 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -20,8 +20,10 @@ module JupyterService logger.info "test_juypter: #{res}" @shixun_jupyter_port = res['port'] - - return "https://#{res['port']}.jupyter.educoder.net/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" + jupyter_service = edu_setting('jupyter_service') + + + return "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" end end @@ -62,7 +64,9 @@ module JupyterService repo_save_path = myshixun.repo_save_path - "https://#{res['port']}.jupyter.educoder.net/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" + jupyter_service = edu_setting('jupyter_service') + + "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" end end @@ -85,8 +89,10 @@ module JupyterService tpiID = "tpm#{shixun.id}" + jupyter_service = edu_setting('jupyter_service') + #https://47526.jupyter.educoder.net/nbconvert/notebook/data/workspace/myshixun_570461/f2ef5p798r20191210163135/01.ipynb?download=true - src_url = "https://#{jupyter_port}.jupyter.educoder.net/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" + src_url = "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" response = Faraday.get(src_url) if response.status.to_i != 200 @@ -113,8 +119,9 @@ module JupyterService tpiID = myshixun.id repo_save_path = myshixun.repo_save_path + jupyter_service = edu_setting('jupyter_service') - src_url = "https://#{jupyter_port}.jupyter.educoder.net/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" + src_url = "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" response = Faraday.get(src_url) if response.status.to_i != 200 From 374880d39dc435edf3b234e70ec8ae48323954e2 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 21:23:49 +0800 Subject: [PATCH 04/43] 1 --- app/controllers/shixuns_controller.rb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f75dacecc..c65d2c211 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -408,16 +408,14 @@ class ShixunsController < ApplicationController smr.update_attributes(service) end # 添加第二仓库(管理员权限) - if current_user.admin_or_business? - if params[:is_secret_repository] - add_secret_repository if @shixun.shixun_secret_repository.blank? - else - # 如果有仓库,就要删 - if @shixun.shixun_secret_repository&.repo_name - @shixun.shixun_secret_repository.lock! - GitService.delete_repository(repo_path: @shixun.shixun_secret_repository.repo_path) - @shixun.shixun_secret_repository.destroy - end + if params[:is_secret_repository] + add_secret_repository if @shixun.shixun_secret_repository.blank? + else + # 如果有仓库,就要删 + if @shixun.shixun_secret_repository&.repo_name + @shixun.shixun_secret_repository.lock! + GitService.delete_repository(repo_path: @shixun.shixun_secret_repository.repo_path) + @shixun.shixun_secret_repository.destroy end end end From 696801c62c8dcc518c64f28103c588c7940bcdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Dec 2019 21:40:11 +0800 Subject: [PATCH 05/43] =?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 | 4 ++-- public/react/src/modules/tpm/TPMsettings/Shixuninformation.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index bf13313fd..c7cc7fba9 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -1096,8 +1096,8 @@ class TPMBanner extends Component { -
申请公开成功后,您的实训将会展示实训列表
-
您将获得关卡对应的经验值和金币
+
平台审核完成后,您的实训将会录入到平台的公共实训项目列表
+
您将获得实训对应的经验值和金币
} diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index 2fdd30146..f3ec8e300 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -1037,7 +1037,7 @@ class Shixuninformation extends Component { { this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter===true?"": 私密版本库: + checked={this.state.simichecked}> {this.state.simichecked===false?"(若需要对学员隐藏部分版本库内容时,请选中;选中保存后表示启用私密版本库,请将需要对学员隐藏的文件存储在私密版本库)":"已创建的私密版本库及其内容,将在“保存”时被删除"} } From fea0a2603824954545508a23dea85fcbf7bc832e Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 13 Dec 2019 21:46:31 +0800 Subject: [PATCH 06/43] commit --- public/react/src/modules/tpm/jupyter/leftPane/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/jupyter/leftPane/index.js b/public/react/src/modules/tpm/jupyter/leftPane/index.js index 5e27dfafd..ea3c7a6c7 100644 --- a/public/react/src/modules/tpm/jupyter/leftPane/index.js +++ b/public/react/src/modules/tpm/jupyter/leftPane/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-12 10:34:03 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-13 16:28:33 + * @LastEditTime: 2019-12-13 21:19:30 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -71,7 +71,7 @@ function LeftPane (props) { {/* 数据集 */} { renderCtx } -
+
0 ? 'flex' : 'none'}}> Date: Fri, 13 Dec 2019 21:51:53 +0800 Subject: [PATCH 07/43] 1 --- app/services/jupyter_service.rb | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index ef31b8a14..070009cd6 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -22,8 +22,13 @@ module JupyterService @shixun_jupyter_port = res['port'] jupyter_service = edu_setting('jupyter_service') - - return "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" + url = + if request.subdomain != "www" + "https://#{jupyter_service}:#{res['port']}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" + else + "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" + end + return url end end @@ -66,7 +71,12 @@ module JupyterService jupyter_service = edu_setting('jupyter_service') - "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" + if request.subdomain != "www" + "https://#{jupyter_service}:#{res['port']}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" + else + "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" + end + end end @@ -90,9 +100,13 @@ module JupyterService tpiID = "tpm#{shixun.id}" jupyter_service = edu_setting('jupyter_service') - + src_url = + if request.subdomain != "www" + "https://#{jupyter_service}:#{jupyter_port}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" + else + "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" + end #https://47526.jupyter.educoder.net/nbconvert/notebook/data/workspace/myshixun_570461/f2ef5p798r20191210163135/01.ipynb?download=true - src_url = "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" response = Faraday.get(src_url) if response.status.to_i != 200 @@ -121,7 +135,13 @@ module JupyterService repo_save_path = myshixun.repo_save_path jupyter_service = edu_setting('jupyter_service') - src_url = "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" + src_url = + if request.subdomain != "www" + "https://#{jupyter_service}:#{jupyter_port}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" + else + "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" + end + response = Faraday.get(src_url) if response.status.to_i != 200 From 1f7bd8b8dc661edf57246ef49d72abc0396c2c81 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 22:02:37 +0800 Subject: [PATCH 08/43] 1 --- app/services/jupyter_service.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index 070009cd6..143b2eda7 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -23,7 +23,7 @@ module JupyterService jupyter_service = edu_setting('jupyter_service') url = - if request.subdomain != "www" + if false "https://#{jupyter_service}:#{res['port']}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" else "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" @@ -71,7 +71,7 @@ module JupyterService jupyter_service = edu_setting('jupyter_service') - if request.subdomain != "www" + if false "https://#{jupyter_service}:#{res['port']}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" else "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" @@ -101,7 +101,7 @@ module JupyterService jupyter_service = edu_setting('jupyter_service') src_url = - if request.subdomain != "www" + if false "https://#{jupyter_service}:#{jupyter_port}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" else "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" @@ -136,7 +136,7 @@ module JupyterService jupyter_service = edu_setting('jupyter_service') src_url = - if request.subdomain != "www" + if false "https://#{jupyter_service}:#{jupyter_port}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" else "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" From 3d87b559ee66d8d7dc9296e68eb97265496ba065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Dec 2019 22:15:32 +0800 Subject: [PATCH 09/43] =?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 | 4 ++-- .../modules/tpm/TPMsettings/Configuration.js | 18 ++++++++++++++++-- .../src/modules/tpm/TPMsettings/TPMsettings.js | 4 ++-- .../src/modules/tpm/newshixuns/Newshixuns.js | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index c7cc7fba9..ae2d4b8af 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -366,7 +366,7 @@ class TPMBanner extends Component { Modalstype: true, Modalstopval: "是否确认撤销发布?", modalsMidval:"撤销发布后,学员将无法进行练习,若您新增关", - ModalsBottomval:"卡,学员需要重新体验课程", + ModalsBottomval:"卡,学员需要重新体验实训", ModalCancel: this.ModalCancel, ModalSave: this.ModalSave, modalstyles:"848282" @@ -1223,7 +1223,7 @@ class TPMBanner extends Component { } - {this.props.identity < 5 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0? + {this.props.identity < 6 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?
diff --git a/public/react/src/modules/tpm/TPMsettings/Configuration.js b/public/react/src/modules/tpm/TPMsettings/Configuration.js index 070f5b156..f8d6be728 100644 --- a/public/react/src/modules/tpm/TPMsettings/Configuration.js +++ b/public/react/src/modules/tpm/TPMsettings/Configuration.js @@ -72,11 +72,18 @@ export default class Shixuninformation extends Component { componentDidMount() { if (this.props.data) { if (this.props.data.shixun) { + let time =this.props.data && this.props.data.shixun.opening_time; + let timetype=false; + if(!time){ + timetype=false; + }else{ + timetype=true; + } this.setState({ can_copy: this.props.data && this.props.data.shixun.can_copy === undefined ? false : this.props.data && this.props.data.shixun.can_copy, use_scope: this.props.data && this.props.data.shixun.use_scope, opening_time: this.props.data && this.props.data.shixun.opening_time, - opentime: !this.props.data && this.props.data.shixun.opening_time ? false : true, + opentime: timetype, oldscope_partment: this.props.data && this.props.data.shixun.scope_partment, }) } @@ -100,11 +107,18 @@ export default class Shixuninformation extends Component { if (prevProps.data != this.props.data) { if (this.props.data) { if (this.props.data.shixun) { + let time =this.props.data && this.props.data.shixun.opening_time; + let timetype=false; + if(!time){ + timetype=false; + }else{ + timetype=true; + } this.setState({ can_copy: this.props.data && this.props.data.shixun.can_copy === undefined ? false : this.props.data && this.props.data.shixun.can_copy, use_scope: this.props.data && this.props.data.shixun.use_scope, opening_time: this.props.data && this.props.data.shixun.opening_time, - opentime: !this.props.data && this.props.data.shixun.opening_time ? false : true, + opentime: timetype, oldscope_partment: this.props.data && this.props.data.shixun.scope_partment, }) } diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 651818da7..e27cf126c 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -57,14 +57,14 @@ export default class TPMsettings extends Component { }); if(key==="3"&&this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === true){ - this.props.history.replace(`/shixuns/${this.props.match.params.shixunId}/challenges`); + window.location.href =`/shixuns/${this.props.match.params.shixunId}/challenges`; }else{ if(key){ this.setState({ activeKeys:key }) }else{ - this.props.history.replace(`/shixuns/${this.props.match.params.shixunId}/challenges`); + window.location.href =`/shixuns/${this.props.match.params.shixunId}/challenges`; } } diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 8355efb52..523493e69 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -458,7 +458,7 @@ class Newshixuns extends Component {
{this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.business===true? {getFieldDecorator('is_jupyter')( - + 普通实训 Jupyter实训 , From 926586fe2d752189edaaca1651dbf9b2a2c953f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Dec 2019 22:23:37 +0800 Subject: [PATCH 10/43] =?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/config/webpack.config.prod.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 596843f5f..1fe7a6c93 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: false, - drop_console: false + drop_debugger: true, + drop_console: true } } }), From 57714ddf868e319bc7141f2685c6246b5f961834 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 22:29:36 +0800 Subject: [PATCH 11/43] 1 --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index c65d2c211..9261d34f3 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -774,7 +774,7 @@ class ShixunsController < ApplicationController end rescue => e uid_logger_error(e.message) - tip_exception("实训云平台繁忙(繁忙等级:81)") + tip_exception("#{e.message}") end end From f823bd0b7eda165a689e809c5850b25f8a5d386d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 22:34:02 +0800 Subject: [PATCH 12/43] 1 --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 9261d34f3..7dd7c9b18 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -756,7 +756,7 @@ class ShixunsController < ApplicationController else commit = GitService.commits(repo_path: @repo_path).try(:first) uid_logger("First comit########{commit}") - tip_exception("开启实战前请先在版本库中提交代码") if commit.blank? + tip_exception("开启挑战前,请先在Jupyter中填写内容") if commit.blank? commit_id = commit["id"] cloud_bridge = edu_setting('cloud_bridge') myshixun_identifier = generate_identifier Myshixun, 10 From 7d6ad09f19e1c7ba811c4de20a7afce9261ca64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Dec 2019 22:36:15 +0800 Subject: [PATCH 13/43] =?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/TPMsettings/Configuration.js | 6 ++++++ public/react/src/modules/tpm/newshixuns/Newshixuns.js | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/Configuration.js b/public/react/src/modules/tpm/TPMsettings/Configuration.js index f8d6be728..848f853d6 100644 --- a/public/react/src/modules/tpm/TPMsettings/Configuration.js +++ b/public/react/src/modules/tpm/TPMsettings/Configuration.js @@ -271,9 +271,15 @@ export default class Shixuninformation extends Component { } setopentime = (e) => { + if(e.target.checked===false){ + this.setState({ + opening_time:null + }) + } this.setState({ opentime: e.target.checked }) + } render() { diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 523493e69..bf744abde 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -456,14 +456,14 @@ class Newshixuns extends Component {
- {this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.business===true? + {getFieldDecorator('is_jupyter')( 普通实训 - Jupyter实训 + {this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.business===true?Jupyter实训:""} , )} - :""} + Date: Fri, 13 Dec 2019 22:47:12 +0800 Subject: [PATCH 14/43] update --- public/react/src/modules/tpm/jupyter/leftPane/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/jupyter/leftPane/index.js b/public/react/src/modules/tpm/jupyter/leftPane/index.js index ea3c7a6c7..d87be9064 100644 --- a/public/react/src/modules/tpm/jupyter/leftPane/index.js +++ b/public/react/src/modules/tpm/jupyter/leftPane/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-12 10:34:03 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-13 21:19:30 + * @LastEditTime: 2019-12-13 22:46:51 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -71,7 +71,7 @@ function LeftPane (props) { {/* 数据集 */} { renderCtx } -
0 ? 'flex' : 'none'}}> +
Date: Fri, 13 Dec 2019 22:47:22 +0800 Subject: [PATCH 15/43] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A1=9E=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMDataset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index 619dea9e1..f1ac1afec 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -181,7 +181,7 @@ class TPMDataset extends Component { getdatastwo = (page,limit) => { let id=this.props.match.params.shixunId; - let collaborators=`/shixuns/${id}/jupyter_data_sets.json`; + let collaborators=`/shixuns/${id}/get_data_sets.json`; axios.get(collaborators,{params:{ page:page, limit:limit, @@ -233,7 +233,7 @@ class TPMDataset extends Component { getdatasthree = (page,limit) => { let id=this.props.match.params.shixunId; - let collaborators=`/shixuns/${id}/jupyter_data_sets.json`; + let collaborators=`/shixuns/${id}/get_data_sets.json`; axios.get(collaborators,{params:{ page:page, limit:limit, From 314a7cfa76dd1faafdcd0377288aeaad5b001fd8 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 13 Dec 2019 23:04:32 +0800 Subject: [PATCH 16/43] add reload page --- public/react/src/redux/actions/jupyter.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/react/src/redux/actions/jupyter.js b/public/react/src/redux/actions/jupyter.js index f641bb20f..57c12e6d3 100644 --- a/public/react/src/redux/actions/jupyter.js +++ b/public/react/src/redux/actions/jupyter.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-12 09:01:30 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-13 21:02:48 + * @LastEditTime: 2019-12-13 23:03:27 */ import types from "./actionTypes"; import { message } from 'antd'; @@ -100,7 +100,12 @@ export const syncJupyterCode = (identifier, msg) => { if (res.data.status === 401) return; if (res.status === 200) { const {status} = res.data - if (status === 0) message.success(msg); + if (status === 0) { + message.success(msg); + setTimeout(() => { + window.location.reload(); + }, 300); + } } }) } From 1484a93a9dee977128f8ad1c419c701fc35b1a31 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 23:05:45 +0800 Subject: [PATCH 17/43] =?UTF-8?q?=E9=99=84=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 45689728e..5fc81c5d5 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -68,7 +68,6 @@ class AttachmentsController < ApplicationController @attachment.author_id = current_user.id @attachment.disk_directory = month_folder @attachment.cloud_url = remote_path - @attachment.disk_directory = save_path @attachment.save! else logger.info "文件已存在,id = #{@attachment.id}, filename = #{@attachment.filename}" From 9887276d2b7e2d864b03a894f28c5217202c4d6e 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, 13 Dec 2019 23:12:00 +0800 Subject: [PATCH 18/43] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A1=9E=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMDataset.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index f1ac1afec..de2ac69ef 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -156,8 +156,10 @@ class TPMDataset extends Component { selectedRowKeysdata:[], selectedRowKeys: [], checked:false, + page:1, }); + } } @@ -209,6 +211,7 @@ class TPMDataset extends Component { selectedRowKeysdata:[], selectedRowKeys: [], checked:false, + page:page, }); } From fa1b06b01ad294200cee8671bea093a0468eec0e 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, 13 Dec 2019 23:17:48 +0800 Subject: [PATCH 19/43] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A1=9E=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMDataset.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMDataset.js b/public/react/src/modules/tpm/TPMDataset.js index de2ac69ef..85ce2006e 100644 --- a/public/react/src/modules/tpm/TPMDataset.js +++ b/public/react/src/modules/tpm/TPMDataset.js @@ -301,10 +301,19 @@ class TPMDataset extends Component { this.setState({ fileList: appendFileSizeToUploadFileAll(fileList), }); + if(info.file.status === 'done'){ //done 成功就会调用这个方法 - this.getdatas(); + if(info.file.response){ + if(info.file.response.status===-1||info.file.response.status==="-1"){ + + }else{ + this.getdatas(); + + } + } } + if(info.file.response){ if(info.file.response.status===-1||info.file.response.status==="-1"){ // console.log("准备显示弹框了"); @@ -321,6 +330,8 @@ class TPMDataset extends Component { tittest:info.file.response.message, itemtypebool:itemtype>-1?true:itemtype<=-1?false:false, }) + }else{ + } } From 3098c05f9f55a2a700772ce908ee8cfde7e7ae0b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 23:19:24 +0800 Subject: [PATCH 20/43] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 7dd7c9b18..42b54ab2a 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -459,7 +459,7 @@ class ShixunsController < ApplicationController def get_data_sets page = params[:page] || 1 limit = params[:limit] || 10 - data_sets = @shixun.data_sets + data_sets = @shixun.data_sets.order("created_on desc") @data_count = data_sets.count @data_sets= data_sets.page(page).per(limit) @absolute_folder = edu_setting('shixun_folder') From 75bcacb623ece824bab5073ee719e3eca502ed33 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 13 Dec 2019 23:19:39 +0800 Subject: [PATCH 21/43] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 42b54ab2a..1c8928d98 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -459,9 +459,9 @@ class ShixunsController < ApplicationController def get_data_sets page = params[:page] || 1 limit = params[:limit] || 10 - data_sets = @shixun.data_sets.order("created_on desc") + data_sets = @shixun.data_sets @data_count = data_sets.count - @data_sets= data_sets.page(page).per(limit) + @data_sets= data_sets.order("created_on desc").page(page).per(limit) @absolute_folder = edu_setting('shixun_folder') end From 945b62cad5d15adb242fce6212c151ee710712b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Dec 2019 23:31:22 +0800 Subject: [PATCH 22/43] =?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 ae2d4b8af..7246a03a2 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -1223,7 +1223,7 @@ class TPMBanner extends Component { } - {this.props.identity < 6 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0? + {this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?
From 33769d22d52faba738b54c7a1f3e08f10f9baae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 14 Dec 2019 00:02:14 +0800 Subject: [PATCH 23/43] =?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, 6 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 cfa143ee0..1d713acc3 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -183,8 +183,12 @@ class Challengesjupyter extends Component { render() { let{ChallengesDataList,booljupyterurls}=this.state; let id = this.props.match.params.shixunId; + //老师 const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; - + //运营人员 + 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; return ( @@ -297,7 +301,7 @@ class Challengesjupyter extends Component { } { - is_teacher===true? + is_teacher===true||admin===true||business===true?
{ From edccad947ce5d127d12960682c3bac6ca169d22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 14 Dec 2019 13:36:04 +0800 Subject: [PATCH 24/43] =?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 | 7 ++++++- 1 file changed, 6 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 1d713acc3..38f06340c 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -189,7 +189,12 @@ 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; + let mysidentity =false; + try { + mysidentity =this.props.identity < 5 &&ChallengesDataList&& ChallengesDataList.shixun_status< 3?true:false; + }catch (e) { + } return ( @@ -301,7 +306,7 @@ class Challengesjupyter extends Component { } { - is_teacher===true||admin===true||business===true? + is_teacher===true||admin===true||business===true||mysidentity===true?
{ From 0bf2c43de2b3de927ace42232d1fafaf57fbfab3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Dec 2019 21:46:12 +0800 Subject: [PATCH 25/43] =?UTF-8?q?Jupyter=E5=AE=9E=E8=AE=AD=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=9A=84=E6=97=B6=E5=80=99=E5=B8=A6=E4=B8=8A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/shixuns/create_shixun_service.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/services/shixuns/create_shixun_service.rb b/app/services/shixuns/create_shixun_service.rb index 2a350fd5d..0594f623a 100644 --- a/app/services/shixuns/create_shixun_service.rb +++ b/app/services/shixuns/create_shixun_service.rb @@ -42,6 +42,12 @@ class CreateShixunService < ApplicationService if !Laboratory.current.main_site? Laboratory.current.laboratory_shixuns.create!(shixun: shixun, ownership: true) end + # 如果是jupyter,先创建一个目录,为了挂载 + if shixun.is_jupyter? + folder = edu_setting('shixun_folder') + path = "#{folder}/#{identifier}" + FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(dir) + end return shixun end rescue => e From 99d35c791cdb33e670ba9e624b2a63415287ed63 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Dec 2019 21:50:19 +0800 Subject: [PATCH 26/43] =?UTF-8?q?jupyter=E5=88=9B=E5=BB=BA=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E5=A2=9E=E5=8A=A0=E5=88=9B=E5=BB=BA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/shixuns/create_shixun_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/shixuns/create_shixun_service.rb b/app/services/shixuns/create_shixun_service.rb index 0594f623a..08b515163 100644 --- a/app/services/shixuns/create_shixun_service.rb +++ b/app/services/shixuns/create_shixun_service.rb @@ -42,7 +42,7 @@ class CreateShixunService < ApplicationService if !Laboratory.current.main_site? Laboratory.current.laboratory_shixuns.create!(shixun: shixun, ownership: true) end - # 如果是jupyter,先创建一个目录,为了挂载 + # 如果是jupyter,先创建一个目录,为了挂载(因为后续数据集,开启Pod后环境在没销毁前,你上传数据集是挂载不上目录的,因此要先创建目录,方便中间层挂载) if shixun.is_jupyter? folder = edu_setting('shixun_folder') path = "#{folder}/#{identifier}" From dc98c847faa6faff344af488ce454f9b9de35599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 09:26:04 +0800 Subject: [PATCH 27/43] =?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/message/js/MessagChat.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/public/react/src/modules/message/js/MessagChat.js b/public/react/src/modules/message/js/MessagChat.js index e320ff3a3..c88307b19 100644 --- a/public/react/src/modules/message/js/MessagChat.js +++ b/public/react/src/modules/message/js/MessagChat.js @@ -554,6 +554,17 @@ class MessagChat extends Component{ {myuserl!==undefined?myuserl.name:""}与你的私信

{/*聊天页面*/} +
{ @@ -637,6 +648,18 @@ class MessagChat extends Component{ {/*右边头部*/}

私信列表

+
{/*列表数据*/} { From 9ee9397d6ccc944893fb6135940d9d577af92755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 09:41:00 +0800 Subject: [PATCH 28/43] =?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/Challenges/Challengesjupyter.js | 2 +- 1 file changed, 1 insertion(+), 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 38f06340c..840891ff7 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -263,7 +263,7 @@ class Challengesjupyter extends Component { "" : ( - is_teacher===true? + is_teacher===true||admin===true||business===true||mysidentity===true?

任务详情

From 490e08e6a5f42211902eb7e61a1a4c42d0efe01e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 09:53:54 +0800 Subject: [PATCH 29/43] Jupyter --- app/services/jupyter_service.rb | 43 ++++++++------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index 143b2eda7..109cb1242 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -20,15 +20,8 @@ module JupyterService logger.info "test_juypter: #{res}" @shixun_jupyter_port = res['port'] - jupyter_service = edu_setting('jupyter_service') - - url = - if false - "https://#{jupyter_service}:#{res['port']}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" - else - "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" - end - return url + + "https://#{jupyter_service(res['port'])}}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" end end @@ -69,14 +62,7 @@ module JupyterService repo_save_path = myshixun.repo_save_path - jupyter_service = edu_setting('jupyter_service') - - if false - "https://#{jupyter_service}:#{res['port']}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" - else - "https://#{res['port']}.#{jupyter_service}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" - end - + "https://#{jupyter_service(res['port'])}}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" end end @@ -99,14 +85,8 @@ module JupyterService tpiID = "tpm#{shixun.id}" - jupyter_service = edu_setting('jupyter_service') - src_url = - if false - "https://#{jupyter_service}:#{jupyter_port}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" - else - "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" - end - #https://47526.jupyter.educoder.net/nbconvert/notebook/data/workspace/myshixun_570461/f2ef5p798r20191210163135/01.ipynb?download=true + src_url = "#{jupyter_service(jupyter_port)}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/01.ipynb?download=true" + response = Faraday.get(src_url) if response.status.to_i != 200 @@ -134,14 +114,7 @@ module JupyterService repo_save_path = myshixun.repo_save_path jupyter_service = edu_setting('jupyter_service') - - src_url = - if false - "https://#{jupyter_service}:#{jupyter_port}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" - else - "https://#{jupyter_port}.#{jupyter_service}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" - end - + "https://#{jupyter_service(jupyter_port)}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" response = Faraday.get(src_url) if response.status.to_i != 200 @@ -215,5 +188,9 @@ module JupyterService end end + def jupyter_service jupyter_port + edu_setting('jupyter_service').gsub("PORT", jupyter_port) + end + end From da986bff2299728db37aebe3ee184bbe7da678ab Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 10:01:48 +0800 Subject: [PATCH 30/43] Jupyter --- app/services/jupyter_service.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index 109cb1242..1bbad9390 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -21,7 +21,7 @@ module JupyterService @shixun_jupyter_port = res['port'] - "https://#{jupyter_service(res['port'])}}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" + "#{jupyter_service(res['port'])}/notebooks/data/workspace/myshixun_#{tpiID}/01.ipynb" end end @@ -62,7 +62,7 @@ module JupyterService repo_save_path = myshixun.repo_save_path - "https://#{jupyter_service(res['port'])}}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" + "#{jupyter_service(res['port'])}/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb" end end @@ -113,8 +113,7 @@ module JupyterService tpiID = myshixun.id repo_save_path = myshixun.repo_save_path - jupyter_service = edu_setting('jupyter_service') - "https://#{jupyter_service(jupyter_port)}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" + src_url = "#{jupyter_service(jupyter_port)}/nbconvert/notebook/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb?download=true" response = Faraday.get(src_url) if response.status.to_i != 200 From 2e143635a2ff432207b9b82a649de35e73e8dad6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 10:18:39 +0800 Subject: [PATCH 31/43] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/shixuns/create_shixun_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/shixuns/create_shixun_service.rb b/app/services/shixuns/create_shixun_service.rb index 08b515163..0bf8d233c 100644 --- a/app/services/shixuns/create_shixun_service.rb +++ b/app/services/shixuns/create_shixun_service.rb @@ -44,7 +44,7 @@ class CreateShixunService < ApplicationService end # 如果是jupyter,先创建一个目录,为了挂载(因为后续数据集,开启Pod后环境在没销毁前,你上传数据集是挂载不上目录的,因此要先创建目录,方便中间层挂载) if shixun.is_jupyter? - folder = edu_setting('shixun_folder') + folder = EduSetting.get('shixun_folder') path = "#{folder}/#{identifier}" FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(dir) end From 81c32062cbaf842b93dccf0cad4e0f5c9acfa0ca Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 10:20:13 +0800 Subject: [PATCH 32/43] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/shixuns/create_shixun_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/shixuns/create_shixun_service.rb b/app/services/shixuns/create_shixun_service.rb index 0bf8d233c..c85455901 100644 --- a/app/services/shixuns/create_shixun_service.rb +++ b/app/services/shixuns/create_shixun_service.rb @@ -46,7 +46,7 @@ class CreateShixunService < ApplicationService if shixun.is_jupyter? folder = EduSetting.get('shixun_folder') path = "#{folder}/#{identifier}" - FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(dir) + FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path) end return shixun end From c0dfb67264ec490f693b8579ef511b2c00ec81d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 10:22:47 +0800 Subject: [PATCH 33/43] =?UTF-8?q?=E5=88=86=E7=8F=AD=E5=AD=A6=E4=B9=A0?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=A2=9E=E5=8A=A0=E6=88=90=E7=BB=A9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/statistics/Statistics.js | 64 +++++++++++++++++-- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/statistics/Statistics.js b/public/react/src/modules/courses/statistics/Statistics.js index 00a47a81d..21041a59c 100644 --- a/public/react/src/modules/courses/statistics/Statistics.js +++ b/public/react/src/modules/courses/statistics/Statistics.js @@ -99,7 +99,6 @@ class Statistics extends Component{ } getwork_scoredata=(page,group_ids,sort,key)=>{ - this.setState({ page:page, sort:sort, @@ -189,8 +188,45 @@ class Statistics extends Component{ } + //计算成绩 + setComputeTimet = (homeworkid) => { + let url = `/courses/${homeworkid}/calculate_all_shixun_scores.json`; + try { + this.props.yslslowCheckresults(); + } catch (e) { + + } + axios.get(url).then((response) => { + if (response) { + if (response.data.status === 0) { + let{page,group_ids,sort}=this.state; + setTimeout(() => { + try { + this.props.showNotification(`${response.data.message}`); + } catch (e) { + + } + try { + this.props.yslslowCheckresultsNo(); + } catch (e) { + + } + this.getwork_scoredata(page,group_ids,sort); + }, 2500); + } + } + }).catch((error) => { + try { + this.props.yslslowCheckresultsNo(); + } catch (e) { + + } + console.log(error) + }); + }; + render(){ - let {nd1,nd2,nd3,data,bomdata,course_members}=this.state; + let {nd1,nd2,nd3,data,bomdata,course_members,activeKey}=this.state; const columns = [ { @@ -360,12 +396,26 @@ class Statistics extends Component{ const operations = - {course_grouptype===false||this.state.course_groups.length===0?"":this.getwork_scoredata(1,group_idss,'desc')} - />} + {course_grouptype===false||this.state.course_groups.length===0?"": + this.state.activeKey==="1"? + this.getwork_scoredata(1,group_idss,'desc') + } + /> + :"" + } + { + this.state.activeKey==="1"? + this.setComputeTimet(this.props.match.params.coursesId)}>获取最新成绩 + :"" + } + { + this.state.activeKey==="1"? this.derivefun(this.state.activeKey==="1"?`/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`:`/courses/${this.props.match.params.coursesId}/export_member_act_score.xlsx`)}>导出 + :"" + } ; return( From f9132178249460e1b64904b6ae98aa81a9a0a2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 10:34:14 +0800 Subject: [PATCH 34/43] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 7246a03a2..1811e876d 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -843,7 +843,7 @@ class TPMBanner extends Component {
  • 学习人数 - {shixunsDetails.stu_num} + {shixunsDetails.stu_num}
  • {/*
  • */} {/*经验值*/} @@ -851,7 +851,7 @@ class TPMBanner extends Component { {/*
  • */}
  • 难度级别 - {shixunsDetails.diffcult} + {shixunsDetails.diffcult}
From 5514594800157f73def938e6335ac2412bbe23a4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 11:00:47 +0800 Subject: [PATCH 35/43] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 1c8928d98..faf30cb90 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -265,7 +265,12 @@ class ShixunsController < ApplicationController project_fork(@new_shixun, @repo_path, current_user.login) ShixunMember.create!(:user_id => User.current.id, :shixun_id => @new_shixun.try(:id), :role => 1) - + # 如果是jupyter,先创建一个目录,为了挂载(因为后续数据集,开启Pod后环境在没销毁前,你上传数据集是挂载不上目录的,因此要先创建目录,方便中间层挂载) + if @new_shixun.is_jupyter? + folder = EduSetting.get('shixun_folder') + path = "#{folder}/#{@new_shixun.identifier}" + FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path) + end # 同步复制关卡 if @shixun.challenges.present? @shixun.challenges.each do |challenge| From 57c354635c8477bebab5d6ee4d1767127cb1f7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 11:22:27 +0800 Subject: [PATCH 36/43] . --- public/react/config/webpack.config.prod.js | 4 ++-- public/react/src/modules/courses/poll/PollNew.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 1fe7a6c93..596843f5f 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: true, - drop_console: true + drop_debugger: false, + drop_console: false } } }), diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 248434295..b6b7e4794 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -893,6 +893,7 @@ class PollNew extends Component { //保存并继续 //保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空) Deleteadddomtwo = (indexo, object,bool) => { + debugger var thiss = this; @@ -1866,6 +1867,7 @@ class PollNew extends Component { }; question = {"question": questiontwo}; //插入多选题 + if (uuk !== -1) { // console.log("修改") this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length); From 67c20e766fa68256f367298d39d6a92d5a03f95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 11:35:21 +0800 Subject: [PATCH 37/43] =?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/courses/poll/PollNew.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index b6b7e4794..7384c7f6e 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1450,7 +1450,6 @@ class PollNew extends Component { //object 单个数组数据 Deleteadddomthree = (indexo, object,bool) => { this.setState({ - Newdisplay:false, newoption: false, }) // console.log("deleteadddom 349") @@ -1478,6 +1477,7 @@ class PollNew extends Component { } if (newarr[indexo].question.question_title === "") { this.props.showNotification('题目不能为空!'); + return } if (max > 0) { @@ -2016,7 +2016,11 @@ class PollNew extends Component { if (result !== undefined) { if (result.data.status === 0) { this.props.showNotification(`已完成`); + thiss.thisinitializationdatanew(); + this.setState({ + Newdisplay:false, + }) // console.log("确认创建问题") // console.log(result) // try { From f1d14d0d9ea4c14bbb1004b3c58902a82b8f2f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Dec 2019 11:35:22 +0800 Subject: [PATCH 38/43] =?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/App.js | 6 +++--- public/react/src/modules/courses/poll/PollNew.js | 15 +++++++++++++++ public/react/src/modules/tpm/NewHeader.js | 5 +++-- .../src/modules/tpm/newshixuns/Newshixuns.js | 4 ++-- .../shixunchild/Challenges/Challengesjupyter.js | 4 ++-- .../react/src/modules/user/usersInfo/InfosPath.js | 7 ++++++- 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 7d83757aa..4694d57da 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -608,10 +608,10 @@ class App extends Component { } } /> - + {/*/>*/} diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 248434295..49c89c375 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1579,6 +1579,9 @@ class PollNew extends Component { if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } } @@ -1589,10 +1592,16 @@ class PollNew extends Component { if(object.question.min_choices){ if(object.question.min_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } @@ -1605,10 +1614,16 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); + this.setState({ + Newdisplay:true, + }) return; } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index ff2f067e4..783972f75 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1294,8 +1294,9 @@ submittojoinclass=(value)=>{
  • this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}
  • :"" } {shixuntype===true?"":
  • this.getUser("/shixuns/new")}>新建实训项目
  • } - {this.props.Headertop===undefined?"": - pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?
  • this.getUser("/paths/new")} >新建实践课程
  • :"" + {this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":
  • this.getUser("/paths/new")} >新建实践课程
  • } + {this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"": + pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?
  • this.getUser("/paths/new")} >新建实践课程
  • :"" } {this.props.user&&this.props.user.main_site===true?
  • this.getUser("/projects/new","projects")} target="_blank">新建开发项目
  • :""} diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index bf744abde..22497932b 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -117,12 +117,12 @@ class Newshixuns extends Component { // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); } else { this.setState({ - loading: true + loading: false }) } }).catch((error) => { this.setState({ - loading: true + loading: false }) }) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 840891ff7..3bbc4bf8f 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -263,7 +263,7 @@ class Challengesjupyter extends Component { "" : ( - is_teacher===true||admin===true||business===true||mysidentity===true? + admin===true||business===true||mysidentity===true?

    任务详情

    @@ -306,7 +306,7 @@ class Challengesjupyter extends Component { } { - is_teacher===true||admin===true||business===true||mysidentity===true? + admin===true||business===true||mysidentity===true?
    { diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index d9db6108d..7bb96e30c 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -168,6 +168,8 @@ class InfosPath extends Component{ ); + + // console.log(this.props.user&&this.props.user.main_site) return(
    @@ -327,7 +329,10 @@ class InfosPath extends Component{
    {/* 295 */} { - page == 1 && is_current && !category ? :"" + this.props.user&&this.props.user.main_site===true?page == 1 && is_current && !category ? :"":"" + } + { + this.props.user&&this.props.user.main_site===false?this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?page == 1 && is_current && !category ? :"":"":"" } { (!data || (data && data.subjects.length==0)) && category && From ffebb8c98ad3d05b644cee21f37f0987ab909ea9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 16 Dec 2019 11:37:31 +0800 Subject: [PATCH 39/43] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8C=89=E5=85=AC=E5=BC=80=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index faf30cb90..f75dd7147 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -67,15 +67,11 @@ class ShixunsController < ApplicationController ## 排序参数 bsort = params[:sort] || 'desc' - case params[:order_by] || 'publish_time' - when 'new' - @shixuns = @shixuns.order("shixuns.status = 2 desc, shixuns.created_at #{bsort}") + case params[:order_by] || 'new' when 'hot' - @shixuns = @shixuns.order("shixuns.status = 2 desc, shixuns.myshixuns_count #{bsort}") - when 'mine' - @shixuns = @shixuns.order("shixuns.created_at #{bsort}") + @shixuns = @shixuns.order("shixuns.public = 2 desc, shixuns.myshixuns_count #{bsort}") else - @shixuns = @shixuns.order("shixuns.status = 2 desc, shixuns.publish_time #{bsort}") + @shixuns = @shixuns.order("shixuns.public = 2 desc, shixuns.publish_time #{bsort}") end # 用id计数会快10+MS左右,对于搜索的内容随着数据的增加,性能会提升一些。 From d7bfaf09683bccef4b6dd97d4653aa5636eec91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 11:38:58 +0800 Subject: [PATCH 40/43] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=97=AE=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/poll/PollNew.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 49c89c375..0c40f48c9 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1449,7 +1449,6 @@ class PollNew extends Component { //object 单个数组数据 Deleteadddomthree = (indexo, object,bool) => { this.setState({ - Newdisplay:false, newoption: false, }) // console.log("deleteadddom 349") @@ -2029,6 +2028,9 @@ class PollNew extends Component { if (result !== undefined) { if (result.data.status === 0) { this.props.showNotification(`已完成`); + this.setState({ + Newdisplay:false, + }) thiss.thisinitializationdatanew(); // console.log("确认创建问题") // console.log(result) @@ -2104,6 +2106,9 @@ class PollNew extends Component { try { if (result.data.status === 0) { this.props.showNotification(`编辑题目成功`); + this.setState({ + Newdisplay:false, + }) thiss.thisinitializationdatanew(); } } catch (e) { From 07921e9d3397fc281c25606e68055f817cc337c1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Dec 2019 11:39:50 +0800 Subject: [PATCH 41/43] =?UTF-8?q?=E5=BC=80=E5=90=AFJupyter=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0myshixun=5Fidentifier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 1bbad9390..0f5af6cb8 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -48,7 +48,7 @@ module JupyterService tpiID = myshixun.id mount = myshixun.shixun.data_sets.present? - params = {tpiID: tpiID, identifier: shixun.identifier, needMount: mount, + params = {tpiID: tpiID, identifier: shixun.identifier, myshixunIdentifier: myshixun.identifier, needMount: mount, :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"} res = uri_post uri, params From 0ac5ff977622626d7fbf660d63a19ac1354e3366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Dec 2019 11:39:53 +0800 Subject: [PATCH 42/43] =?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/TPMsettings/Shixuninformation.js | 3 --- public/react/src/modules/tpm/newshixuns/Newshixuns.js | 10 +++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index f3ec8e300..71754fc87 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -704,9 +704,6 @@ class Shixuninformation extends Component { }) } }); - this.setState({ - loading: false - }) } Selectthestudent = (value) => { diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 22497932b..cc537496a 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -97,6 +97,7 @@ class Newshixuns extends Component { }) const mdContnet = this.contentMdRef.current.getValue().trim(); this.props.form.validateFieldsAndScroll((err, values) => { + debugger if (!err) { console.log('Received values of form: ', values); @@ -125,13 +126,12 @@ class Newshixuns extends Component { loading: false }) }) - - + }else{ + this.setState({ + loading: false + }) } }); - this.setState({ - loading: false - }) }; Selectthestudent = (value) => { this.props.form.setFieldsValue({ From 1b822f25c97478215adea5b96f898d1171d49c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 16 Dec 2019 12:00:47 +0800 Subject: [PATCH 43/43] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/poll/PollNew.js | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 0c40f48c9..248434295 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1449,6 +1449,7 @@ class PollNew extends Component { //object 单个数组数据 Deleteadddomthree = (indexo, object,bool) => { this.setState({ + Newdisplay:false, newoption: false, }) // console.log("deleteadddom 349") @@ -1578,9 +1579,6 @@ class PollNew extends Component { if(object.question.max_choices>0){ if (object.question.max_choices < object.question.min_choices) { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } } @@ -1591,16 +1589,10 @@ class PollNew extends Component { if(object.question.min_choices){ if(object.question.min_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } @@ -1613,16 +1605,10 @@ class PollNew extends Component { if(object.question.max_choices){ if(object.question.max_choices===0){ this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } }else { this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); - this.setState({ - Newdisplay:true, - }) return; } @@ -2028,9 +2014,6 @@ class PollNew extends Component { if (result !== undefined) { if (result.data.status === 0) { this.props.showNotification(`已完成`); - this.setState({ - Newdisplay:false, - }) thiss.thisinitializationdatanew(); // console.log("确认创建问题") // console.log(result) @@ -2106,9 +2089,6 @@ class PollNew extends Component { try { if (result.data.status === 0) { this.props.showNotification(`编辑题目成功`); - this.setState({ - Newdisplay:false, - }) thiss.thisinitializationdatanew(); } } catch (e) {