From bc6aabffb4e669c7e69866ea569901a6e551caaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Dec 2019 20:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4jupyte=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/jupyter/index.js | 44 ++++++++++--------- .../react/src/modules/tpm/jupyter/index.scss | 30 ++++++++++--- .../modules/tpm/jupyter/leftPane/index.scss | 4 +- .../Challenges/Challengesjupyter.js | 13 ++---- 4 files changed, 53 insertions(+), 38 deletions(-) diff --git a/public/react/src/modules/tpm/jupyter/index.js b/public/react/src/modules/tpm/jupyter/index.js index 0e209523f..4fa712214 100644 --- a/public/react/src/modules/tpm/jupyter/index.js +++ b/public/react/src/modules/tpm/jupyter/index.js @@ -1,7 +1,7 @@ /* * @Description: jupyter tpi * @Author: tangjiang - * @Github: + * @Github: * @Date: 2019-12-11 08:35:23 * @LastEditors: tangjiang * @LastEditTime: 2019-12-13 15:25:50 @@ -69,7 +69,7 @@ function JupyterTPI (props) { ); - const {identifier} = params; + const {identifier} = params; const [userInfo, setUserInfo] = useState({}); const [jupyterInfo, setJupyterInfo] = useState({}); const [updateTip, setUpdateTip] = useState(true); @@ -94,8 +94,8 @@ function JupyterTPI (props) { useEffect(() => { - /* 先调用 jupyter的 TPI 接口, - * 获取 用户信息, + /* 先调用 jupyter的 TPI 接口, + * 获取 用户信息, * 实训的 identifier, 状态, 名称, 是否被修改等信息 */ addEventListeners() @@ -109,7 +109,7 @@ function JupyterTPI (props) { if (user) { setUserInfo(user); } - + if (myshixun_identifier) { setMyIdentifier(myshixun_identifier); } @@ -199,7 +199,7 @@ function JupyterTPI (props) { saveJupyterTpi(); } - // 分页信息改变时 + // 分页信息改变时 const handlePageChange = (current) => { // 改变当前页 changeCurrentPage(current); @@ -232,13 +232,15 @@ function JupyterTPI (props) { // title={item.file_path} mouseLeaveDelay={0.3} > - - {item.title} - { - jsCopy("file_path"+i) - }}>复制地址 - +
+ + {item.title} + { + jsCopy("file_path"+i) + }}>复制地址 +
+ ); @@ -265,9 +267,9 @@ function JupyterTPI (props) {

{/* sync | poweroff */} - @@ -279,12 +281,12 @@ function JupyterTPI (props) { onClick={handleEnvironmentTpi} >重置环境 - + >退出实训

@@ -347,7 +349,7 @@ function JupyterTPI (props) { const mapStateToProps = (state) => { const { jupyter_info, - jupyter_tpi_url, + jupyter_tpi_url, jupyter_data_set, jupyter_tpi_url_state, jupyter_data_set_count, diff --git a/public/react/src/modules/tpm/jupyter/index.scss b/public/react/src/modules/tpm/jupyter/index.scss index 76c8bedd1..a9cb3d96c 100644 --- a/public/react/src/modules/tpm/jupyter/index.scss +++ b/public/react/src/modules/tpm/jupyter/index.scss @@ -14,7 +14,7 @@ -webkit-transition: all 2s ease; transition: all 2s ease; } - + .Resizer.horizontal { height: 11px; margin: -5px 0; @@ -23,12 +23,12 @@ cursor: row-resize; width: 100%; } - + .Resizer.horizontal:hover { border-top: 5px solid rgba(0, 0, 0, 0.5); border-bottom: 5px solid rgba(0, 0, 0, 0.5); } - + .Resizer.vertical { width: 11px; margin: 0 -5px; @@ -36,7 +36,7 @@ border-right: 5px solid rgba(255, 255, 255, 0); cursor: col-resize; } - + .Resizer.vertical:hover { border-left: 5px solid rgba(0, 0, 0, 0.5); border-right: 5px solid rgba(0, 0, 0, 0.5); @@ -89,7 +89,7 @@ } } } - + .jupyter_ctx{ position: relative; @@ -122,7 +122,6 @@ .ant-drawer-wrapper-body{ padding-top: 60px; background: #070F1A; - overflow: hidden !important; } .ant-pagination{ @@ -159,3 +158,22 @@ } } +.maxnamewidth150 { + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; + width: 150px; +} +.sortinxdirection{ + display: flex; + flex-direction:row; +} + +.lineheighttaj{ +line-height: 50px !important; +} +.colorlineheighttaj{ + color: #ffffff; +} diff --git a/public/react/src/modules/tpm/jupyter/leftPane/index.scss b/public/react/src/modules/tpm/jupyter/leftPane/index.scss index 495e21f20..fdffdf5e7 100644 --- a/public/react/src/modules/tpm/jupyter/leftPane/index.scss +++ b/public/react/src/modules/tpm/jupyter/leftPane/index.scss @@ -33,7 +33,7 @@ .jupyter_item{ line-height:45px; //border-bottom: 1px solid rgba(238,238,238, 1); - padding: 0 30px 0 60px; + padding: 0 30px 0 45px; overflow: hidden; text-overflow:ellipsis; white-space: nowrap; @@ -70,4 +70,4 @@ box-sizing: border-box; border-top: 1px solid rgba(238,238,238,1); } -} \ No newline at end of file +} diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index a08825936..0c00f2bb2 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -243,14 +243,9 @@ class Challengesjupyter extends Component { enlarge:bool }) } - daoruzhon=()=>{ - var _iframe = document.getElementById("frame"); - if(_iframe == null || _iframe == undefined || _iframe == ""){ - console.log("framenull"); - return; - } - console.log("framego"); - _iframe.contentWindow.postMessage("Parentwindow", "*"); + Importingfiles=()=>{ + // 导入文件 + } render() { @@ -414,7 +409,7 @@ class Challengesjupyter extends Component { }} onClick={()=>this.onclki(true)}> }

this.daoruzhon()}>导入

+ className="challenbaocuntest" onClick={()=>this.Importingfiles()}>导入