|  |  | @ -15,7 +15,8 @@ import { | 
			
		
	
		
		
			
				
					
					|  |  |  |   fetchSyncJupyterCode, |  |  |  |   fetchSyncJupyterCode, | 
			
		
	
		
		
			
				
					
					|  |  |  |   fetchreset_with_tpi, |  |  |  |   fetchreset_with_tpi, | 
			
		
	
		
		
			
				
					
					|  |  |  |   fetchSaveJupyterTpi, |  |  |  |   fetchSaveJupyterTpi, | 
			
		
	
		
		
			
				
					
					|  |  |  |   fetactive_with_tpi |  |  |  |   fetactive_with_tpi, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   timeinfo_with_tpis | 
			
		
	
		
		
			
				
					
					|  |  |  | } from "../../services/jupyterServer"; |  |  |  | } from "../../services/jupyterServer"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | // 获取 jupyter 相关信息
 |  |  |  | // 获取 jupyter 相关信息
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -76,7 +77,9 @@ export const getJupyterTpiUrl = (obj) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |       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; | 
			
		
	
		
		
			
				
					
					|  |  |  |         addjypertime(Date.now() +3600 * 1000) |  |  |  |         dispatch(updataspinning(false)) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // timeinfo_with_tpi(id,dispatch)
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         dispatch({ |  |  |  |         dispatch({ | 
			
		
	
		
		
			
				
					
					|  |  |  |           type: types.GET_JUPYTER_TPI_URL, |  |  |  |           type: types.GET_JUPYTER_TPI_URL, | 
			
		
	
		
		
			
				
					
					|  |  |  |           payload: { |  |  |  |           payload: { | 
			
		
	
	
		
		
			
				
					|  |  | @ -106,7 +109,7 @@ export const syncJupyterCode = (identifier, msg) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |         const {status} = res.data |  |  |  |         const {status} = res.data | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (status === 0) { |  |  |  |         if (status === 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           message.success(msg); |  |  |  |           message.success(msg); | 
			
		
	
		
		
			
				
					
					|  |  |  |           updataspinning(false) |  |  |  |           dispatch(updataspinning(false)) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           setTimeout(() => { |  |  |  |           setTimeout(() => { | 
			
		
	
		
		
			
				
					
					|  |  |  |             window.location.reload(); |  |  |  |             window.location.reload(); | 
			
		
	
		
		
			
				
					
					|  |  |  |           }, 300); |  |  |  |           }, 300); | 
			
		
	
	
		
		
			
				
					|  |  | @ -131,7 +134,7 @@ export const reset_with_tpi = (identifier, msg) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |         const {status} = res.data |  |  |  |         const {status} = res.data | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (status === 0) { |  |  |  |         if (status === 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           message.success(msg); |  |  |  |           message.success(msg); | 
			
		
	
		
		
			
				
					
					|  |  |  |           updataspinning(false) |  |  |  |           dispatch(updataspinning(false)) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           setTimeout(() => { |  |  |  |           setTimeout(() => { | 
			
		
	
		
		
			
				
					
					|  |  |  |             window.location.reload(); |  |  |  |             window.location.reload(); | 
			
		
	
		
		
			
				
					
					|  |  |  |           }, 300); |  |  |  |           }, 300); | 
			
		
	
	
		
		
			
				
					|  |  | @ -156,7 +159,7 @@ 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); | 
			
		
	
		
		
			
				
					
					|  |  |  |           addjypertime(Date.now() + 900 * 1000); |  |  |  |           dispatch(addjypertime(Date.now() + 900 * 1000)) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |       } |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  |     }) |  |  |  |     }) | 
			
		
	
	
		
		
			
				
					|  |  | @ -171,6 +174,7 @@ export const changeGetJupyterUrlState = (status) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |     payload: status |  |  |  |     payload: status | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | // 保存 jupyter tpi
 |  |  |  | // 保存 jupyter tpi
 | 
			
		
	
		
		
			
				
					
					|  |  |  | export const saveJupyterTpi = () => { |  |  |  | export const saveJupyterTpi = () => { | 
			
		
	
		
		
			
				
					
					|  |  |  |   return (dispatch, getState) => { |  |  |  |   return (dispatch, getState) => { | 
			
		
	
	
		
		
			
				
					|  |  | @ -234,3 +238,29 @@ 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);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | } |