diff --git a/public/react/src/modules/tpm/jupyter/index.js b/public/react/src/modules/tpm/jupyter/index.js index 8c07b0bee..6883aa72f 100644 --- a/public/react/src/modules/tpm/jupyter/index.js +++ b/public/react/src/modules/tpm/jupyter/index.js @@ -367,7 +367,7 @@ function JupyterTPI (props) { - {/*{endjupytertime===false?"":}*/} + {endjupytertime===false?"":}

diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index d53a88327..3f2aa68a9 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -107,7 +107,7 @@ class Challengesjupyter extends Component { } - gettimeinfo_with_tpm=(datas)=>{ + gettimeinfo_with_tpm=(datas,type)=>{ let timeinfo_with_tpm=`/jupyters/timeinfo_with_tpm.json` axios.get(timeinfo_with_tpm, {params: datas}).then((response) => { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { @@ -128,6 +128,9 @@ class Challengesjupyter extends Component { endtimes:endsms===0?Date.now()+1000:Date.now() +endsms }) },500); + if(type===true){ + this.props.showNotification('延长成功!'); + } } }else{ @@ -461,19 +464,21 @@ class Challengesjupyter extends Component { onendhandleClickResetTpi=(id)=>{ - + let datas={ + identifier:id, + } const url = `/jupyters/active_with_tpm.json`; axios.get(url,{params:{ identifier:id }}).then((response) => { if(response.data.status===0){ - this.props.showNotification('延长成功!'); - setTimeout(()=>{ - this.setState({ - jupytertime:Date.now() + 900 * 1000, - endtimes:Date.now() + 300 * 1000 - }) - },500); + this.gettimeinfo_with_tpm(datas,true) + // setTimeout(()=>{ + // this.setState({ + // jupytertime:Date.now() + 900 * 1000, + // endtimes:Date.now() + 300 * 1000 + // }) + // },500); } }); } @@ -550,7 +555,7 @@ class Challengesjupyter extends Component { {/*this.state.jupytertime*/} - {/*{endtimes===false?"":}*/} + {endtimes===false?"":}

diff --git a/public/react/src/redux/actions/jupyter.js b/public/react/src/redux/actions/jupyter.js index 1a3654c3f..c4a723b3c 100644 --- a/public/react/src/redux/actions/jupyter.js +++ b/public/react/src/redux/actions/jupyter.js @@ -160,7 +160,8 @@ export const active_with_tpi = (identifier, msg) => { if (status === 0) { message.success(msg); // dispatch(addjypertime(Date.now() + 900 * 1000,false)) - setTimeout(()=>{dispatch(addjypertime(Date.now() + 900 * 1000, Date.now() + 300 * 1000))},800); + // setTimeout(()=>{dispatch(addjypertime(Date.now() + 900 * 1000, Date.now() + 300 * 1000))},800); + timeinfo_with_tpi(identifier,dispatch) } } })