Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

chromesetting
杨树林 5 years ago
commit b59491693b

@ -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: (<div className="update_notice">
@ -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 (
<Spin tip="加载中..." spinning={spinning}>
<div className="jupyter_area">
<div className="jupyter_header">
<UserInfo userInfo={userInfo} />
@ -396,6 +402,7 @@ function JupyterTPI (props) {
</Drawer>
</div>
</div>
</Spin>
);
}
@ -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(

@ -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;

@ -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
}

@ -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
}
}

@ -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;
}

Loading…
Cancel
Save