From 04d5e7c9d879e2e10c73f66826a809522811e9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E5=B8=AE=E6=A1=82?= <97835322+xiebanggui777@users.noreply.github.com> Date: Thu, 20 Jan 2022 20:17:12 +0800 Subject: [PATCH 01/11] Update dlink.sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了注册中心-文档管理-新建文档的描述框和填充值框的输入字符数限制,可以提交长文本,另外添加几条常用设置的语法快速补全。 --- dlink-doc/sql/dlink.sql | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/dlink-doc/sql/dlink.sql b/dlink-doc/sql/dlink.sql index 06e82fa5a2..38835962c4 100644 --- a/dlink-doc/sql/dlink.sql +++ b/dlink-doc/sql/dlink.sql @@ -114,8 +114,8 @@ CREATE TABLE `dlink_flink_document` ( `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型', `subtype` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '子类型', `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '信息', - `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述', - `fill_value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填充值', + `description` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述', + `fill_value` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填充值', `version` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '版本号', `like_num` int(255) NULL DEFAULT 0 COMMENT '喜爱值', `enabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否启用', @@ -124,6 +124,28 @@ CREATE TABLE `dlink_flink_document` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 264 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文档管理' ROW_FORMAT = Dynamic; +INSERT INTO `dlink_flink_document` VALUES (1, 'Variable', '优化参数', 'Batch/Streaming', 'set table.exec.async-lookup.buffer-capacity', '异步查找连接可以触发的最大异步操作的操作数。 \nThe max number of async i/o operation that the async lookup join can trigger.', 'Set \'table.exec.async-lookup.buffer-capacity\'=\'100\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (2, 'Variable', '优化参数', 'Batch/Streaming', 'set table.exec.async-lookup.timeout', '异步操作完成的超时时间。 \nThe async timeout for the asynchronous operation to complete.', 'Set \'table.exec.async-lookup.timeout\'=\'3 min\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (3, 'Variable', '优化参数', 'Batch', 'set table.exec.disabled-operators', '禁用指定operators,用逗号分隔 \nMainly for testing. A comma-separated list of operator names, each name represents a kind of disabled operator. Operators that can be disabled include \"NestedLoopJoin\", \"ShuffleHashJoin\", \"BroadcastHashJoin\", \"SortMergeJoin\", \"HashAgg\", \"SortAgg\". By default no operator is disabled.', 'Set \'table.exec.disabled-operators\'=\'SortMergeJoin\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (4, 'Variable', '优化参数', 'Streaming', 'set table.exec.mini-batch.allow-latency', '最大等待时间可用于MiniBatch缓冲输入记录。 MiniBatch是用于缓冲输入记录以减少状态访问的优化。MiniBatch以允许的等待时间间隔以及达到最大缓冲记录数触发。注意:如果将table.exec.mini-batch.enabled设置为true,则其值必须大于零.', 'Set \'table.exec.mini-batch.allow-latency\'=\'-1 ms\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (5, 'Variable', '优化参数', 'Streaming', 'set table.exec.mini-batch.enabled', '指定是否启用MiniBatch优化。 MiniBatch是用于缓冲输入记录以减少状态访问的优化。默认情况下禁用此功能。 要启用此功能,用户应将此配置设置为true。注意:如果启用了mini batch 处理,则必须设置“ table.exec.mini-batch.allow-latency”和“ table.exec.mini-batch.size”.', 'Set \'table.exec.mini-batch.enabled\'=\'false\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (6, 'Variable', '优化参数', 'Streaming', 'set table.exec.mini-batch.size', '可以为MiniBatch缓冲最大输入记录数。 MiniBatch是用于缓冲输入记录以减少状态访问的优化。MiniBatch以允许的等待时间间隔以及达到最大缓冲记录数触发。 注意:MiniBatch当前仅适用于非窗口聚合。如果将table.exec.mini-batch.enabled设置为true,则其值必须为正.', 'Set \'table.exec.mini-batch.size\'=\'-1\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (7, 'Variable', '优化参数', 'Batch/Streaming', 'set table.exec.resource.default-parallelism', '设置所有Operator的默认并行度。 \nSets default parallelism for all operators (such as aggregate, join, filter) to run with parallel instances. This config has a higher priority than parallelism of StreamExecutionEnvironment (actually, this config overrides the parallelism of StreamExecutionEnvironment). A value of -1 indicates that no default parallelism is set, then it will fallback to use the parallelism of StreamExecutionEnvironment.', 'Set \'table.exec.resource.default-parallelism\'=\'1\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (8, 'Variable', '优化参数', 'Batch/Streaming', 'set table.exec.sink.not-null-enforcer', '对表的NOT NULL列约束强制执行不能将空值插入到表中。Flink支持“error”(默认)和“drop”强制行为 \nThe NOT NULL column constraint on a table enforces that null values can\'t be inserted into the table. Flink supports \'error\' (default) and \'drop\' enforcement behavior. By default, Flink will check values and throw runtime exception when null values writing into NOT NULL columns. Users can change the behavior to \'drop\' to silently drop such records without throwing exception.\nPossible values:\n\"ERROR\" \n\"DROP\"', 'Set \'table.exec.sink.not-null-enforcer\'=\'ERROR\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (9, 'Variable', '优化参数', 'Streaming', 'set table.exec.sink.upsert-materialize', '由于分布式系统中 Shuffle 导致 ChangeLog 数据混乱,Sink 接收到的数据可能不是全局 upsert 的顺序。因此,在 upsert sink 之前添加 upsert materialize 运算符。它接收上游的变更日志记录并为下游生成一个 upsert 视图。默认情况下,当唯一键出现分布式无序时,会添加具体化操作符。您也可以选择不实现(NONE)或强制实现(FORCE)。\nPossible values:\n\"NONE\" \n\"FORCE\" \n\"AUTO\"', 'Set \'table.exec.sink.upsert-materialize\'=\'AUTO\';', '1.14', 0, 1, '2022-01-20 15:00:00', '2022-01-20 15:00:00'); +INSERT INTO `dlink_flink_document` VALUES (10, 'Module', '建表语句', NULL, 'create.table.kafka', 'kafka快速建表格式', 'CREATE TABLE Kafka_Table (\n `event_time` TIMESTAMP(3) METADATA FROM \'timestamp\',\n `partition` BIGINT METADATA VIRTUAL,\n `offset` BIGINT METADATA VIRTUAL,\n `user_id` BIGINT,\n `item_id` BIGINT,\n `behavior` STRING\n) WITH (\n \'connector\' = \'kafka\',\n \'topic\' = \'user_behavior\',\n \'properties.bootstrap.servers\' = \'localhost:9092\',\n \'properties.group.id\' = \'testGroup\',\n \'scan.startup.mode\' = \'earliest-offset\',\n \'format\' = \'csv\'\n);\n--可选: \'value.fields-include\' = \'ALL\',\n--可选: \'json.ignore-parse-errors\' = \'true\',\n--可选: \'key.fields-prefix\' = \'k_\',', '1.14', 0, 1, '2022-01-20 16:59:18', '2022-01-20 17:57:32'); +INSERT INTO `dlink_flink_document` VALUES (11, 'Module', '建表语句', NULL, 'create.table.doris', 'Doris快速建表', 'CREATE TABLE doris_table (\n cid INT,\n sid INT,\n name STRING,\n cls STRING,\n score INT,\n PRIMARY KEY (cid) NOT ENFORCED\n) WITH ( \n\'connector\' = \'doris\',\n\'fenodes\' = \'127.0.0.1:8030\' ,\n\'table.identifier\' = \'test.scoreinfo\',\n\'username\' = \'root\',\n\'password\'=\'\'\n);', '1.14', 0, 1, '2022-01-20 17:08:00', '2022-01-20 17:57:26'); +INSERT INTO `dlink_flink_document` VALUES (12, 'Module', '建表语句', NULL, 'create.table.jdbc', 'JDBC建表语句', 'CREATE TABLE JDBC_table (\n id BIGINT,\n name STRING,\n age INT,\n status BOOLEAN,\n PRIMARY KEY (id) NOT ENFORCED\n) WITH (\n \'connector\' = \'jdbc\',\n \'url\' = \'jdbc:mysql://localhost:3306/mydatabase\',\n \'table-name\' = \'users\',\n \'username\' = \'root\',\n \'password\' = \'123456\'\n);\n--可选: \'sink.parallelism\'=\'1\',\n--可选: \'lookup.cache.ttl\'=\'1000s\',', '1.14', 0, 1, '2022-01-20 17:15:26', '2022-01-20 17:57:20'); +INSERT INTO `dlink_flink_document` VALUES (13, 'Module', '创建catalog模块', NULL, 'create.catalog.hive', '创建HIVE的catalog', 'CREATE CATALOG hive WITH ( \n \'type\' = \'hive\',\n \'default-database\' = \'default\',\n \'hive-conf-dir\' = \'/app/wwwroot/MBDC/hive/conf/\', --hive配置文件\n \'hadoop-conf-dir\'=\'/app/wwwroot/MBDC/hadoop/etc/hadoop/\' --hadoop配置文件,配了环境变量则不需要。\n);', '1.14', 0, 1, '2022-01-20 17:18:54', '2022-01-20 17:18:54'); +INSERT INTO `dlink_flink_document` VALUES (14, 'Operator', '', NULL, 'use.catalog.hive', '使用hive的catalog', 'USE CATALOG hive;', '1.14', 0, 1, '2022-01-20 17:22:53', '2022-01-20 17:22:53'); +INSERT INTO `dlink_flink_document` VALUES (15, 'Operator', NULL, NULL, 'use.catalog.default', '使用default的catalog', 'USE CATALOG default_catalog; \n', '1.14', 0, 1, '2022-01-20 17:23:48', '2022-01-20 17:24:23'); +INSERT INTO `dlink_flink_document` VALUES (16, 'Variable', '设置参数', NULL, 'set dialect.hive', '使用hive方言', 'Set table.sql-dialect=hive;', '1.14', 0, 1, '2022-01-20 17:25:37', '2022-01-20 17:27:23'); +INSERT INTO `dlink_flink_document` VALUES (17, 'Variable', '设置参数', NULL, 'set dialect.default', '使用default方言', 'Set table.sql-dialect=default;', '1.14', 0, 1, '2022-01-20 17:26:19', '2022-01-20 17:27:20'); +INSERT INTO `dlink_flink_document` VALUES (18, 'Module', '建表语句', NULL, 'create.stream.table.hive', '创建流式HIVE表', 'CREATE CATALOG hive WITH ( --创建hive的catalog\n \'type\' = \'hive\',\n \'hive-conf-dir\' = \'/app/wwwroot/MBDC/hive/conf/\',\n \'hadoop-conf-dir\'=\'/app/wwwroot/MBDC/hadoop/etc/hadoop/\'\n);\n\nUSE CATALOG hive; \nUSE offline_db; --选择库\nset table.sql-dialect=hive; --设置方言\n\nCREATE TABLE hive_stream_table (\n user_id STRING,\n order_amount DOUBLE\n) PARTITIONED BY (dt STRING, hr STRING) STORED AS parquet TBLPROPERTIES (\n \'partition.time-extractor.timestamp-pattern\'=\'$dt $hr:00:00\',\n \'sink.partition-commit.trigger\'=\'partition-time\',\n \'sink.partition-commit.delay\'=\'1min\',\n \'sink.semantic\' = \'exactly-once\',\n \'sink.rolling-policy.rollover-interval\' =\'1min\',\n \'sink.rolling-policy.check-interval\'=\'1min\',\n \'sink.partition-commit.policy.kind\'=\'metastore,success-file\'\n);', '1.14', 0, 1, '2022-01-20 17:34:06', '2022-01-20 17:46:41'); +INSERT INTO `dlink_flink_document` VALUES (19, 'Module', '建表语句', NULL, 'create.table.mysql_cdc', '创建Mysql_CDC表', 'CREATE TABLE mysql_cdc_table(\n cid INT,\n sid INT,\n cls STRING,\n score INT,\n PRIMARY KEY (cid) NOT ENFORCED\n) WITH (\n\'connector\' = \'mysql-cdc\',\n\'hostname\' = \'127.0.0.1\',\n\'port\' = \'3306\',\n\'username\' = \'test\',\n\'password\' = \'123456\',\n\'database-name\' = \'test\',\n\'server-time-zone\' = \'UTC\',\n\'scan.incremental.snapshot.enabled\' = \'true\',\n\'debezium.snapshot.mode\'=\'latest-offset\' ,-- 或者key是scan.startup.mode,initial表示要历史数据,latest-offset表示不要历史数据\n\'debezium.datetime.format.date\'=\'yyyy-MM-dd\',\n\'debezium.datetime.format.time\'=\'HH-mm-ss\',\n\'debezium.datetime.format.datetime\'=\'yyyy-MM-dd HH-mm-ss\',\n\'debezium.datetime.format.timestamp\'=\'yyyy-MM-dd HH-mm-ss\',\n\'debezium.datetime.format.timestamp.zone\'=\'UTC+8\',\n\'table-name\' = \'mysql_cdc_table\');', '1.14', 0, 1, '2022-01-20 17:49:14', '2022-01-20 17:52:20'); +INSERT INTO `dlink_flink_document` VALUES (20, 'Module', '建表语句', NULL, 'create.table.hudi', '创建hudi表', 'CREATE TABLE hudi_table\n(\n `goods_order_id` bigint COMMENT \'自增主键id\',\n `goods_order_uid` string COMMENT \'订单uid\',\n `customer_uid` string COMMENT \'客户uid\',\n `customer_name` string COMMENT \'客户name\',\n `create_time` timestamp(3) COMMENT \'创建时间\',\n `update_time` timestamp(3) COMMENT \'更新时间\',\n `create_by` string COMMENT \'创建人uid(唯一标识)\',\n `update_by` string COMMENT \'更新人uid(唯一标识)\',\n PRIMARY KEY (goods_order_id) NOT ENFORCED\n) COMMENT \'hudi_table\'\nWITH (\n\'connector\' = \'hudi\',\n\'path\' = \'hdfs://cluster1/data/bizdata/cdc/mysql/order/goods_order\', -- 路径会自动创建\n\'hoodie.datasource.write.recordkey.field\' = \'goods_order_id\', -- 主键\n\'write.precombine.field\' = \'update_time\', -- 相同的键值时,取此字段最大值,默认ts字段\n\'read.streaming.skip_compaction\' = \'true\', -- 避免重复消费问题\n\'write.bucket_assign.tasks\' = \'2\', -- 并发写的 bucekt 数\n\'write.tasks\' = \'2\',\n\'compaction.tasks\' = \'1\',\n\'write.operation\' = \'upsert\', -- UPSERT(插入更新)\\INSERT(插入)\\BULK_INSERT(批插入)(upsert性能会低些,不适合埋点上报)\n\'write.rate.limit\' = \'20000\', -- 限制每秒多少条\n\'table.type\' = \'COPY_ON_WRITE\', -- 默认COPY_ON_WRITE ,\n\'compaction.async.enabled\' = \'true\', -- 在线压缩\n\'compaction.trigger.strategy\' = \'num_or_time\', -- 按次数压缩\n\'compaction.delta_commits\' = \'20\', -- 默认为5\n\'compaction.delta_seconds\' = \'60\', -- 默认为1小时\n\'hive_sync.enable\' = \'true\', -- 启用hive同步\n\'hive_sync.mode\' = \'hms\', -- 启用hive hms同步,默认jdbc\n\'hive_sync.metastore.uris\' = \'thrift://cdh2.vision.com:9083\', -- required, metastore的端口\n\'hive_sync.jdbc_url\' = \'jdbc:hive2://cdh1.vision.com:10000\', -- required, hiveServer地址\n\'hive_sync.table\' = \'order_mysql_goods_order\', -- required, hive 新建的表名 会自动同步hudi的表结构和数据到hive\n\'hive_sync.db\' = \'cdc_ods\', -- required, hive 新建的数据库名\n\'hive_sync.username\' = \'hive\', -- required, HMS 用户名\n\'hive_sync.password\' = \'123456\', -- required, HMS 密码\n\'hive_sync.skip_ro_suffix\' = \'true\' -- 去除ro后缀\n);', '1.14', 0, 1, '2022-01-20 17:56:50', '2022-01-20 17:56:50'); + + -- ---------------------------- -- Table structure for dlink_history -- ---------------------------- From a5052c9120c2acc09109fc6bc4e9f35c6391c5ff Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Fri, 21 Jan 2022 00:27:40 +0800 Subject: [PATCH 02/11] =?UTF-8?q?F2=E5=85=A8=E5=B1=8F=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Studio/StudioHome/index.tsx | 3 ++- .../components/Studio/StudioMenu/index.tsx | 24 +++++++++++++++++-- .../components/Studio/StudioTabs/index.tsx | 6 ++--- dlink-web/src/components/Studio/index.tsx | 6 ++--- dlink-web/src/pages/Welcome.tsx | 3 +++ 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/dlink-web/src/components/Studio/StudioHome/index.tsx b/dlink-web/src/components/Studio/StudioHome/index.tsx index e81bb38c63..50bf6e4fa8 100644 --- a/dlink-web/src/components/Studio/StudioHome/index.tsx +++ b/dlink-web/src/components/Studio/StudioHome/index.tsx @@ -22,7 +22,8 @@ const StudioHome = (props: any) => { Alt + 1 保存 Alt + 2 校验 Alt + 3 美化 - Esc 关闭弹框 + F2 全屏 + Esc 关闭弹框及全屏 F1 更多快捷键 diff --git a/dlink-web/src/components/Studio/StudioMenu/index.tsx b/dlink-web/src/components/Studio/StudioMenu/index.tsx index cece7c536b..826659a8d0 100644 --- a/dlink-web/src/components/Studio/StudioMenu/index.tsx +++ b/dlink-web/src/components/Studio/StudioMenu/index.tsx @@ -16,7 +16,7 @@ import {executeSql, getJobPlan} from "@/pages/FlinkSqlStudio/service"; import StudioHelp from "./StudioHelp"; import StudioGraph from "./StudioGraph"; import {showCluster, showTables} from "@/components/Studio/StudioEvent/DDL"; -import {useCallback, useEffect, useState} from "react"; +import React, {useCallback, useEffect, useState} from "react"; import StudioExplain from "../StudioConsole/StudioExplain"; import {DIALECT, isOnline, isSql} from "@/components/Studio/conf"; import { @@ -24,6 +24,7 @@ import { } from '@ant-design/pro-form'; import SqlExport from "@/pages/FlinkSqlStudio/SqlExport"; import {Dispatch} from "@@/plugin-dva/connect"; +import StudioTabs from "@/components/Studio/StudioTabs"; const menu = ( @@ -34,10 +35,11 @@ const menu = ( const StudioMenu = (props: any) => { - const {tabs, current, currentPath, form, refs, dispatch, currentSession} = props; + const {tabs, current, currentPath, form,width,height, refs, dispatch, currentSession} = props; const [modalVisible, handleModalVisible] = useState(false); const [exportModalVisible, handleExportModalVisible] = useState(false); const [graphModalVisible, handleGraphModalVisible] = useState(false); + const [editModalVisible, handleEditModalVisible] = useState(false); const [graphData, setGraphData] = useState(); const onKeyDown = useCallback((e) => { @@ -47,6 +49,12 @@ const StudioMenu = (props: any) => { props.saveTask(current); } } + if(e.keyCode === 113){ + e.preventDefault(); + if(current) { + handleEditModalVisible(true); + } + } }, [current]); useEffect(() => { @@ -455,6 +463,18 @@ const StudioMenu = (props: any) => { > :undefined} + {current? handleEditModalVisible(false)}> + + :undefined} ); }; diff --git a/dlink-web/src/components/Studio/StudioTabs/index.tsx b/dlink-web/src/components/Studio/StudioTabs/index.tsx index a41c73ff39..24337c9ddb 100644 --- a/dlink-web/src/components/Studio/StudioTabs/index.tsx +++ b/dlink-web/src/components/Studio/StudioTabs/index.tsx @@ -10,7 +10,7 @@ import StudioHome from "@/components/Studio/StudioHome"; const {TabPane} = Tabs; const EditorTabs = (props: any) => { - const {tabs, dispatch, current, toolHeight, width} = props; + const {tabs, dispatch, current, toolHeight, width,height} = props; const onChange = (activeKey: any) => { dispatch && @@ -116,13 +116,13 @@ const EditorTabs = (props: any) => { activeKey={tabs.activeKey + ''} onEdit={onEdit} className={styles['edit-tabs']} - style={{height: toolHeight}} + style={{height: height?height:toolHeight}} > {tabs.panes.map((pane) => ( diff --git a/dlink-web/src/components/Studio/index.tsx b/dlink-web/src/components/Studio/index.tsx index ab9925e1bd..6af4ba917b 100644 --- a/dlink-web/src/components/Studio/index.tsx +++ b/dlink-web/src/components/Studio/index.tsx @@ -32,12 +32,12 @@ const Studio = (props: any) => { midMargin: 46, }; const [size, setSize] = useState({ - width: document.documentElement.clientWidth - 1, + width: document.documentElement.clientWidth, height: document.documentElement.clientHeight, }); const onResize = useCallback(() => { setSize({ - width: document.documentElement.clientWidth - 1, + width: document.documentElement.clientWidth, height: document.documentElement.clientHeight, }) }, []); @@ -73,7 +73,7 @@ const Studio = (props: any) => { return (
- + {
  • 修复 前端多处bug
  • +
  • + 新增 F2 全屏开发 +
  • From 02cc880a7e59d100c6f14bf941edf0c19b2c6dfd Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Sat, 22 Jan 2022 23:49:48 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E4=BC=98=E5=8C=96pom=E5=92=8C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=BB=A5=E5=8F=8A=E5=8D=87=E7=BA=A7springboot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dlink-admin/pom.xml | 20 ++-------- .../dlink/service/impl/TaskServiceImpl.java | 39 ++++++++++++++++++- dlink-core/pom.xml | 7 ++++ pom.xml | 12 +++--- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/dlink-admin/pom.xml b/dlink-admin/pom.xml index 327d3dc79d..f0b23e3e7b 100644 --- a/dlink-admin/pom.xml +++ b/dlink-admin/pom.xml @@ -66,7 +66,7 @@ - - - org.apache.logging.log4j - log4j-api - - - org.apache.logging.log4j - log4j-core - - - org.slf4j - slf4j-log4j12 mysql @@ -133,11 +121,11 @@ com.dlink dlink-gateway - + 0.5.0 + + provided @@ -70,5 +72,10 @@ dlink-gateway ${scope.runtime} + + com.dlink + dlink-client-hadoop + ${scope.runtime} + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4e259b4661..521b8c6a3c 100644 --- a/pom.xml +++ b/pom.xml @@ -31,14 +31,14 @@ 1.8 UTF-8 UTF-8 - 2.3.8.RELEASE + 2.6.3 5.1.4 1.2.8 3.4.0 1.18.16 2.11.4 21.0 - 2.17.1 + 8.0.22 12.2.0.1 0.2.6 @@ -102,7 +102,7 @@ guava ${guava.version} - + + mysql mysql-connector-java From 045fca96b4b66677bb56242e4c7f816ca1c0700d Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Sat, 22 Jan 2022 23:51:52 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=86=85=E5=AE=B9=E6=BA=A2=E5=87=BA=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Studio/StudioConsole/StudioHistory/index.less | 6 +++--- .../components/Studio/StudioConsole/StudioHistory/index.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.less b/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.less index 773013f4c4..070fc3ef4e 100644 --- a/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.less +++ b/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.less @@ -1,9 +1,9 @@ .code{ - width: 100%; - max-height: 500px; + //width: 100%; + //max-height: 400px; display: block; padding: 16px; - overflow: auto; + //overflow: auto; font-size: 85%; line-height: 1.45; background-color: rgb(246, 248, 250); diff --git a/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx b/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx index 6824df16a9..a52912b988 100644 --- a/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx +++ b/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx @@ -10,7 +10,7 @@ import { ModalForm, } from '@ant-design/pro-form'; import styles from "./index.less"; -import {showJobData} from "@/components/Studio/StudioEvent/DQL"; +import {Scrollbars} from 'react-custom-scrollbars'; import StudioPreview from "../StudioPreview"; import {getJobData} from "@/pages/FlinkSqlStudio/service"; @@ -361,8 +361,10 @@ const StudioHistory = (props: any) => { {row.jobId} - + +
    {row.error}
    +
    )} From 21325641e4544c1e14e28c2d812f5570c99983c7 Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Sat, 22 Jan 2022 23:53:40 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=89=B9=E6=AE=8A=E6=9D=A1=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dlink-web/src/components/Chart/index.tsx | 2 +- .../components/Studio/StudioConsole/StudioTable/index.tsx | 2 +- dlink-web/src/components/Studio/StudioEvent/DQL.ts | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dlink-web/src/components/Chart/index.tsx b/dlink-web/src/components/Chart/index.tsx index 36ba6e5958..cb469c0929 100644 --- a/dlink-web/src/components/Chart/index.tsx +++ b/dlink-web/src/components/Chart/index.tsx @@ -28,7 +28,7 @@ const Chart = (props:any) => { const toRebuild = () => { if(!isSql(current.task.dialect)){ - showJobData(current.console.result.jobId,dispatch); + showJobData(current.key,current.console.result.jobId,dispatch); } }; diff --git a/dlink-web/src/components/Studio/StudioConsole/StudioTable/index.tsx b/dlink-web/src/components/Studio/StudioConsole/StudioTable/index.tsx index 65f195467b..3d3f367fde 100644 --- a/dlink-web/src/components/Studio/StudioConsole/StudioTable/index.tsx +++ b/dlink-web/src/components/Studio/StudioConsole/StudioTable/index.tsx @@ -21,7 +21,7 @@ const StudioTable = (props: any) => { }; const showDetail=()=>{ - showJobData(current.console.result.jobId,dispatch) + showJobData(current.key,current.console.result.jobId,dispatch) }; const renderFlinkSQLContent = () => { diff --git a/dlink-web/src/components/Studio/StudioEvent/DQL.ts b/dlink-web/src/components/Studio/StudioEvent/DQL.ts index 26c53bddbf..4657dbd205 100644 --- a/dlink-web/src/components/Studio/StudioEvent/DQL.ts +++ b/dlink-web/src/components/Studio/StudioEvent/DQL.ts @@ -1,6 +1,6 @@ import {getJobData} from "@/pages/FlinkSqlStudio/service"; -export function showJobData(jobId:string,dispatch:any) { +export function showJobData(key: number,jobId: string,dispatch: any) { if(!jobId){ return; } @@ -8,7 +8,10 @@ export function showJobData(jobId:string,dispatch:any) { res.then((result)=>{ dispatch&&dispatch({ type: "Studio/saveResult", - payload: result.datas, + payload: { + key, + datas: result.datas + }, }); }); } From fa4e61cbd74a505bb0cc0bf0efc72db71207f8dc Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Sat, 22 Jan 2022 23:54:45 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8ESQL=E7=BC=96=E8=BE=91=E5=99=A8=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Studio/StudioEdit/index.tsx | 115 ++++++++---------- .../components/Studio/StudioEvent/data.d.ts | 4 +- .../components/Studio/StudioMenu/index.tsx | 19 ++- .../components/Studio/StudioTabs/index.tsx | 65 +++++----- dlink-web/src/components/Studio/index.tsx | 5 +- dlink-web/src/pages/FlinkSqlStudio/model.ts | 99 ++++++++------- dlink-web/src/pages/Welcome.tsx | 21 ++++ 7 files changed, 177 insertions(+), 151 deletions(-) diff --git a/dlink-web/src/components/Studio/StudioEdit/index.tsx b/dlink-web/src/components/Studio/StudioEdit/index.tsx index 309088a337..2dddff4ee5 100644 --- a/dlink-web/src/components/Studio/StudioEdit/index.tsx +++ b/dlink-web/src/components/Studio/StudioEdit/index.tsx @@ -6,7 +6,7 @@ import {connect,Dispatch} from "umi"; import {DocumentStateType} from "@/pages/Document/model"; import {DocumentTableListItem} from "@/pages/Document/data"; import {parseSqlMetaData} from "@/components/Studio/StudioEvent/Utils"; -import {Column, MetaData} from "@/components/Studio/StudioEvent/data"; +import {Column, MetaData, SqlMetaData} from "@/components/Studio/StudioEvent/data"; import StudioExplain from "@/components/Studio/StudioConsole/StudioExplain"; import {format} from "sql-formatter"; @@ -23,45 +23,35 @@ interface ISuggestions { const FlinkSqlEditor = (props:any) => { const { - tabsKey, + tabsKey, height = '100%', width = '100%', language = 'sql', - onChange=(val: string, event: { changes: { text: any }[] })=>{}, + onChange=(val: string, event: any)=>{}, options = { selectOnLineNumbers: true, renderSideBySide: false, }, - tabs, + sql, + monaco, + // sqlMetaData, fillDocuments, } = props; - const editorInstance:any = useRef(); + const editorInstance: any = useRef(); const monacoInstance: any = useRef(); const [modalVisible, handleModalVisible] = useState(false); - - const getTabIndex = ():number=>{ - for(let i=0;i({}); + const [code, setCode] = useState(sql); useEffect( () => () => { - provider.dispose(); - }, - [] - ); + reloadCompletion(); + }, [code]); useImperativeHandle(editorInstance, () => ({ handleSetEditorVal, - getEditorData: () => cache.current, + getEditorData: () => code, })); const handleSetEditorVal = (value: string): void => { @@ -82,23 +72,34 @@ const FlinkSqlEditor = (props:any) => { } }; - const onChangeHandle = (val: string, event: { changes: { text: any }[] }) => { - let sqlMetaData = parseSqlMetaData(val); - props.saveMetaData(sqlMetaData,tabs,tabIndex); + const onChangeHandle = (val: string, event: any) => { + setCode(val); onChange(val,event); - /*const curWord = event.changes[0].text; - if (curWord === ';') { - cache.current = val +'\r\n'; - setRefresh(!refresh); // 刷新页面 - return; - } - cache.current = val;*/ + /*let newSqlMetaData = parseSqlMetaData(val); + setMetaData(newSqlMetaData); + props.saveSqlMetaData(newSqlMetaData,tabsKey);*/ props.saveSql(val); }; + const reloadCompletion = () =>{ + let newSqlMetaData = parseSqlMetaData(code); + setMetaData({...newSqlMetaData}); + provider.dispose();// 清空提示项 + provider = monacoInstance.current.languages.registerCompletionItemProvider('sql', { + provideCompletionItems() { + return { + suggestions:buildSuggestions(), + }; + }, + // quickSuggestions: false, + // triggerCharacters: ['$', '.', '='], + }); + }; + const buildSuggestions = () => { let suggestions: ISuggestions[] = []; - tabs.panes[tabIndex].sqlMetaData?.metaData?.forEach((item:MetaData) => { + console.log(metaData); + metaData.metaData?.forEach((item: MetaData) => { suggestions.push({ label: item.table, kind: _monaco.languages.CompletionItemKind.Constant, @@ -141,9 +142,6 @@ const FlinkSqlEditor = (props:any) => { const editorDidMountHandle = (editor: any, monaco: any) => { monacoInstance.current = monaco; editorInstance.current = editor; - editor.addCommand(monaco.KeyMod.Alt|monaco.KeyCode.KEY_1,function (){ - props.saveText(tabs,tabIndex); - }) editor.addCommand(monaco.KeyMod.Alt|monaco.KeyCode.KEY_2,function (){ handleModalVisible(true); @@ -151,17 +149,9 @@ const FlinkSqlEditor = (props:any) => { editor.addCommand(monaco.KeyMod.Alt|monaco.KeyCode.KEY_3,function (){ editor.getAction(['editor.action.formatDocument'])._run(); }) - provider.dispose();// 清空提示项 - // 提示项设值 - provider = monaco.languages.registerCompletionItemProvider('sql', { - provideCompletionItems() { - return { - suggestions:buildSuggestions(), - }; - }, - // quickSuggestions: false, - // triggerCharacters: ['$', '.', '='], - }); + + reloadCompletion(); + monaco.languages.registerDocumentRangeFormattingEditProvider('sql', { provideDocumentRangeFormattingEdits(model, range, options) { var formatted = format(model.getValueInRange(range), { @@ -181,11 +171,11 @@ const FlinkSqlEditor = (props:any) => { return ( { } const mapDispatchToProps = (dispatch:Dispatch)=>({ - saveText:(tabs:any,tabIndex:any)=>dispatch({ + /*saveText:(tabs:any,tabIndex:any)=>dispatch({ type: "Studio/saveTask", payload: tabs.panes[tabIndex].task, - }), - saveSql:(val:any)=>dispatch({ + }),*/ + saveSql:(val: any)=>dispatch({ type: "Studio/saveSql", payload: val, + }),saveSqlMetaData:(sqlMetaData: any,key: number)=>dispatch({ + type: "Studio/saveSqlMetaData", + payload: { + activeKey:key, + sqlMetaData, + isModified: true, + } }), - saveMetaData:(sqlMetaData:any,tabs:any,tabIndex:any)=>dispatch({ - type: "Studio/saveSqlMetaData", - payload: { - activeKey:tabs.panes[tabIndex].key, - sqlMetaData, - isModified: true, - } - }) }) -export default connect(({ Studio,Document }: { Studio: StateType,Document: DocumentStateType }) => ({ - current: Studio.current, - sql: Studio.sql, - tabs: Studio.tabs, - monaco: Studio.monaco, +export default connect(({ Document }: { Document: DocumentStateType }) => ({ fillDocuments: Document.fillDocuments, }),mapDispatchToProps)(FlinkSqlEditor); diff --git a/dlink-web/src/components/Studio/StudioEvent/data.d.ts b/dlink-web/src/components/Studio/StudioEvent/data.d.ts index c92dfc60ea..57fc012403 100644 --- a/dlink-web/src/components/Studio/StudioEvent/data.d.ts +++ b/dlink-web/src/components/Studio/StudioEvent/data.d.ts @@ -1,6 +1,6 @@ export type SqlMetaData = { - statement: string, - metaData: MetaData[], + statement?: string, + metaData?: MetaData[], }; export type MetaData = { table: string, diff --git a/dlink-web/src/components/Studio/StudioMenu/index.tsx b/dlink-web/src/components/Studio/StudioMenu/index.tsx index 826659a8d0..32fde94e65 100644 --- a/dlink-web/src/components/Studio/StudioMenu/index.tsx +++ b/dlink-web/src/components/Studio/StudioMenu/index.tsx @@ -35,11 +35,11 @@ const menu = ( const StudioMenu = (props: any) => { - const {tabs, current, currentPath, form,width,height, refs, dispatch, currentSession} = props; + const {isFullScreen, tabs, current, currentPath, form,width,height, refs, dispatch, currentSession} = props; const [modalVisible, handleModalVisible] = useState(false); const [exportModalVisible, handleExportModalVisible] = useState(false); const [graphModalVisible, handleGraphModalVisible] = useState(false); - const [editModalVisible, handleEditModalVisible] = useState(false); + // const [editModalVisible, handleEditModalVisible] = useState(false); const [graphData, setGraphData] = useState(); const onKeyDown = useCallback((e) => { @@ -52,7 +52,8 @@ const StudioMenu = (props: any) => { if(e.keyCode === 113){ e.preventDefault(); if(current) { - handleEditModalVisible(true); + // handleEditModalVisible(true); + props.changeFullScreen(true); } } }, [current]); @@ -463,16 +464,18 @@ const StudioMenu = (props: any) => { > :undefined} - {current? handleEditModalVisible(false)}> + onCancel={() => { + props.changeFullScreen(false); + }}> :undefined} @@ -487,10 +490,14 @@ const mapDispatchToProps = (dispatch: Dispatch)=>({ }),saveTabs:(tabs: any)=>dispatch({ type: "Studio/saveTabs", payload: tabs, + }),changeFullScreen:(isFull: boolean)=>dispatch({ + type: "Studio/changeFullScreen", + payload: isFull, }), }); export default connect(({Studio}: { Studio: StateType }) => ({ + isFullScreen: Studio.isFullScreen, current: Studio.current, currentPath: Studio.currentPath, tabs: Studio.tabs, diff --git a/dlink-web/src/components/Studio/StudioTabs/index.tsx b/dlink-web/src/components/Studio/StudioTabs/index.tsx index 24337c9ddb..e00eaa8c3e 100644 --- a/dlink-web/src/components/Studio/StudioTabs/index.tsx +++ b/dlink-web/src/components/Studio/StudioTabs/index.tsx @@ -6,33 +6,23 @@ import styles from './index.less'; import StudioEdit from '../StudioEdit'; import {DIALECT} from '../conf'; import StudioHome from "@/components/Studio/StudioHome"; +import {Dispatch} from "@@/plugin-dva/connect"; const {TabPane} = Tabs; const EditorTabs = (props: any) => { - const {tabs, dispatch, current, toolHeight, width,height} = props; + const {tabs, current, toolHeight, width,height} = props; const onChange = (activeKey: any) => { - dispatch && - dispatch({ - type: 'Studio/saveToolHeight', - payload: toolHeight - 0.0001, - }); - dispatch({ - type: 'Studio/changeActiveKey', - payload: activeKey, - }); + props.saveToolHeight(toolHeight); + props.changeActiveKey(activeKey); }; const onEdit = (targetKey: any, action: any) => { if (action === 'add') { add(); } else if (action === 'remove') { - dispatch && - dispatch({ - type: 'Studio/saveToolHeight', - payload: toolHeight - 0.0001, - }); + props.saveToolHeight(toolHeight-0.0001); // if (current.isModified) { // saveTask(current, dispatch); // } @@ -61,23 +51,11 @@ const EditorTabs = (props: any) => { newActiveKey = newPanes[0].key; } } - dispatch({ - type: 'Studio/saveTabs', - payload: { - activeKey: newActiveKey, - panes: newPanes, - }, - }); + props.saveTabs(newPanes,newActiveKey); }; const handleClickMenu = (e: any, current) => { - dispatch({ - type: 'Studio/closeTabs', - payload: { - deleteType: e.key, - current - }, - }); + props.closeTabs(current,e.key); }; const menu = (pane) => ( @@ -118,10 +96,13 @@ const EditorTabs = (props: any) => { className={styles['edit-tabs']} style={{height: height?height:toolHeight}} > - {tabs.panes.map((pane) => ( + {tabs.panes.map((pane,i) => ( { ); }; +const mapDispatchToProps = (dispatch: Dispatch)=>({ + closeTabs:(current: any,key: string)=>dispatch({ + type: 'Studio/closeTabs', + payload: { + deleteType: key, + current + }, + }),saveTabs:(newPanes: any,newActiveKey: number)=>dispatch({ + type: 'Studio/saveTabs', + payload: { + activeKey: newActiveKey, + panes: newPanes, + }, + }),saveToolHeight:(toolHeight: number)=>dispatch({ + type: 'Studio/saveToolHeight', + payload: toolHeight - 0.0001, + }),changeActiveKey:(activeKey: number)=>dispatch({ + type: 'Studio/changeActiveKey', + payload: activeKey, + }), +}) + export default connect(({Studio}: { Studio: StateType }) => ({ current: Studio.current, sql: Studio.sql, tabs: Studio.tabs, toolHeight: Studio.toolHeight, -}))(EditorTabs); +}),mapDispatchToProps)(EditorTabs); diff --git a/dlink-web/src/components/Studio/index.tsx b/dlink-web/src/components/Studio/index.tsx index 6af4ba917b..7d74c747ce 100644 --- a/dlink-web/src/components/Studio/index.tsx +++ b/dlink-web/src/components/Studio/index.tsx @@ -20,7 +20,7 @@ import DraggleVerticalLayout from "@/components/DraggleLayout/DraggleVerticalLay const Studio = (props: any) => { - const {rightClickMenu, toolHeight, toolLeftWidth,toolRightWidth,dispatch} = props; + const {isFullScreen,rightClickMenu, toolHeight, toolLeftWidth,toolRightWidth,dispatch} = props; const [form] = Form.useForm(); const VIEW = { leftToolWidth: 300, @@ -134,7 +134,7 @@ const Studio = (props: any) => { }}/> - + {!isFullScreen?:undefined} @@ -155,6 +155,7 @@ const Studio = (props: any) => { }; export default connect(({Studio}: { Studio: StateType }) => ({ + isFullScreen: Studio.isFullScreen, rightClickMenu: Studio.rightClickMenu, toolHeight: Studio.toolHeight, toolLeftWidth: Studio.toolLeftWidth, diff --git a/dlink-web/src/pages/FlinkSqlStudio/model.ts b/dlink-web/src/pages/FlinkSqlStudio/model.ts index a346336dd6..87da9c4ffc 100644 --- a/dlink-web/src/pages/FlinkSqlStudio/model.ts +++ b/dlink-web/src/pages/FlinkSqlStudio/model.ts @@ -136,6 +136,7 @@ export type SessionType = { } export type StateType = { + isFullScreen: boolean; toolHeight?: number; toolRightWidth?: number; toolLeftWidth?: number; @@ -147,7 +148,7 @@ export type StateType = { currentSession?: SessionType; current?: TabsItemType; sql?: string; - monaco?: any; + // monaco?: any; currentPath?: string[]; tabs?: TabsType; session?: SessionType[]; @@ -165,12 +166,13 @@ export type ModelType = { saveTask: Effect; }; reducers: { + changeFullScreen: Reducer; saveToolHeight: Reducer; saveToolRightWidth: Reducer; saveToolLeftWidth: Reducer; saveSql: Reducer; saveCurrentPath: Reducer; - saveMonaco: Reducer; + // saveMonaco: Reducer; saveSqlMetaData: Reducer; saveTabs: Reducer; closeTabs: Reducer; @@ -193,6 +195,7 @@ export type ModelType = { const Model: ModelType = { namespace: 'Studio', state: { + isFullScreen: false, toolHeight: 400, toolRightWidth: 300, toolLeftWidth: 300, @@ -206,7 +209,7 @@ const Model: ModelType = { }, current: undefined, sql: '', - monaco: {}, + // monaco: {}, currentPath: ['引导页'], tabs: { activeKey: 0, @@ -233,6 +236,12 @@ const Model: ModelType = { }, reducers: { + changeFullScreen(state, {payload}) { + return { + ...state, + isFullScreen: payload, + }; + }, saveToolHeight(state, {payload}) { return { ...state, @@ -250,19 +259,19 @@ const Model: ModelType = { }; }, saveSql(state, {payload}) { - const {tabs} = state; + const newTabs = state.tabs; const newCurrent = state.current; newCurrent.value = payload; - for (let i = 0; i < tabs.panes.length; i++) { - if (tabs.panes[i].key == tabs.activeKey) { - tabs.panes[i].value = payload; - tabs.panes[i].task && (tabs.panes[i].task.statement = payload); + for (let i = 0; i < newTabs.panes.length; i++) { + if (newTabs.panes[i].key == newTabs.activeKey) { + newTabs.panes[i].value = payload; + newTabs.panes[i].task && (newTabs.panes[i].task.statement = payload); } } return { ...state, - current: newCurrent, - tabs, + current: {...newCurrent}, + tabs:{...newTabs}, }; }, saveCurrentPath(state, {payload}) { @@ -271,32 +280,30 @@ const Model: ModelType = { currentPath: payload, }; }, - saveMonaco(state, {payload}) { + /*saveMonaco(state, {payload}) { return { ...state, - monaco: { - ...payload - }, + monaco:payload, }; - }, + },*/ saveSqlMetaData(state, {payload}) { const newCurrent = state.current; const newTabs = state.tabs; if(newCurrent.key == payload.activeKey){ - newCurrent.sqlMetaData = payload.sqlMetaData; + newCurrent.sqlMetaData = {...payload.sqlMetaData}; newCurrent.isModified = payload.isModified; } for (let i = 0; i < newTabs.panes.length; i++) { if (newTabs.panes[i].key == payload.activeKey) { - newTabs.panes[i].sqlMetaData = payload.sqlMetaData; + newTabs.panes[i].sqlMetaData = {...payload.sqlMetaData}; newTabs.panes[i].isModified = payload.isModified; break; } } return { ...state, - current: newCurrent, - tabs: newTabs, + current: {...newCurrent}, + tabs: {...newTabs}, }; }, saveTabs(state, {payload}) { @@ -320,7 +327,7 @@ const Model: ModelType = { ...newCurrent, isModified:false, }, - tabs: payload, + tabs: {...payload}, currentPath: newCurrent.path, }; }, @@ -341,8 +348,8 @@ const Model: ModelType = { } return { ...state, - current: newCurrent, - tabs: newTabs, + current: {...newCurrent}, + tabs: {...newTabs}, }; }, closeTabs(state, {payload}) { @@ -362,23 +369,23 @@ const Model: ModelType = { return { ...state, - current: newCurrent, - tabs: newTabs + current: {...newCurrent}, + tabs: {...newTabs} }; }, changeActiveKey(state, {payload}) { - const newTabs = state.tabs; - let newCurrent = state.current; - newTabs.activeKey = payload; + const newTabs = state?.tabs; + let newCurrent = state?.current; for (let i = 0; i < newTabs.panes.length; i++) { if (newTabs.panes[i].key == payload) { + newTabs.activeKey = payload; newCurrent = newTabs.panes[i]; } } return { ...state, - current: newCurrent, - tabs: newTabs, + current: {...newCurrent}, + tabs: {...newTabs}, currentPath: newCurrent.path, }; }, @@ -396,14 +403,14 @@ const Model: ModelType = { } return { ...state, - current: newCurrent, - tabs: newTabs, + current: {...newCurrent}, + tabs: {...newTabs}, }; }, saveSession(state, {payload}) { return { ...state, - session: payload, + session: [...payload], }; }, showRightClickMenu(state, {payload}) { @@ -431,44 +438,46 @@ const Model: ModelType = { }, saveResult(state, {payload}) { const newTabs = state?.tabs; - let newCurrent = state?.current; + const newCurrent = state?.current; for (let i = 0; i < newTabs.panes.length; i++) { - if (newTabs.panes[i].key == newTabs.activeKey) { - newTabs.panes[i].console.result.result = payload; - newCurrent = newTabs.panes[i]; + if (newTabs.panes[i].key == payload.key) { + newTabs.panes[i].console.result.result = payload.datas; + if(newCurrent.key == payload.key){ + newCurrent.console = newTabs.panes[i].console; + } break; } } return { ...state, - current: newCurrent, - tabs: newTabs, + current: {...newCurrent}, + tabs: {...newTabs}, }; }, saveCluster(state, {payload}) { return { ...state, - cluster: payload, + cluster: [...payload], }; },saveSessionCluster(state, {payload}) { return { ...state, - sessionCluster: payload, + sessionCluster: [...payload], }; },saveClusterConfiguration(state, {payload}) { return { ...state, - clusterConfiguration: payload, + clusterConfiguration: [...payload], }; },saveDataBase(state, {payload}) { return { ...state, - database: payload, + database: [...payload], }; },saveEnv(state, {payload}) { return { ...state, - env: payload, + env: [...payload], }; },saveChart(state, {payload}) { let newTabs = state?.tabs; @@ -482,8 +491,8 @@ const Model: ModelType = { } return { ...state, - current: newCurrent, - tabs: newTabs, + current: {...newCurrent}, + tabs: {...newTabs}, }; }, }, diff --git a/dlink-web/src/pages/Welcome.tsx b/dlink-web/src/pages/Welcome.tsx index 5cc2c30c0c..9a27ddc737 100644 --- a/dlink-web/src/pages/Welcome.tsx +++ b/dlink-web/src/pages/Welcome.tsx @@ -589,6 +589,27 @@ export default (): React.ReactNode => {
  • 新增 F2 全屏开发
  • +
  • + 升级 SpringBoot 至 2.6.3 +
  • +
  • + 优化 日志依赖 +
  • +
  • + 修复 前端 state 赋值 bug +
  • +
  • + 修复 异常预览内容溢出 bug +
  • +
  • + 修复 数据预览特殊条件下无法获取数据的 bug +
  • +
  • + 优化 SQL编辑器性能 +
  • +
  • + 修复 全屏开发退出后 sql 不同步 +
  • From 61199f157188bff0cc47ca0b289f4b64c4ec14fa Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Sun, 23 Jan 2022 18:01:32 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=8D=87=E7=BA=A7Flink1.14.3=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=90=E4=BA=A4=E4=BB=BB=E5=8A=A1=E7=BC=BA?= =?UTF-8?q?=E7=B1=BB=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dlink-client/dlink-client-1.14/pom.xml | 64 ++----------------- dlink-client/dlink-client-hadoop/pom.xml | 2 +- .../components/Studio/StudioHome/index.tsx | 1 - dlink-web/src/pages/Welcome.tsx | 6 ++ 4 files changed, 12 insertions(+), 61 deletions(-) diff --git a/dlink-client/dlink-client-1.14/pom.xml b/dlink-client/dlink-client-1.14/pom.xml index 66065d91e2..8485c411d6 100644 --- a/dlink-client/dlink-client-1.14/pom.xml +++ b/dlink-client/dlink-client-1.14/pom.xml @@ -13,7 +13,7 @@ 1.8 UTF-8 - 1.14.2 + 1.14.3 2.11 1.8 1.8 @@ -87,63 +87,9 @@ com.dlink dlink-common
    + + commons-cli + commons-cli + - \ No newline at end of file diff --git a/dlink-client/dlink-client-hadoop/pom.xml b/dlink-client/dlink-client-hadoop/pom.xml index 792f125d8b..d7ddf98a41 100644 --- a/dlink-client/dlink-client-hadoop/pom.xml +++ b/dlink-client/dlink-client-hadoop/pom.xml @@ -13,7 +13,7 @@ UTF-8 - 2.7.7 + 3.1.0 compile diff --git a/dlink-web/src/components/Studio/StudioHome/index.tsx b/dlink-web/src/components/Studio/StudioHome/index.tsx index 50bf6e4fa8..e5691306ac 100644 --- a/dlink-web/src/components/Studio/StudioHome/index.tsx +++ b/dlink-web/src/components/Studio/StudioHome/index.tsx @@ -19,7 +19,6 @@ const StudioHome = (props: any) => { 快捷键 Ctrl + s 保存 - Alt + 1 保存 Alt + 2 校验 Alt + 3 美化 F2 全屏 diff --git a/dlink-web/src/pages/Welcome.tsx b/dlink-web/src/pages/Welcome.tsx index 9a27ddc737..906f715a17 100644 --- a/dlink-web/src/pages/Welcome.tsx +++ b/dlink-web/src/pages/Welcome.tsx @@ -610,6 +610,12 @@ export default (): React.ReactNode => {
  • 修复 全屏开发退出后 sql 不同步
  • +
  • + 升级 Flink 1.14.2 到 1.14.3 +
  • +
  • + 修复 Flink 1.14 提交任务报错缺类 bug +
  • From edb23f49cb64e91b74c6f5dc7aa0299cc588f7a1 Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Sun, 23 Jan 2022 23:15:37 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9F=A5=E7=9C=8B=E5=8F=8A=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StudioConsole/StudioHistory/index.tsx | 49 ++++++++++++++----- .../components/Studio/StudioConsole/index.tsx | 26 ---------- .../components/Studio/StudioMenu/index.tsx | 15 +++++- .../Studio/StudioRightTool/index.tsx | 4 +- dlink-web/src/pages/Welcome.tsx | 5 +- dlink-web/src/pages/document.ejs | 11 ++--- 6 files changed, 60 insertions(+), 50 deletions(-) diff --git a/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx b/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx index a52912b988..206c1912a4 100644 --- a/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx +++ b/dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx @@ -39,19 +39,24 @@ type HistoryItem = { }; type HistoryConfig={ - useSession:boolean; - session:string; - useRemote:boolean; - clusterId:number; - host:string; - useResult:boolean; - maxRowNum:number; - taskId:number; - jobName:string; - useSqlFragment:boolean; - checkpoint:number; - parallelism:number; - savePointPath:string; + useSession: boolean; + session: string; + useRemote: boolean; + type: string; + clusterId: number; + clusterConfigurationId: number; + host: string; + useResult: boolean; + useChangeLog: boolean; + maxRowNum: number; + useAutoCancel: boolean; + taskId: number; + jobName: string; + useSqlFragment: boolean; + useStatementSet: boolean; + checkpoint: number; + parallelism: number; + savePointPath: string; }; const url = '/api/history'; @@ -289,15 +294,27 @@ const StudioHistory = (props: any) => { {config.useRemote?'远程':'本地'} + + {config.type} + {config.clusterId} + + {config.clusterConfigurationId} + {config.useResult?'启用':'禁用'} + + {config.useChangeLog?'启用':'禁用'} + {config.maxRowNum} + + {config.useAutoCancel?'启用':'禁用'} + {row.jobManagerAddress} @@ -310,12 +327,18 @@ const StudioHistory = (props: any) => { {config.useSqlFragment?'启用':'禁用'} + + {config.useStatementSet?'启用':'禁用'} + {config.parallelism} {config.checkpoint} + + {config.savePointStrategy} + {config.savePointPath} diff --git a/dlink-web/src/components/Studio/StudioConsole/index.tsx b/dlink-web/src/components/Studio/StudioConsole/index.tsx index 9fdded3474..b5513fda74 100644 --- a/dlink-web/src/components/Studio/StudioConsole/index.tsx +++ b/dlink-web/src/components/Studio/StudioConsole/index.tsx @@ -64,19 +64,6 @@ const StudioConsole = (props: any) => { {current? :} - - - 指标 - - } - key="StudioMetrics" - > - - - - @@ -129,19 +116,6 @@ const StudioConsole = (props: any) => { - - - 文档 - - } - key="StudioDocument" - > - - - - ); }; diff --git a/dlink-web/src/components/Studio/StudioMenu/index.tsx b/dlink-web/src/components/Studio/StudioMenu/index.tsx index 32fde94e65..1db4c52717 100644 --- a/dlink-web/src/components/Studio/StudioMenu/index.tsx +++ b/dlink-web/src/components/Studio/StudioMenu/index.tsx @@ -2,7 +2,7 @@ import styles from "./index.less"; import {Menu, Dropdown, Tooltip, Row, Col, Popconfirm, notification, Modal, message} from "antd"; import { PauseCircleTwoTone, CopyTwoTone, DeleteTwoTone, PlayCircleTwoTone, DiffTwoTone,SnippetsTwoTone, - FileAddTwoTone, FolderOpenTwoTone, SafetyCertificateTwoTone, SaveTwoTone, FlagTwoTone, + FileAddTwoTone, FolderOpenTwoTone, SafetyCertificateTwoTone, SaveTwoTone, FlagTwoTone,CodeTwoTone, EnvironmentOutlined, SmileOutlined, RocketTwoTone, QuestionCircleTwoTone, MessageOutlined, ClusterOutlined } from "@ant-design/icons"; import Space from "antd/es/space"; @@ -246,6 +246,12 @@ const StudioMenu = (props: any) => { return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];}); } + const toFullScreen = () => { + if(current) { + props.changeFullScreen(true); + } + }; + const saveSqlAndSettingToTask = () => { props.saveTask(current); }; @@ -336,6 +342,13 @@ const StudioMenu = (props: any) => { {current? + +
    - Ant Design + Dinky
    From fbd80e574babded94cb2dc0175df596c3a17bdb9 Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Mon, 24 Jan 2022 00:34:17 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E6=96=B0=E5=A2=9EK8S=E9=9B=86=E7=BE=A4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ClusterConfigurationServiceImpl.java | 24 ++++++++-- .../main/java/com/dlink/job/JobConfig.java | 24 ++++++++-- dlink-web/src/components/Studio/index.tsx | 1 + .../components/ClusterConfigurationForm.tsx | 48 ++++++++++++++++++- .../src/pages/ClusterConfiguration/conf.ts | 21 ++++++++ .../pages/ClusterConfiguration/function.ts | 46 +++++++++++++----- dlink-web/src/pages/Welcome.tsx | 5 +- 7 files changed, 148 insertions(+), 21 deletions(-) diff --git a/dlink-admin/src/main/java/com/dlink/service/impl/ClusterConfigurationServiceImpl.java b/dlink-admin/src/main/java/com/dlink/service/impl/ClusterConfigurationServiceImpl.java index 78b1e5e8dd..0ee1b5401e 100644 --- a/dlink-admin/src/main/java/com/dlink/service/impl/ClusterConfigurationServiceImpl.java +++ b/dlink-admin/src/main/java/com/dlink/service/impl/ClusterConfigurationServiceImpl.java @@ -52,14 +52,32 @@ public TestResult testGateway(ClusterConfiguration clusterConfiguration) { clusterConfiguration.parseConfig(); Map config = clusterConfiguration.getConfig(); GatewayConfig gatewayConfig = new GatewayConfig(); - gatewayConfig.setClusterConfig(ClusterConfig.build(config.get("flinkConfigPath").toString(), - config.get("flinkLibPath").toString(), - config.get("hadoopConfigPath").toString())); + if(config.containsKey("hadoopConfigPath")) { + gatewayConfig.setClusterConfig(ClusterConfig.build(config.get("flinkConfigPath").toString(), + config.get("flinkLibPath").toString(), + config.get("hadoopConfigPath").toString())); + }else { + gatewayConfig.setClusterConfig(ClusterConfig.build(config.get("flinkConfigPath").toString(), + config.get("flinkLibPath").toString(), + "")); + } if(config.containsKey("flinkConfig")){ gatewayConfig.setFlinkConfig(FlinkConfig.build((Map)config.get("flinkConfig"))); } if(Asserts.isEqualsIgnoreCase(clusterConfiguration.getType(),"Yarn")){ gatewayConfig.setType(GatewayType.YARN_PER_JOB); + }else if(Asserts.isEqualsIgnoreCase(clusterConfiguration.getType(),"Kubernetes")){ + gatewayConfig.setType(GatewayType.KUBERNETES_APPLICATION); + Map kubernetesConfig = (Map) config.get("kubernetesConfig"); + if(kubernetesConfig.containsKey("kubernetes.namespace")) { + gatewayConfig.getFlinkConfig().getConfiguration().put("kubernetes.namespace", kubernetesConfig.get("kubernetes.namespace").toString()); + } + if(kubernetesConfig.containsKey("kubernetes.cluster-id")) { + gatewayConfig.getFlinkConfig().getConfiguration().put("kubernetes.cluster-id", kubernetesConfig.get("kubernetes.cluster-id").toString()); + } + if(kubernetesConfig.containsKey("kubernetes.container.image")) { + gatewayConfig.getFlinkConfig().getConfiguration().put("kubernetes.container.image", kubernetesConfig.get("kubernetes.container.image").toString()); + } } return JobManager.testGateway(gatewayConfig); } diff --git a/dlink-core/src/main/java/com/dlink/job/JobConfig.java b/dlink-core/src/main/java/com/dlink/job/JobConfig.java index 7bd03fa710..5edf1e64ca 100644 --- a/dlink-core/src/main/java/com/dlink/job/JobConfig.java +++ b/dlink-core/src/main/java/com/dlink/job/JobConfig.java @@ -159,9 +159,15 @@ public void setSessionConfig(SessionConfig sessionConfig){ public void buildGatewayConfig(Map config){ gatewayConfig = new GatewayConfig(); - gatewayConfig.setClusterConfig(ClusterConfig.build(config.get("flinkConfigPath").toString(), - config.get("flinkLibPath").toString(), - config.get("hadoopConfigPath").toString())); + if(config.containsKey("hadoopConfigPath")) { + gatewayConfig.setClusterConfig(ClusterConfig.build(config.get("flinkConfigPath").toString(), + config.get("flinkLibPath").toString(), + config.get("hadoopConfigPath").toString())); + }else { + gatewayConfig.setClusterConfig(ClusterConfig.build(config.get("flinkConfigPath").toString(), + config.get("flinkLibPath").toString(), + "")); + } AppConfig appConfig = new AppConfig(); if(config.containsKey("userJarPath") && Asserts.isNotNullString((String) config.get("userJarPath"))){ appConfig.setUserJarPath(config.get("userJarPath").toString()); @@ -176,6 +182,18 @@ public void buildGatewayConfig(Map config){ if(config.containsKey("flinkConfig") && Asserts.isNotNullMap((Map) config.get("flinkConfig"))){ gatewayConfig.setFlinkConfig(FlinkConfig.build((Map)config.get("flinkConfig"))); } + if(config.containsKey("kubernetesConfig")){ + Map kubernetesConfig = (Map) config.get("kubernetesConfig"); + if(kubernetesConfig.containsKey("kubernetes.namespace")) { + gatewayConfig.getFlinkConfig().getConfiguration().put("kubernetes.namespace", kubernetesConfig.get("kubernetes.namespace").toString()); + } + if(kubernetesConfig.containsKey("kubernetes.cluster-id")) { + gatewayConfig.getFlinkConfig().getConfiguration().put("kubernetes.cluster-id", kubernetesConfig.get("kubernetes.cluster-id").toString()); + } + if(kubernetesConfig.containsKey("kubernetes.container.image")) { + gatewayConfig.getFlinkConfig().getConfiguration().put("kubernetes.container.image", kubernetesConfig.get("kubernetes.container.image").toString()); + } + } } public void addGatewayConfig(List> configList){ diff --git a/dlink-web/src/components/Studio/index.tsx b/dlink-web/src/components/Studio/index.tsx index 7d74c747ce..c1946eb546 100644 --- a/dlink-web/src/components/Studio/index.tsx +++ b/dlink-web/src/components/Studio/index.tsx @@ -60,6 +60,7 @@ const Studio = (props: any) => { listSession(dispatch); showJars(dispatch); showEnv(dispatch); + onResize(); }, []); const onClick = () => { diff --git a/dlink-web/src/pages/ClusterConfiguration/components/ClusterConfigurationForm.tsx b/dlink-web/src/pages/ClusterConfiguration/components/ClusterConfigurationForm.tsx index 6af4e6710e..52058ecb7f 100644 --- a/dlink-web/src/pages/ClusterConfiguration/components/ClusterConfigurationForm.tsx +++ b/dlink-web/src/pages/ClusterConfiguration/components/ClusterConfigurationForm.tsx @@ -3,7 +3,7 @@ import {Form, Button, Input, Modal, Select,Divider,Space,Switch} from 'antd'; import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'; import type {ClusterConfigurationTableListItem} from "@/pages/ClusterConfiguration/data"; import {getConfig, getConfigFormValues} from "@/pages/ClusterConfiguration/function"; -import {FLINK_CONFIG_LIST, HADOOP_CONFIG_LIST} from "@/pages/ClusterConfiguration/conf"; +import {FLINK_CONFIG_LIST, HADOOP_CONFIG_LIST, KUBERNETES_CONFIG_LIST} from "@/pages/ClusterConfiguration/conf"; import type {Config} from "@/pages/ClusterConfiguration/conf"; import {testClusterConfigurationConnect} from "@/pages/ClusterConfiguration/service"; @@ -39,6 +39,10 @@ const ClusterConfigurationForm: React.FC = (props modalVisible, } = props; + const onValuesChange = (change: any, all: any) => { + setFormVals({...formVals,...change}); + }; + const buildConfig = (config: Config[]) =>{ const itemList: JSX.Element[] = []; config.forEach(configItem => { @@ -79,6 +83,7 @@ const ClusterConfigurationForm: React.FC = (props + {formValsPara.type=='Yarn'?<> Hadoop 配置 = (props )} - + :undefined} + {formValsPara.type=='Kubernetes'?<> + Kubernetes 配置 + {buildConfig(KUBERNETES_CONFIG_LIST)} + + + {(fields, { add, remove }) => ( + <> + {fields.map(({ key, name, fieldKey, ...restField }) => ( + + + + + + + + remove(name)} /> + + ))} + + + + + )} + + + :undefined} Flink 配置 = (props {...formLayout} form={form} initialValues={getConfigFormValues(formVals)} + onValuesChange={onValuesChange} > {renderContent(formVals)} diff --git a/dlink-web/src/pages/ClusterConfiguration/conf.ts b/dlink-web/src/pages/ClusterConfiguration/conf.ts index 0d32dbdef2..b86709c1a6 100644 --- a/dlink-web/src/pages/ClusterConfiguration/conf.ts +++ b/dlink-web/src/pages/ClusterConfiguration/conf.ts @@ -9,6 +9,19 @@ export const HADOOP_CONFIG_LIST: Config[] = [{ lable: 'ha.zookeeper.quorum', placeholder: '192.168.123.1:2181,192.168.123.2:2181,192.168.123.3:2181', }]; +export const KUBERNETES_CONFIG_LIST: Config[] = [{ + name: 'kubernetes.namespace', + lable: 'kubernetes.namespace', + placeholder: 'dlink', +},{ + name: 'kubernetes.cluster-id', + lable: 'kubernetes.cluster-id', + placeholder: 'dlink', +},{ + name: 'kubernetes.container.image', + lable: 'kubernetes.container.image', + placeholder: 'dlink', +}]; export const FLINK_CONFIG_LIST: Config[] = [{ name: 'jobmanager.memory.process.size', lable: 'jobmanager.memory.process.size', @@ -44,6 +57,14 @@ export function HADOOP_CONFIG_NAME_LIST () { return list; } +export function KUBERNETES_CONFIG_NAME_LIST () { + const list: string[] = []; + KUBERNETES_CONFIG_LIST.forEach(item => { + list.push(item.name); + }); + return list; +} + export function FLINK_CONFIG_NAME_LIST() { const list: string[] = []; FLINK_CONFIG_LIST.forEach(item => { diff --git a/dlink-web/src/pages/ClusterConfiguration/function.ts b/dlink-web/src/pages/ClusterConfiguration/function.ts index 89533efed0..af6c1f6c71 100644 --- a/dlink-web/src/pages/ClusterConfiguration/function.ts +++ b/dlink-web/src/pages/ClusterConfiguration/function.ts @@ -1,17 +1,32 @@ -import {FLINK_CONFIG_NAME_LIST, HADOOP_CONFIG_NAME_LIST} from "@/pages/ClusterConfiguration/conf"; +import { + FLINK_CONFIG_NAME_LIST, + HADOOP_CONFIG_NAME_LIST, + KUBERNETES_CONFIG_NAME_LIST +} from "@/pages/ClusterConfiguration/conf"; export function getConfig(values:any) { - let hadoopConfig = addValueToMap(values,HADOOP_CONFIG_NAME_LIST()); - addListToMap(values.hadoopConfigList,hadoopConfig); let flinkConfig = addValueToMap(values,FLINK_CONFIG_NAME_LIST()); addListToMap(values.flinkConfigList,flinkConfig); - return { - hadoopConfigPath:values.hadoopConfigPath, - flinkLibPath:values.flinkLibPath, - flinkConfigPath:values.flinkConfigPath, - hadoopConfig:hadoopConfig, - flinkConfig:flinkConfig, - }; + if(values.type=='Yarn') { + let hadoopConfig = addValueToMap(values, HADOOP_CONFIG_NAME_LIST()); + addListToMap(values.hadoopConfigList, hadoopConfig); + return { + hadoopConfigPath:values.hadoopConfigPath, + flinkLibPath:values.flinkLibPath, + flinkConfigPath:values.flinkConfigPath, + hadoopConfig, + flinkConfig, + }; + }else if(values.type=='Kubernetes') { + let kubernetesConfig = addValueToMap(values, KUBERNETES_CONFIG_NAME_LIST()); + addListToMap(values.kubernetesConfigList, kubernetesConfig); + return { + flinkLibPath:values.flinkLibPath, + flinkConfigPath:values.flinkConfigPath, + kubernetesConfig, + flinkConfig, + }; + } } type ConfigItem = { @@ -27,6 +42,9 @@ function addListToMap(list:[ConfigItem],config:{}){ function addValueToMap(values:{},keys: string []){ let config = {}; + if(!values){ + return config; + } for(let i in keys){ config[keys[i]]=values[keys[i]]; } @@ -53,16 +71,20 @@ export function getConfigFormValues(values:any) { 'flinkConfigPath', ]); let hadoopConfig = addValueToMap(config.hadoopConfig,HADOOP_CONFIG_NAME_LIST()); + let kubernetesConfig = addValueToMap(config.kubernetesConfig,KUBERNETES_CONFIG_NAME_LIST()); let flinkConfig = addValueToMap(config.flinkConfig,FLINK_CONFIG_NAME_LIST()); let hadoopConfigList = addMapToList(config.hadoopConfig,HADOOP_CONFIG_NAME_LIST()); + let kubernetesConfigList = addMapToList(config.kubernetesConfig,KUBERNETES_CONFIG_NAME_LIST()); let flinkConfigList = addMapToList(config.flinkConfig,FLINK_CONFIG_NAME_LIST()); return { ...formValues, ...configValues, ...hadoopConfig, - hadoopConfigList:hadoopConfigList, + ...kubernetesConfig, + hadoopConfigList, + kubernetesConfigList, ...flinkConfig, - flinkConfigList:flinkConfigList + flinkConfigList } } diff --git a/dlink-web/src/pages/Welcome.tsx b/dlink-web/src/pages/Welcome.tsx index 444d67f36c..7e23786f95 100644 --- a/dlink-web/src/pages/Welcome.tsx +++ b/dlink-web/src/pages/Welcome.tsx @@ -564,7 +564,7 @@ export default (): React.ReactNode => { - 0.5.1 2022-01-23 + 0.5.1 2022-01-??

      @@ -619,6 +619,9 @@ export default (): React.ReactNode => {
    • 优化 作业配置查看及全屏开发按钮
    • +
    • + 新增 K8S集群配置 +
    From 39ef72f1e799623eb2ea7391c82a9ff650922d0f Mon Sep 17 00:00:00 2001 From: wenmo <32723967+wenmo@users.noreply.github.com> Date: Mon, 24 Jan 2022 18:43:06 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dlink-admin/pom.xml | 4 ++-- dlink-client/dlink-client-1.14/pom.xml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlink-admin/pom.xml b/dlink-admin/pom.xml index f0b23e3e7b..eacf4d017f 100644 --- a/dlink-admin/pom.xml +++ b/dlink-admin/pom.xml @@ -121,11 +121,11 @@ com.dlink dlink-gateway - +