瀏覽代碼

代码输入框bug

Leo 2 年之前
父節點
當前提交
1468064216

+ 1 - 0
packages/filebrowser/style/dataview.css

@@ -2,6 +2,7 @@
   width: 100%;
   height: 100%;
   padding: 0 20px;
+  overflow: auto;
 }
 .dataview_info {
   height: 250px;

+ 1 - 1
packages/yili-dag/package.json

@@ -44,7 +44,7 @@
     "@jupyterlab/settingregistry": "^3.4.3",
     "@jupyterlab/ui-components": "^3.4.3",
     "@lumino/signaling": "^1.10.0",
-    "@uiw/react-codemirror": "^3.2.8",
+    "@uiw/react-codemirror": "^3.2.9",
     "antd": "^4.22.8",
     "axios": "^0.27.2",
     "canvas": "^2.6.1",

+ 24 - 21
packages/yili-dag/src/MediateDataInfo.tsx

@@ -1,32 +1,36 @@
-import { message, Table } from "antd";
-import React from "react";
-import { getFileData } from "./request";
+import { message, Table } from 'antd';
+import React from 'react';
+import { getFileData } from './request';
 
 export default class ToolBar extends React.Component<any, any> {
   constructor(props: any) {
-    super(props)
+    super(props);
     this.state = {
       columns: [],
       tableData: []
-    }
+    };
   }
-  
-  async componentDidMount(){
+
+  async componentDidMount() {
     console.log(this.props.dataInfo);
-    const uri = this.props.dataInfo.storage_path
-    const data = await getFileData({uri})
+    const uri = this.props.dataInfo.storage_path;
+    const data = await getFileData({ uri });
     console.log('data:', data);
     if (data.status === 200) {
-      const fields = data.data.split('\n')[0].split(',')
-      const dataList: any = []
+      const fields = data.data.split('\n')[0].split(',');
+      const dataList: any = [];
       data.data.split('\n').forEach((item: any, index: any) => {
         if (index !== 0 && index !== data.data.split('\n').length - 1) {
-          dataList.push(item.split(','))
+          dataList.push(item.split(','));
         }
-      })
-      const columns = fields.map((item: any) => ({title: item, dataIndex: item, key: item}))
+      });
+      const columns = fields.map((item: any) => ({
+        title: item,
+        dataIndex: item,
+        key: item
+      }));
       console.log('columns:', columns);
-      this.setState({columns})
+      this.setState({ columns });
       const tableData: any = dataList.map((item: any, index: number) => {
         const formatData = {} as Record<string, any>;
         formatData['key'] = index;
@@ -36,9 +40,9 @@ export default class ToolBar extends React.Component<any, any> {
         return formatData;
       });
       console.log('tableData:', tableData);
-      this.setState({tableData})
+      this.setState({ tableData });
     } else {
-      message.error('获取数据失败')
+      message.error('获取数据失败');
     }
   }
 
@@ -53,8 +57,7 @@ export default class ToolBar extends React.Component<any, any> {
               数据表
             </div>
             <div className="dataview_item">
-              <span className="dataview_label">完整性</span>
-              -
+              <span className="dataview_label">完整性</span>-
             </div>
             <div className="dataview_item">
               <span className="dataview_label">数据条数</span>
@@ -93,9 +96,9 @@ export default class ToolBar extends React.Component<any, any> {
           columns={this.state.columns}
           dataSource={this.state.tableData}
           pagination={{ pageSize: 50 }}
-          scroll={{ y: 300 }}
+          scroll={{ y: 250 }}
         />
       </div>
     );
   }
-}
+}

+ 3 - 2
packages/yili-dag/style/MediateDataInfo.css

@@ -2,9 +2,10 @@
   width: 100%;
   height: 100%;
   padding: 0 20px;
+  overflow: auto;
 }
 .dataview_info {
-  height: 350px;
+  height: 250px;
 }
 .dataview_row {
   display: flex;
@@ -62,4 +63,4 @@
   font-weight: 400;
   color: #7d7d7d;
   margin: 0 24px 0 16px;
-}
+}

+ 1 - 0
packages/yili-dag/style/index.css

@@ -6,6 +6,7 @@
 /* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
 @import url('~@jupyterlab/ui-components/style/index.css');
 @import url('~@jupyterlab/apputils/style/index.css');
+@import url('~codemirror/lib/codemirror.css');
 @import url('~@jupyterlab/docregistry/style/index.css');
 @import url('~@jupyterlab/application/style/index.css');
 @import url('~@jupyterlab/filebrowser/style/index.css');

+ 1 - 0
packages/yili-dag/style/index.js

@@ -6,6 +6,7 @@
 /* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
 import '@jupyterlab/ui-components/style/index.js';
 import '@jupyterlab/apputils/style/index.js';
+import 'codemirror/lib/codemirror.css';
 import '@jupyterlab/docregistry/style/index.js';
 import '@jupyterlab/application/style/index.js';
 import '@jupyterlab/filebrowser/style/index.js';

+ 0 - 1
untitled.dag

@@ -1 +0,0 @@
-{"id":"uuid1","requirements":"","user_name":"xxx","user_id":1,"project_name":"dfs","project_id":123,"nodes":[{"id":"node-uuid","op":"python/sql/spark/datasource","data":{"input":["input1","input2"],"output":["output1","o2"],"itermidate_data":["hdfs://host:port/uri"],"script":""},"datasource_table":"uri"}],"edges":[]}

+ 6 - 6
yarn.lock

@@ -4520,13 +4520,13 @@
     "@typescript-eslint/types" "4.8.2"
     eslint-visitor-keys "^2.0.0"
 
-"@uiw/react-codemirror@^3.2.8":
-  version "3.2.8"
-  resolved "https://registry.yarnpkg.com/@uiw/react-codemirror/-/react-codemirror-3.2.8.tgz#240ea79ecdee223b5e5e0fc8d4921c10a53be56d"
-  integrity sha512-weLAiiUD94KZBPy4VcqUhhXH+tQ9vCYm2MclwOmG3KCOFvBt6fUEPGBzpx51mp1ozjLJPHM7GZwW+gGp56yFpw==
+"@uiw/react-codemirror@^3.2.9":
+  version "3.2.9"
+  resolved "https://registry.yarnpkg.com/@uiw/react-codemirror/-/react-codemirror-3.2.9.tgz#1affb6e459e7c1a940d954f8115fc8662fcc6734"
+  integrity sha512-AKkylbD2oMlHmQk9Snlmbfi/f2i20LjBjDjmr4IpE3YjrFxeUvfh5LLpora93c1GBbZeHmpjDilv4lJ0r+oUeQ==
   dependencies:
     "@babel/runtime" "^7.18.9"
-    codemirror "^5.65.7"
+    codemirror "^5.65.8"
 
 "@verdaccio/commons-api@10.0.0":
   version "10.0.0"
@@ -6790,7 +6790,7 @@ code-point-at@^1.0.0:
   resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
   integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
 
-codemirror@^5.65.7:
+codemirror@^5.65.8:
   version "5.65.8"
   resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.8.tgz#50f145ba7eb725091110c31f3a7c1fdef6bdc721"
   integrity sha512-TNGkSkkoAsmZSf6W6g35LMVQJBHKasc2CKwhr/fTxSYun7cn6J+CbtyNjV/MYlFVkNTsqZoviegyCZimWhoMMA==

+ 0 - 40
未命名.ipynb

@@ -1,40 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "7fc12ae8-8108-44ab-ab73-ce9f1516809a",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "1231\n",
-    "131\n",
-    "qeawad\n",
-    "\n",
-    "adadaad\n",
-    "ada"
-   ]
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 3 (ipykernel)",
-   "language": "python",
-   "name": "python3"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 3
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython3",
-   "version": "3.8.13"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}