|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
* @LastEditTime: 2019-12-13 23:03:27
|
|
|
|
|
*/
|
|
|
|
|
import types from "./actionTypes";
|
|
|
|
|
import { message } from 'antd';
|
|
|
|
|
import { message ,Modal} from 'antd';
|
|
|
|
|
import {
|
|
|
|
|
fetchJupyterTpiDataSet,
|
|
|
|
|
fetchJupyterTpiUrl,
|
|
|
|
@ -78,8 +78,8 @@ export const getJupyterTpiUrl = (obj) => {
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
const { status, url = '', port } = res.data;
|
|
|
|
|
dispatch(updataspinning(false))
|
|
|
|
|
setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
|
|
|
|
|
// timeinfo_with_tpi(id,dispatch)
|
|
|
|
|
//setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
|
|
|
|
|
timeinfo_with_tpi(id,dispatch)
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.GET_JUPYTER_TPI_URL,
|
|
|
|
|
payload: {
|
|
|
|
@ -240,27 +240,26 @@ export const updataspinning=(type)=>{
|
|
|
|
|
|
|
|
|
|
// 获取重置实训后的时间
|
|
|
|
|
export const timeinfo_with_tpi = (identifier, dispatch) => {
|
|
|
|
|
debugger
|
|
|
|
|
const params = {
|
|
|
|
|
identifier: identifier
|
|
|
|
|
};
|
|
|
|
|
debugger
|
|
|
|
|
timeinfo_with_tpis(params).then(res => {
|
|
|
|
|
debugger
|
|
|
|
|
console.log('同步时间成功: ', res);
|
|
|
|
|
if (res.data.status === 401) return;
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
const {status} = res.data
|
|
|
|
|
console.log(status)
|
|
|
|
|
// dispatch(addjypertime(Date.now() +3600 * 1000))
|
|
|
|
|
// setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
|
|
|
|
|
// if (status === 0) {
|
|
|
|
|
// message.success(msg);
|
|
|
|
|
// dispatch(updataspinning(false))
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// window.location.reload();
|
|
|
|
|
// }, 300);
|
|
|
|
|
// }
|
|
|
|
|
if(res.data.status===0){
|
|
|
|
|
if(res.data.useSeconds===null){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: '因为这个实训pod不在了,无法获取倒计时,请联系系统管理人员',
|
|
|
|
|
});
|
|
|
|
|
}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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|