|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-12-11 08:35:23
|
|
|
|
|
* @LastEditors: tangjiang
|
|
|
|
|
* @LastEditTime: 2019-12-12 20:19:48
|
|
|
|
|
* @LastEditTime: 2019-12-13 15:25:50
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
@ -26,16 +26,20 @@ function JupyterTPI (props) {
|
|
|
|
|
},
|
|
|
|
|
url,
|
|
|
|
|
loading, // 保存按钮状态
|
|
|
|
|
total,
|
|
|
|
|
pagination,
|
|
|
|
|
dataSets, // 数据集
|
|
|
|
|
jupyter_info,
|
|
|
|
|
getJupyterInfo,
|
|
|
|
|
syncJupyterCode,
|
|
|
|
|
jupyter_tpi_url_state,
|
|
|
|
|
// getJupyterTpiDataSet,
|
|
|
|
|
getJupyterTpiDataSet,
|
|
|
|
|
getJupyterTpiUrl,
|
|
|
|
|
saveJupyterTpi,
|
|
|
|
|
changeLoadingState,
|
|
|
|
|
changeGetJupyterUrlState
|
|
|
|
|
changeGetJupyterUrlState,
|
|
|
|
|
jupyter_identifier,
|
|
|
|
|
changeCurrentPage
|
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
const {identifier} = params;
|
|
|
|
@ -107,6 +111,7 @@ function JupyterTPI (props) {
|
|
|
|
|
const handleClickQuitTpi = () => {
|
|
|
|
|
// console.log(jupyterInfo);
|
|
|
|
|
const { identifier } = jupyterInfo;
|
|
|
|
|
if (!identifier) return;
|
|
|
|
|
props.history.push(`/shixuns/${identifier}/challenges`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -125,6 +130,14 @@ function JupyterTPI (props) {
|
|
|
|
|
saveJupyterTpi();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 分页信息改变时
|
|
|
|
|
const handlePageChange = (current) => {
|
|
|
|
|
// 改变当前页
|
|
|
|
|
changeCurrentPage(current);
|
|
|
|
|
// 分页查找数据
|
|
|
|
|
getJupyterTpiDataSet(jupyter_identifier);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="jupyter_area">
|
|
|
|
|
<div className="jupyter_header">
|
|
|
|
@ -152,7 +165,12 @@ function JupyterTPI (props) {
|
|
|
|
|
<div className="jupyter_ctx">
|
|
|
|
|
<SplitPane split="vertical" minSize={350} maxSize={-350} defaultSize="30%">
|
|
|
|
|
<div className={'split-pane-left'}>
|
|
|
|
|
<LeftPane dataSets={dataSets} />
|
|
|
|
|
<LeftPane
|
|
|
|
|
dataSets={dataSets}
|
|
|
|
|
total={total}
|
|
|
|
|
pagination={pagination}
|
|
|
|
|
onPageChange={handlePageChange}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<SplitPane split="vertical" defaultSize="100%" allowResize={false}>
|
|
|
|
|
<RightPane
|
|
|
|
@ -176,7 +194,10 @@ const mapStateToProps = (state) => {
|
|
|
|
|
jupyter_info,
|
|
|
|
|
jupyter_tpi_url,
|
|
|
|
|
jupyter_data_set,
|
|
|
|
|
jupyter_tpi_url_state
|
|
|
|
|
jupyter_tpi_url_state,
|
|
|
|
|
jupyter_data_set_count,
|
|
|
|
|
jupyter_pagination,
|
|
|
|
|
jupyter_identifier
|
|
|
|
|
} = state.jupyterReducer;
|
|
|
|
|
const { loading } = state.commonReducer;
|
|
|
|
|
return {
|
|
|
|
@ -184,7 +205,10 @@ const mapStateToProps = (state) => {
|
|
|
|
|
jupyter_info,
|
|
|
|
|
url: jupyter_tpi_url,
|
|
|
|
|
dataSets: jupyter_data_set,
|
|
|
|
|
jupyter_tpi_url_state
|
|
|
|
|
jupyter_tpi_url_state,
|
|
|
|
|
total: jupyter_data_set_count,
|
|
|
|
|
pagination: jupyter_pagination,
|
|
|
|
|
jupyter_identifier
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -193,10 +217,11 @@ const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
getJupyterInfo: (identifier) => dispatch(actions.getJupyterInfo(identifier)),
|
|
|
|
|
// 重置代码
|
|
|
|
|
syncJupyterCode: (identifier, msg) => dispatch(actions.syncJupyterCode(identifier, msg)),
|
|
|
|
|
// getJupyterTpiDataSet: (identifier) => dispatch(actions.getJupyterTpiDataSet(identifier)),
|
|
|
|
|
getJupyterTpiDataSet: (identifier, current) => dispatch(actions.getJupyterTpiDataSet(identifier, current)),
|
|
|
|
|
getJupyterTpiUrl: (identifier) => dispatch(actions.getJupyterTpiUrl(identifier)),
|
|
|
|
|
saveJupyterTpi: () => dispatch(actions.saveJupyterTpi()),
|
|
|
|
|
changeLoadingState: (flag) => dispatch(actions.changeLoadingState(flag))
|
|
|
|
|
changeLoadingState: (flag) => dispatch(actions.changeLoadingState(flag)),
|
|
|
|
|
changeCurrentPage: (current) => dispatch(actions.changeCurrentPage(current))
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
|