|
|
|
@ -9,10 +9,11 @@
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
|
import SplitPane from 'react-split-pane';
|
|
|
|
|
import { Button, Modal } from 'antd';
|
|
|
|
|
import { Button, Modal,Drawer } 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';
|
|
|
|
@ -39,7 +40,9 @@ function JupyterTPI (props) {
|
|
|
|
|
changeLoadingState,
|
|
|
|
|
changeGetJupyterUrlState,
|
|
|
|
|
jupyter_identifier,
|
|
|
|
|
changeCurrentPage
|
|
|
|
|
changeCurrentPage,
|
|
|
|
|
changeshowDrawer,
|
|
|
|
|
drawervisible,
|
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
const {identifier} = params;
|
|
|
|
@ -107,6 +110,28 @@ function JupyterTPI (props) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重置环境
|
|
|
|
|
const handleEnvironmentTpi = () => {
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '重置环境',
|
|
|
|
|
content: (
|
|
|
|
|
<p style={{ lineHeight: '24px' }}>
|
|
|
|
|
你在本文件中修改的内容将丢失,<br />
|
|
|
|
|
是否确定重置环境?
|
|
|
|
|
</p>
|
|
|
|
|
),
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk () {
|
|
|
|
|
// console.log('调用重置代码....', myIdentifier);
|
|
|
|
|
// if (myIdentifier) {
|
|
|
|
|
// syncJupyterCode(myIdentifier, '重置成功');
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退出实训
|
|
|
|
|
const handleClickQuitTpi = () => {
|
|
|
|
|
// console.log(jupyterInfo);
|
|
|
|
@ -138,6 +163,13 @@ function JupyterTPI (props) {
|
|
|
|
|
getJupyterTpiDataSet(jupyter_identifier);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const swtichFirstDrawer = () => {
|
|
|
|
|
changeshowDrawer(!drawervisible)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const firstDrawerWidth = ()=>{
|
|
|
|
|
return 260
|
|
|
|
|
};
|
|
|
|
|
return (
|
|
|
|
|
<div className="jupyter_area">
|
|
|
|
|
<div className="jupyter_header">
|
|
|
|
@ -151,9 +183,17 @@ function JupyterTPI (props) {
|
|
|
|
|
<Button
|
|
|
|
|
className="btn_common"
|
|
|
|
|
type="link"
|
|
|
|
|
icon="sync"
|
|
|
|
|
icon="history"
|
|
|
|
|
onClick={handleClickResetTpi}
|
|
|
|
|
>重置实训</Button>
|
|
|
|
|
>重置实训</Button>
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
className="btn_common"
|
|
|
|
|
type="link"
|
|
|
|
|
icon="sync"
|
|
|
|
|
onClick={handleEnvironmentTpi}
|
|
|
|
|
>重置环境</Button>
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
className="btn_common"
|
|
|
|
|
type="link"
|
|
|
|
@ -162,16 +202,17 @@ function JupyterTPI (props) {
|
|
|
|
|
>退出实训</Button>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="jupyter_ctx">
|
|
|
|
|
<SplitPane split="vertical" minSize={350} maxSize={-350} defaultSize="30%">
|
|
|
|
|
<div className={'split-pane-left'}>
|
|
|
|
|
<LeftPane
|
|
|
|
|
dataSets={dataSets}
|
|
|
|
|
total={total}
|
|
|
|
|
pagination={pagination}
|
|
|
|
|
onPageChange={handlePageChange}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<SplitPane split="vertical" minSize={350} maxSize={-350} defaultSize="100%">
|
|
|
|
|
{/*<div className={'split-pane-left'}>*/}
|
|
|
|
|
{/* <LeftPane */}
|
|
|
|
|
{/* dataSets={dataSets} */}
|
|
|
|
|
{/* total={total}*/}
|
|
|
|
|
{/* pagination={pagination}*/}
|
|
|
|
|
{/* onPageChange={handlePageChange}*/}
|
|
|
|
|
{/* />*/}
|
|
|
|
|
{/*</div>*/}
|
|
|
|
|
<SplitPane split="vertical" defaultSize="100%" allowResize={false}>
|
|
|
|
|
<RightPane
|
|
|
|
|
identifier={myIdentifier}
|
|
|
|
@ -181,9 +222,21 @@ function JupyterTPI (props) {
|
|
|
|
|
onReloadUrl={handleOnReloadUrl}
|
|
|
|
|
onSave={handleOnSave}
|
|
|
|
|
/>
|
|
|
|
|
<div />
|
|
|
|
|
<FloatButton onClick={swtichFirstDrawer} className={drawervisible===false?"jupyter_float_button":"jupyter_float_button newjupyter_float_button"}>{"数据集"}</FloatButton>
|
|
|
|
|
</SplitPane>
|
|
|
|
|
|
|
|
|
|
</SplitPane>
|
|
|
|
|
<Drawer
|
|
|
|
|
placement={"right"}
|
|
|
|
|
closable={false}
|
|
|
|
|
mask={false}
|
|
|
|
|
// onClose={this.onClose}
|
|
|
|
|
visible={drawervisible}
|
|
|
|
|
>
|
|
|
|
|
<p>Some contents...</p>
|
|
|
|
|
<p>Some contents...</p>
|
|
|
|
|
<p>Some contents...</p>
|
|
|
|
|
</Drawer>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
@ -199,7 +252,7 @@ const mapStateToProps = (state) => {
|
|
|
|
|
jupyter_pagination,
|
|
|
|
|
jupyter_identifier
|
|
|
|
|
} = state.jupyterReducer;
|
|
|
|
|
const { loading } = state.commonReducer;
|
|
|
|
|
const { loading ,drawervisible} = state.commonReducer;
|
|
|
|
|
return {
|
|
|
|
|
loading,
|
|
|
|
|
jupyter_info,
|
|
|
|
@ -208,7 +261,8 @@ const mapStateToProps = (state) => {
|
|
|
|
|
jupyter_tpi_url_state,
|
|
|
|
|
total: jupyter_data_set_count,
|
|
|
|
|
pagination: jupyter_pagination,
|
|
|
|
|
jupyter_identifier
|
|
|
|
|
jupyter_identifier,
|
|
|
|
|
drawervisible,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -221,7 +275,9 @@ const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
getJupyterTpiUrl: (identifier) => dispatch(actions.getJupyterTpiUrl(identifier)),
|
|
|
|
|
saveJupyterTpi: () => dispatch(actions.saveJupyterTpi()),
|
|
|
|
|
changeLoadingState: (flag) => dispatch(actions.changeLoadingState(flag)),
|
|
|
|
|
changeCurrentPage: (current) => dispatch(actions.changeCurrentPage(current))
|
|
|
|
|
changeCurrentPage: (current) => dispatch(actions.changeCurrentPage(current)),
|
|
|
|
|
//展开Drawer
|
|
|
|
|
changeshowDrawer: (type) => dispatch(actions.changeshowDrawer(type))
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
|