diff --git a/public/react/src/modules/developer/recordDetail/index.js b/public/react/src/modules/developer/recordDetail/index.js index 99a706f33..fd93b3f2a 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-27 14:51:42 + * @LastEditTime : 2019-12-27 21:18:39 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -60,6 +60,14 @@ function RecordDetail (props) { props.history.push(`/myproblems/${identifier}`); } } + + const handleEditorCode = (identifier, code) => { + if (identifier) { + console.log(code); + saveEditorCodeForDetail(code); + props.history.push(`/myproblems/${identifier}`); + } + } return (
@@ -114,9 +122,10 @@ function RecordDetail (props) { style={{ visibility: identifier ? 'visible' : 'hidden'}} className={'header_btn'} type="primary" + onClick={() => handleEditorCode(identifier, detail.code)} > - {/* 编辑代码 */} - 编辑代码 + 编辑代码 + {/* 编辑代码 */}
diff --git a/public/react/src/modules/tpm/jupyter/index.js b/public/react/src/modules/tpm/jupyter/index.js index c8b95095b..dab3a1f5e 100644 --- a/public/react/src/modules/tpm/jupyter/index.js +++ b/public/react/src/modules/tpm/jupyter/index.js @@ -168,8 +168,7 @@ function JupyterTPI (props) { title: '更新通知', content: (
{stopposttpip(1)} -

该实训已更新,您选择更新后之前编写的实训代码将会丢失

-

如有需要请先使用【jupyter中-文件-下载】保存代码,再进行更新

+

该实训已更新,您选择更新后之前编写的实训代码将会丢失,如有需要请先使用【jupyter中-文件-下载】保存代码,再进行更新

{/*

还未完成评测的任务代码,请自行保存

*/}
), okText: '立即更新', @@ -188,6 +187,7 @@ function JupyterTPI (props) { // 重置实训 const handleClickResetTpi = () => { stopposttpip(1) + updataspinning(true) Modal.confirm({ title: '重置实训', content: ( @@ -206,6 +206,7 @@ function JupyterTPI (props) { }, onCancel() { stopposttpip(2) + updataspinning(false) }, }) } diff --git a/public/react/src/modules/tpm/jupyter/rightPane/index.js b/public/react/src/modules/tpm/jupyter/rightPane/index.js index da3a548d2..5cfa96260 100644 --- a/public/react/src/modules/tpm/jupyter/rightPane/index.js +++ b/public/react/src/modules/tpm/jupyter/rightPane/index.js @@ -26,7 +26,7 @@ function RightPane (props) { const loadInit = (
- + {/**/}
); diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 5bfc133f2..7109ee460 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -119,10 +119,7 @@ class Challengesjupyter extends Component { }else{ if(response.data.status===0){ if(response.data.useSeconds===null){ - Modal.warning({ - title: '提示', - content: '因为这个实训pod不在了,请联系系统管理人员', - }); + this.handleClickResetTpi() }else{ let useSeconds=response.data.useSeconds; let summain=3600 * 1000; @@ -503,6 +500,7 @@ class Challengesjupyter extends Component { } + {/*this.state.jupytertime*/} diff --git a/public/react/src/redux/actions/jupyter.js b/public/react/src/redux/actions/jupyter.js index b2d66d6e6..08fba154e 100644 --- a/public/react/src/redux/actions/jupyter.js +++ b/public/react/src/redux/actions/jupyter.js @@ -248,10 +248,20 @@ export const timeinfo_with_tpi = (identifier, dispatch) => { if (res.status === 200) { if(res.data.status===0){ if(res.data.useSeconds===null){ - Modal.warning({ - title: '提示', - content: '因为这个实训pod不在了,无法获取倒计时,请联系系统管理人员', - }); + Modal.confirm({ + title: '重置环境', + content: ( +

+ 是否确定重置环境? +

+ ), + okText: '确定', + cancelText: '取消', + onOk () { + reset_with_tpi(identifier, '重置成功'); + }, + onCancel() {} + }) }else{ let useSeconds=res.data.useSeconds; let summain=3600 * 1000; diff --git a/public/react/src/redux/reducers/ojForUserReducer.js b/public/react/src/redux/reducers/ojForUserReducer.js index 3e64ce7ac..721c3e2cc 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-27 20:59:00 + * @LastEditTime : 2019-12-27 21:28:28 */ import types from "../actions/actionTypes"; import { Base64 } from 'js-base64'; @@ -58,7 +58,8 @@ const ojForUserReducer = (state = initialState, action) => { ...state, hack: Object.assign({}, hack), test_case: Object.assign({}, test_case), - comment_identifier: hack.identifier + comment_identifier: hack.identifier, + userCode: tempCode } case types.COMMIT_RECORD_DETAIL: let result = action.payload.data;