diff --git a/public/react/src/modules/tpm/jupyter/index.js b/public/react/src/modules/tpm/jupyter/index.js index bbe83395b..ad62d249c 100644 --- a/public/react/src/modules/tpm/jupyter/index.js +++ b/public/react/src/modules/tpm/jupyter/index.js @@ -9,14 +9,13 @@ import './index.scss'; import React, { useEffect, useState } from 'react'; import SplitPane from 'react-split-pane'; -import { Button, Modal,Drawer ,Pagination,Empty,Tooltip,Icon,message,Statistic} from 'antd'; +import { Button, Modal,Drawer ,Pagination,Empty,Tooltip,Icon,message,Statistic,Spin} from 'antd'; import { connect } from 'react-redux'; import FloatButton from '../../page/component/FloatButton'; import UserInfo from '../../developer/components/userInfo'; import actions from '../../../redux/actions'; -import LeftPane from './leftPane'; import RightPane from './rightPane'; import MyIcon from "../../../common/components/MyIcon"; @@ -65,7 +64,9 @@ function JupyterTPI (props) { drawervisible, reset_with_tpi, jupytertime, - active_with_tpi + active_with_tpi, + spinning, + updataspinning } = props; const emptyCtx = ( @@ -140,6 +141,7 @@ function JupyterTPI (props) { if (tpm_modified && updateTip && myshixun_identifier) { setUpdateTip(false); + updataspinning(true) Modal.confirm({ title: '更新通知', content: (
@@ -153,6 +155,7 @@ function JupyterTPI (props) { onOk () { syncJupyterCode(myshixun_identifier, '同步成功'); },onCancel() { + updataspinning(false) stopposttpip(2) }, }) @@ -189,6 +192,7 @@ function JupyterTPI (props) { // 重置环境 const handleEnvironmentTpi = () => { stopposttpip(1) + updataspinning(true) Modal.confirm({ title: '重置环境', content: ( @@ -207,6 +211,7 @@ function JupyterTPI (props) { reset_with_tpi(myIdentifier, '重置成功'); }, onCancel() { + updataspinning(false) stopposttpip(2) }, }) @@ -309,6 +314,7 @@ function JupyterTPI (props) { } return ( +
@@ -396,6 +402,7 @@ function JupyterTPI (props) {
+
); } @@ -409,7 +416,7 @@ const mapStateToProps = (state) => { jupyter_pagination, jupyter_identifier } = state.jupyterReducer; - const { loading ,drawervisible,jupytertime} = state.commonReducer; + const { loading ,drawervisible,jupytertime,spinning} = state.commonReducer; return { loading, jupyter_info, @@ -420,7 +427,8 @@ const mapStateToProps = (state) => { pagination: jupyter_pagination, jupyter_identifier, drawervisible, - jupytertime + jupytertime, + spinning }; } @@ -442,6 +450,7 @@ const mapDispatchToProps = (dispatch) => ({ addjypertime: (type) => dispatch(actions.addjypertime(type)), //延时 active_with_tpi:(identifier, msg) => dispatch(actions.active_with_tpi(identifier, msg)), + updataspinning:(identifier, msg) => dispatch(actions.updataspinning(identifier, msg)), }); export default connect( diff --git a/public/react/src/redux/actions/actionTypes.js b/public/react/src/redux/actions/actionTypes.js index f31da4f20..474ecb382 100644 --- a/public/react/src/redux/actions/actionTypes.js +++ b/public/react/src/redux/actions/actionTypes.js @@ -66,6 +66,7 @@ const types = { CHANGE_SHOW_DRAWER: 'CHANGE_SHOW_DRAWER', CHANGE_JYPYTER_TIME: 'CHANGE_JYPYTER_TIME',//增加15分钟 CHANGE_EXTENDED_TIME: 'CHANGE_EXTENDED_TIME',//延时 + CHANGE_UPDETA_SPIN: 'CHANGE_UPDETA_SPIN',//加载 } export default types; diff --git a/public/react/src/redux/actions/index.js b/public/react/src/redux/actions/index.js index 7fe6db649..ebea3f5f5 100644 --- a/public/react/src/redux/actions/index.js +++ b/public/react/src/redux/actions/index.js @@ -76,7 +76,8 @@ import { changeshowDrawer, reset_with_tpi, addjypertime, - active_with_tpi + active_with_tpi, + updataspinning } from './jupyter'; export default { @@ -136,5 +137,6 @@ export default { reset_with_tpi, addjypertime, active_with_tpi, + updataspinning // isUpdateCodeCtx } \ No newline at end of file diff --git a/public/react/src/redux/actions/jupyter.js b/public/react/src/redux/actions/jupyter.js index 589c1c859..6afdea7b7 100644 --- a/public/react/src/redux/actions/jupyter.js +++ b/public/react/src/redux/actions/jupyter.js @@ -105,6 +105,7 @@ export const syncJupyterCode = (identifier, msg) => { const {status} = res.data if (status === 0) { message.success(msg); + updataspinning(false) setTimeout(() => { window.location.reload(); }, 300); @@ -129,6 +130,7 @@ export const reset_with_tpi = (identifier, msg) => { const {status} = res.data if (status === 0) { message.success(msg); + updataspinning(false) setTimeout(() => { window.location.reload(); }, 300); @@ -222,4 +224,10 @@ export const addjypertime=(time)=>{ } } +export const updataspinning=(type)=>{ + return { + type: types.CHANGE_UPDETA_SPIN, + payload: type + } +} diff --git a/public/react/src/redux/reducers/commonReducer.js b/public/react/src/redux/reducers/commonReducer.js index 82910812d..5694faf84 100644 --- a/public/react/src/redux/reducers/commonReducer.js +++ b/public/react/src/redux/reducers/commonReducer.js @@ -17,6 +17,7 @@ const initialState = { isMySource: false, drawervisible:false, jupytertime:Date.now() + 3600 * 1000, + spinning:false } const commonReducer = (state = initialState, action) => { @@ -62,6 +63,11 @@ const commonReducer = (state = initialState, action) => { ...state, jupytertime: action.payload } + case types.CHANGE_UPDETA_SPIN: + return { + ...state, + spinning: action.payload + } default: return state; }