From a5ce8cc9d4dabf1761e09c1b6a8919b755e88bc1 Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 13 Oct 2021 10:09:13 +0800 Subject: [PATCH 1/7] =?UTF-8?q?DEC-20979=20feat:=20=E3=80=90BI=E9=85=8D?= =?UTF-8?q?=E5=90=88=E3=80=91=E9=80=82=E9=85=8Ddoris=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 5bb3778..cedc99f 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -561,6 +561,17 @@ export const DATA_BASE_TYPES = [ type: 'jdbc', hasSchema: false, kerberos: false, + }, { + text: 'Doris', + databaseType: 'doris', + driver: 'com.mysql.jdbc.Driver', + drivers: ['com.mysql.jdbc.Driver'], + url: 'jdbc:mysql://hostname:port/database', + commonly: false, + internal: true, + type: 'jdbc', + hasSchema: false, + kerberos: false, }, { text: 'Presto', databaseType: 'presto', From 351740976c3ef07497be3e142478eb52b8701497 Mon Sep 17 00:00:00 2001 From: dailer Date: Fri, 15 Oct 2021 10:10:25 +0800 Subject: [PATCH 2/7] =?UTF-8?q?Revert=20"DEC-20201=20feat:=20=E3=80=90?= =?UTF-8?q?=E8=BF=AD=E4=BB=A3=E3=80=91=E3=80=90=E9=A9=B1=E5=8A=A8=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=80=91=E5=B1=8F=E8=94=BD=E9=A9=B1=E5=8A=A8=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=85=A5=E5=8F=A3=E4=BB=A5=E5=8F=8A=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bff088b06b13bfe970041ee6667f32980d6855a7. --- src/modules/pages/connection/connection.ts | 2 +- .../driverselector/driverselector.ts | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/modules/pages/connection/connection.ts b/src/modules/pages/connection/connection.ts index f8d175c..90f5ba1 100644 --- a/src/modules/pages/connection/connection.ts +++ b/src/modules/pages/connection/connection.ts @@ -79,7 +79,7 @@ export class Connection extends BI.Widget { right: [ { type: 'dec.connection.driver.entry', - invisible: true, + invisible: !BI.Services.getService('dec.service.global').isAdmin(), from: '.dec-dcm', listeners: [ { diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.ts b/src/modules/pages/maintain/components/driverselector/driverselector.ts index ef6c351..896c157 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.ts @@ -30,14 +30,18 @@ export class DriverSelector extends BI.Widget { customDrivers: SearchTextValueCombo = null; + beforeRender(cb: Function) { + this.store.initDriverClassList(cb); + } + watch = { driverClassItems: items => { - // this.customDrivers.populate(items); - // this.customDrivers.setValue(this.model.customDriver.value); + this.customDrivers.populate(items); + this.customDrivers.setValue(this.model.customDriver.value); }, driverManageEntryVisible: b => { - this.driverManageEntry.setVisible(false); + this.driverManageEntry.setVisible(b); }, }; @@ -55,7 +59,6 @@ export class DriverSelector extends BI.Widget { type: BI.TextValueCombo.xtype, width: 86, value: this.model.selectedDriverType, - invisible: true, items: [ { text: BI.i18nText('Dec-Basic_Default'), @@ -95,7 +98,7 @@ export class DriverSelector extends BI.Widget { this.defaultDrivers = _ref; }, invisible: this.model.driverSource !== '', - width: 300, + width: 204, items: this.model.defaultDrivers, value: this.model.defaultDriver.driver, listeners: [ @@ -116,7 +119,7 @@ export class DriverSelector extends BI.Widget { ref: _ref => { this.customDrivers = _ref; }, - invisible: true, + invisible: this.model.driverSource === '', width: 204, watermark: BI.i18nText('Dec-Please_Input'), items: this.model.driverClassItems, @@ -146,7 +149,7 @@ export class DriverSelector extends BI.Widget { text: BI.i18nText('Dec-Dcm_Create_New_Driver'), }, from: '.dec-dcm', - invisible: true, + invisible: !this.model.driverManageEntryVisible, listeners: [ { eventName: 'EVENT_CLOSE', @@ -175,7 +178,7 @@ export class DriverSelector extends BI.Widget { getValue() { return { - // driverSource: this.model.driverSource, + driverSource: this.model.driverSource, driver: this.model.driverSource === '' ? this.model.defaultDriver.driver : this.model.customDriver.driver, }; } From 9e87e30f645e628bf39dce5e55f62f1a7de6e6de Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 20 Oct 2021 11:00:56 +0800 Subject: [PATCH 3/7] =?UTF-8?q?BI-95685=20fix:=20=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=93=BE=E6=8E=A5=E6=97=B6=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E9=87=8D=E5=BB=BA=20identity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/form.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/pages/maintain/forms/form.ts b/src/modules/pages/maintain/forms/form.ts index cb3b573..5cc3b2a 100644 --- a/src/modules/pages/maintain/forms/form.ts +++ b/src/modules/pages/maintain/forms/form.ts @@ -139,9 +139,12 @@ export class MaintainForm extends BI.Widget { this.isEdit = true; this.connectionName = this.model.connectionSelectedOne.connectionName; const connection = BI.clone(this.model.connectionSelectedOne); - const { database, driver } = connection.connectionData as ConnectionJDBC; - (connection.connectionData as ConnectionJDBC).database = getJdbcDatabaseType(database, driver).databaseType; - + connectionData = connection.connectionData as ConnectionJDBC; + const { database, driver } = connectionData; + connectionData.database = getJdbcDatabaseType(database, driver).databaseType; + if (this.model.isCopy) { + connectionData.identity = BI.UUID(); + } return connection; } From 29c53b976a1e006e40d55976f3548d9014ec5820 Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 16 Nov 2021 15:28:21 +0800 Subject: [PATCH 4/7] =?UTF-8?q?DEC-21469=20fix:=20=E3=80=90=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E3=80=91=E3=80=90=E9=A9=B1=E5=8A=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?v1.1=E3=80=91=E4=B8=A4=E4=B8=AA=E9=A9=B1=E5=8A=A8=E7=B1=BB?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=9A=84=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8=EF=BC=8C=E6=96=B0=E5=BB=BA=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E4=BF=9D=E5=AD=98=E5=90=8E=E4=BC=9A=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9C=80=E6=96=B0=E7=9A=84=E9=82=A3=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintain/components/driverselector/driverselector.model.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts index 384e4f4..382f439 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts @@ -67,7 +67,8 @@ export class DriverSelectorModel extends Model { this.model.customDriver.driver = driver; this.model.customDrivers.some(customDriver => { - if (customDriver.driverClass === driver) { + // DEC-21469 存在driver值相同但driver名不同的场景,因此要用拼接名判断 + if (`${customDriver.driverClass} (${customDriver.name})` === value) { this.model.driverSource = customDriver.name; this.model.customDriver.value = `${driver} (${customDriver.name})`; From b14563262d8d1c7ac4391a34588d4ea2fe21de41 Mon Sep 17 00:00:00 2001 From: dailer Date: Fri, 19 Nov 2021 16:06:48 +0800 Subject: [PATCH 5/7] =?UTF-8?q?DEC-21444=20feat:=20=E3=80=90BI=E9=85=8D?= =?UTF-8?q?=E5=90=88=E3=80=91=E8=BE=BE=E6=A2=A6=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index cedc99f..ed5784b 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -572,6 +572,17 @@ export const DATA_BASE_TYPES = [ type: 'jdbc', hasSchema: false, kerberos: false, + }, { + text: '达梦数据库', + databaseType: 'dm', + driver: 'dm.jdbc.driver.DmDriver', + drivers: ['dm.jdbc.driver.DmDriver'], + url: 'jdbc:dm://hostname:port', + commonly: false, + internal: true, + type: 'jdbc', + hasSchema: true, + kerberos: true, }, { text: 'Presto', databaseType: 'presto', From 67151ab586bbafde7ab72325a521c6fc1e544e91 Mon Sep 17 00:00:00 2001 From: dailer Date: Fri, 19 Nov 2021 16:13:41 +0800 Subject: [PATCH 6/7] =?UTF-8?q?DEC-21444=20feat:=20=E3=80=90BI=E9=85=8D?= =?UTF-8?q?=E5=90=88=E3=80=91=E8=BE=BE=E6=A2=A6=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index ed5784b..4becb61 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -573,7 +573,7 @@ export const DATA_BASE_TYPES = [ hasSchema: false, kerberos: false, }, { - text: '达梦数据库', + text: BI.i18nText('Dec-Dcm_Connection_Database_DM'), databaseType: 'dm', driver: 'dm.jdbc.driver.DmDriver', drivers: ['dm.jdbc.driver.DmDriver'], From f4f0a552b6b6ddfe221978cd4478397ae8b47cfa Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 22 Nov 2021 19:22:55 +0800 Subject: [PATCH 7/7] =?UTF-8?q?DEC-21535=20fix:=20=E3=80=90=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E3=80=91=E3=80=90=E8=BE=BE=E6=A2=A6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E9=80=82=E9=85=8D=E3=80=91=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E8=BE=93=E5=85=A5URL=EF=BC=8C=E5=AF=B9=E5=BA=94=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=B8=8D=E5=9B=9E=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.provider.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/app.provider.ts b/src/modules/app.provider.ts index af2db61..d36a9f8 100644 --- a/src/modules/app.provider.ts +++ b/src/modules/app.provider.ts @@ -15,7 +15,7 @@ BI.provider('dec.connection.provider.datebase', function() { urlInfo: oracleUlr[10], }; } - + const greenplumUrl = url.match(/^jdbc:(pivotal:greenplum):(thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;)([^]+)(.*)/i); if (greenplumUrl) { return { @@ -25,7 +25,7 @@ BI.provider('dec.connection.provider.datebase', function() { urlInfo: greenplumUrl[9], }; } - const result = url.match(/^jdbc:(mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i); + const result = url.match(/^jdbc:(mysql|sqlserver|db2|dm|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i); if (result) { return { host: result[5], @@ -34,13 +34,13 @@ BI.provider('dec.connection.provider.datebase', function() { urlInfo: result[10], }; } - + // 处理oracle的RAC方式 if (/^jdbc:oracle:thin:([0-9a-zA-Z/]*)?@\(DESCRIPTION/i.test(url)) { const host = url.match(/\(HOST\s*=\s*([0-9a-zA-Z_\\.-]+)\)/i); const port = url.match(/\(PORT\s*=\s*([0-9]+)\)/i); const databaseName = url.match(/\(SERVICE_NAME\s*=\s*([\s0-9a-zA-Z_\\.]+)\)/i); - + return { host: host ? host[1] : '', port: port && port[1] !== 'port' ? port[1] : '', @@ -48,7 +48,7 @@ BI.provider('dec.connection.provider.datebase', function() { urlInfo: '', }; } - + return { host: '', port: '', @@ -60,10 +60,10 @@ BI.provider('dec.connection.provider.datebase', function() { this.registerDatabaseType = (config: any) => { BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config)); }; - + this.registerJdbcDatabase = (config: any, resolve?: Function) => { BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, { ...config, type: 'jdbc' })); - + BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve); };