dev_new_shixunsrepository
杨树明 5 years ago
parent ad77dae87d
commit 6ea0459f35

@ -367,7 +367,7 @@ function JupyterTPI (props) {
<span className="title_time jupytertitle_time"> <span className="title_time jupytertitle_time">
<Countdown value={jupytertime} format="HH:mm:ss" onFinish={onFinish}/> <Countdown value={jupytertime} format="HH:mm:ss" onFinish={onFinish}/>
<span className={"Countdowntypes"}> <span className={"Countdowntypes"}>
{/*{endjupytertime===false?"":<Countdown value={endjupytertime} format="HH:mm:ss" onFinish={endonFinish}/>}*/} {endjupytertime===false?"":<Countdown value={endjupytertime} format="HH:mm:ss" onFinish={endonFinish}/>}
</span> </span>
</span> </span>
</p> </p>

@ -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` let timeinfo_with_tpm=`/jupyters/timeinfo_with_tpm.json`
axios.get(timeinfo_with_tpm, {params: datas}).then((response) => { axios.get(timeinfo_with_tpm, {params: datas}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { 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 endtimes:endsms===0?Date.now()+1000:Date.now() +endsms
}) })
},500); },500);
if(type===true){
this.props.showNotification('延长成功!');
}
} }
}else{ }else{
@ -461,19 +464,21 @@ class Challengesjupyter extends Component {
onendhandleClickResetTpi=(id)=>{ onendhandleClickResetTpi=(id)=>{
let datas={
identifier:id,
}
const url = `/jupyters/active_with_tpm.json`; const url = `/jupyters/active_with_tpm.json`;
axios.get(url,{params:{ axios.get(url,{params:{
identifier:id identifier:id
}}).then((response) => { }}).then((response) => {
if(response.data.status===0){ if(response.data.status===0){
this.props.showNotification('延长成功!'); this.gettimeinfo_with_tpm(datas,true)
setTimeout(()=>{ // setTimeout(()=>{
this.setState({ // this.setState({
jupytertime:Date.now() + 900 * 1000, // jupytertime:Date.now() + 900 * 1000,
endtimes:Date.now() + 300 * 1000 // endtimes:Date.now() + 300 * 1000
}) // })
},500); // },500);
} }
}); });
} }
@ -550,7 +555,7 @@ class Challengesjupyter extends Component {
<span className={"Countdowntypes"}> <span className={"Countdowntypes"}>
{/*this.state.jupytertime*/} {/*this.state.jupytertime*/}
<Countdown value={this.state.jupytertime} format="HH:mm:ss" onFinish={this.onFinish}/> <Countdown value={this.state.jupytertime} format="HH:mm:ss" onFinish={this.onFinish}/>
{/*{endtimes===false?"":<Countdown value={endtimes} format="HH:mm:ss" onFinish={this.onendFinish}/>}*/} {endtimes===false?"":<Countdown value={endtimes} format="HH:mm:ss" onFinish={this.onendFinish}/>}
</span> </span>
<p className="clearfix mb20 edu-back-white"> <p className="clearfix mb20 edu-back-white">

@ -160,7 +160,8 @@ export const active_with_tpi = (identifier, msg) => {
if (status === 0) { if (status === 0) {
message.success(msg); message.success(msg);
// dispatch(addjypertime(Date.now() + 900 * 1000,false)) // 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)
} }
} }
}) })

Loading…
Cancel
Save