|
|
@ -74,7 +74,7 @@ export const getJupyterTpiUrl = (obj) => {
|
|
|
|
const id = obj.identifier || jupyter_info.myshixun_identifier;
|
|
|
|
const id = obj.identifier || jupyter_info.myshixun_identifier;
|
|
|
|
fetchJupyterTpiUrl({identifier: id}).then(res => {
|
|
|
|
fetchJupyterTpiUrl({identifier: id}).then(res => {
|
|
|
|
if (res.data.status === 401) return; // 用户未登录
|
|
|
|
if (res.data.status === 401) return; // 用户未登录
|
|
|
|
console.log('获取url', res);
|
|
|
|
//console.log('获取url', res);
|
|
|
|
if (res.status === 200) {
|
|
|
|
if (res.status === 200) {
|
|
|
|
const { status, url = '', port } = res.data;
|
|
|
|
const { status, url = '', port } = res.data;
|
|
|
|
dispatch(updataspinning(false))
|
|
|
|
dispatch(updataspinning(false))
|
|
|
@ -159,7 +159,8 @@ export const active_with_tpi = (identifier, msg) => {
|
|
|
|
const {status} = res.data
|
|
|
|
const {status} = res.data
|
|
|
|
if (status === 0) {
|
|
|
|
if (status === 0) {
|
|
|
|
message.success(msg);
|
|
|
|
message.success(msg);
|
|
|
|
dispatch(addjypertime(Date.now() + 900 * 1000))
|
|
|
|
// dispatch(addjypertime(Date.now() + 900 * 1000,false))
|
|
|
|
|
|
|
|
setTimeout(()=>{dispatch(addjypertime(Date.now() + 900 * 1000, Date.now() + 300 * 1000))},800);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -224,11 +225,21 @@ export const changeshowDrawer = (type) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//增加倒计时
|
|
|
|
//增加倒计时
|
|
|
|
export const addjypertime=(time)=>{
|
|
|
|
export const addjypertime=(time,endtime)=>{
|
|
|
|
return {
|
|
|
|
if(endtime===false){
|
|
|
|
type: types.CHANGE_JYPYTER_TIME,
|
|
|
|
return {
|
|
|
|
payload: time
|
|
|
|
type: types.CHANGE_JYPYTER_TIME,
|
|
|
|
|
|
|
|
payload: time,
|
|
|
|
|
|
|
|
endtime:false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
type: types.CHANGE_JYPYTER_TIME,
|
|
|
|
|
|
|
|
payload: time,
|
|
|
|
|
|
|
|
endtime:endtime
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const updataspinning=(type)=>{
|
|
|
|
export const updataspinning=(type)=>{
|
|
|
@ -262,8 +273,9 @@ export const timeinfo_with_tpi = (identifier, dispatch) => {
|
|
|
|
let remainingSeconds=res.data.remainingSeconds;
|
|
|
|
let remainingSeconds=res.data.remainingSeconds;
|
|
|
|
// let summain=3600 * 1000;
|
|
|
|
// let summain=3600 * 1000;
|
|
|
|
let sums= remainingSeconds * 1000;
|
|
|
|
let sums= remainingSeconds * 1000;
|
|
|
|
|
|
|
|
let endsms=(remainingSeconds-300<0?0:remainingSeconds-300)*1000
|
|
|
|
// let sum=summain-sums;
|
|
|
|
// let sum=summain-sums;
|
|
|
|
setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums))},500);
|
|
|
|
setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums,endsms===0?Date.now() +1000:Date.now() +endsms))},500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|