From aec03bf7d4ec2a720acf7f7d995f157feef39019 Mon Sep 17 00:00:00 2001 From: qiucong Date: Thu, 5 Nov 2020 16:48:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?DEC-15747=20feat:=20=E3=80=90BI=E3=80=91ODP?= =?UTF-8?q?S=E6=95=B0=E6=8D=AE=E5=BA=93=E6=94=AF=E6=8C=81=E9=80=82?= =?UTF-8?q?=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 c900d05..2ea20bd 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -464,6 +464,17 @@ export const DATA_BASE_TYPES = [ 'org.gjt.mm.mysql.Driver': 'jdbc:mysql://hostname:port/database', }, }, + { + text: 'ODPS', + databaseType: 'odps', + driver: 'com.aliyun.odps.jdbc.OdpsDriver', + url: 'jdbc:odps:?project=', + commonly: false, + internal: true, + type: 'jdbc', + hasSchema: true, + kerberos: false, + }, { text: 'Oracle', databaseType: 'oracle', From b6e8c2c0769524629eaae454274956d9b4c32eba Mon Sep 17 00:00:00 2001 From: qiucong Date: Fri, 6 Nov 2020 14:15:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?DEC-15759=20&=20DEC-15764=20=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9=E6=96=87=E6=A1=A3=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/scripts/dec.js | 6 +++++- src/modules/constants/constant.ts | 8 ++++++++ src/modules/pages/maintain/forms/form.server.ts | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/assets/scripts/dec.js b/assets/scripts/dec.js index 8757f3e..f33b0d6 100644 --- a/assets/scripts/dec.js +++ b/assets/scripts/dec.js @@ -6,6 +6,7 @@ window.DecCst = { LOGIN_INFO_NOT_AVAILABLE: '21300014', LOGIN_INFO_ERROR: '21300018', TIMEOUT: '21300001', + LACK_DRIVER: '22400037' }, Connect: { ConnectionType: { @@ -18,7 +19,9 @@ window.DecCst = { } }, Hyperlink: { - Database: {}, + Database: { + ODPS: "odps" + }, DECISION_HYPERLINK_CONFIG: "hyperlink", WEBSOCKET_CONNECT: "websocket" } @@ -35,6 +38,7 @@ window.Dec = { system: { hyperlink: { websocket: "http://help.finebi.com/doc-view-183.html", + odps: "http://help.finebi.com/doc-view-183.html", }, } } \ No newline at end of file diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 2ea20bd..96c93c1 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -55,6 +55,10 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [ databaseType: 'derby', link: DecCst.Hyperlink.Database.DERBY, }, + { + databaseType: 'clickhouse', + link: DecCst.Hyperlink.Database.CLICKHOUSE, + }, { databaseType: 'gbase-8a', link: DecCst.Hyperlink.Database.GBASE8A, @@ -123,6 +127,10 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [ databaseType: 'mysql', link: DecCst.Hyperlink.Database.MYSQL, }, + { + databaseType: 'odps', + link: DecCst.Hyperlink.Database.ODPS, + }, { databaseType: 'oracle', link: DecCst.Hyperlink.Database.ORACLE, diff --git a/src/modules/pages/maintain/forms/form.server.ts b/src/modules/pages/maintain/forms/form.server.ts index e144378..b97bd94 100644 --- a/src/modules/pages/maintain/forms/form.server.ts +++ b/src/modules/pages/maintain/forms/form.server.ts @@ -2,6 +2,7 @@ import { Connection, ConnectionJDBC } from '../../../crud/crud.typings'; import { connectionType, errorCode } from '@constants/env'; import { DATA_BASE_DRIVER_LINK, JDBC_ODBC_DRIVER, JDBC_ODBC_DRIVER_HELP_LINK } from '@constants/constant'; import { TestStatusXtype, EVENT_RELOAD, EVENT_CLOSE } from '../../../components/test_status/test_status'; +import { getJdbcDatabaseType } from '../../../app.service'; import { ApiFactory } from '../../../crud/apiFactory'; const api = new ApiFactory().create(); export function testConnection(value: Connection): Promise { @@ -31,7 +32,8 @@ export function testConnection(value: Connection): Promise { } const databaseType = (formValue.connectionData as ConnectionJDBC).database; const databaseLink = BI.get(DATA_BASE_DRIVER_LINK.find(item => item.databaseType === databaseType), 'link'); - testStatus.setFail(re.errorMsg, driver, Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][databaseLink]); + const link = Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][databaseLink] || BI.get(getJdbcDatabaseType(databaseType, driver), 'link'); + testStatus.setFail(re.errorMsg, driver, link); } else { testStatus.setFail(re.errorMsg); }