From c3dc7734174a7d117a9e42d4533bd095fc911539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Wed, 26 Apr 2023 11:42:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-94752=E3=80=90=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=20fix:=E4=BF=AE=E5=A4=8D=E8=A7=86=E8=A7=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/setting/setting.ts | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/modules/pages/setting/setting.ts b/src/modules/pages/setting/setting.ts index 29d3166..e46f471 100644 --- a/src/modules/pages/setting/setting.ts +++ b/src/modules/pages/setting/setting.ts @@ -47,17 +47,20 @@ export class TimeOutSetting extends BI.Widget { vgap: 10, items: [ { - type: 'bi.vertical_adapt', - hgap: 16, - cls: 'bi-border-bottom', - height: 32, - items: [{ - type: 'bi.label', - textAlign: 'left', - width: 120, - cls: 'dec-font-weight-bold', - text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'), - }] + el: { + type: 'bi.vertical_adapt', + hgap: 16, + cls: 'bi-border-bottom', + height: 40, + items: [{ + type: 'bi.label', + textAlign: 'left', + width: 120, + cls: 'dec-font-weight-bold', + text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'), + }], + } + ,tgap: -10, }, { type: 'bi.vertical_adapt', @@ -84,7 +87,7 @@ export class TimeOutSetting extends BI.Widget { lgap: 10, }] - }, + }, ] }], ref: function (_ref) { @@ -92,4 +95,4 @@ export class TimeOutSetting extends BI.Widget { }, }; } -} \ No newline at end of file +} From 4dd665d539daeb5abd5cfd8c0c3cd58d721fbcd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=AD=E6=97=AD?= Date: Tue, 11 Jul 2023 15:21:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-96835=20=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5JDBC=5FURL=E8=A7=A3=E6=9E=90=E9=94=99=E8=AF=AF=20fix?= =?UTF-8?q?=EF=BC=9A=E8=A7=A3=E6=9E=90=E5=87=BA=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?database?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.provider.ts | 41 ++++++++++++++++++++++++++-- src/modules/pages/setting/setting.ts | 4 +-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/modules/app.provider.ts b/src/modules/app.provider.ts index 6ce5bce..846d138 100644 --- a/src/modules/app.provider.ts +++ b/src/modules/app.provider.ts @@ -4,9 +4,39 @@ import { DATA_BASE_TYPES } from '@constants/constant'; BI.provider('dec.connection.provider.datebase', function () { this.resolves = {}; + function starRocksResolve(url: string) { + // 处理starRocks数据连接常规模式 + const result = url.match(/^jdbc:mysql:\/\/([0-9a-zA-Z_\\.-]+):([0-9a-zA-Z_\\.-]+)\/([0-9a-zA-Z_\\.-]+)\.([^]+)(.*)/i); + if (result) { + return { + host: result[1], + port: result[2] === 'port' ? '' : result[2], + databaseName: result[4] || '', + urlInfo: result[0], + }; + } + // 处理starRocks数据连接负载均衡模式 + const loadBalance = url.match(/^jdbc:mysql:loadbalance:\/\/[^/]+\/([^/]+)\.([^/]+)/i); + if (loadBalance){ + const database: string = loadBalance[2]; + return { + host: '', + port: '', + databaseName: database, + urlInfo: loadBalance[0], + } + } + return { + host: '', + port: '', + databaseName: '', + urlInfo: '', + }; + } // 原service中resolveUrlInfo方法 function jdbcResolve(url: string) { if (BI.isNull(url)) return {}; + const oracleUlr = url.match(/^jdbc:(oracle):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/)([^]+)(.*)/i); if (oracleUlr) { return { @@ -60,7 +90,6 @@ BI.provider('dec.connection.provider.datebase', function () { urlInfo: '', }; } - return { host: '', port: '', @@ -92,7 +121,6 @@ BI.provider('dec.connection.provider.datebase', function () { ...config, type: 'jdbc', }; - BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve); if (coverBaseDatabase(config)) return; @@ -101,7 +129,14 @@ BI.provider('dec.connection.provider.datebase', function () { }; this.$get = () => BI.inherit(BI.OB, { - getJdbcResolveByType: (type: string) => this.resolves[type] || jdbcResolve, + getJdbcResolveByType: (type: string) => { + // starRocks特殊处理 + // todo: 后面有专门的迭代系统处理,这里先临时解决下bug + if (type === "starrocks"){ + return starRocksResolve + } + return this.resolves[type] || jdbcResolve + }, customDatabaseType: BI.Constants.getConstant(CONSTANT_PLUGIN_TYPES), }); }); diff --git a/src/modules/pages/setting/setting.ts b/src/modules/pages/setting/setting.ts index d196730..d788cb5 100644 --- a/src/modules/pages/setting/setting.ts +++ b/src/modules/pages/setting/setting.ts @@ -47,7 +47,7 @@ export class TimeOutSetting extends BI.Widget { vgap: 10, items: [ { - el:{ + el: { type: 'bi.vertical_adapt', cls: 'bi-border-bottom', height: 40, @@ -58,7 +58,7 @@ export class TimeOutSetting extends BI.Widget { cls: 'dec-font-weight-bold', text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'), }] - }, tgap: -10, hgap: 16, + }, tgap: -10, hgap: 16, }, { type: 'bi.vertical_adapt',