From b6e8c2c0769524629eaae454274956d9b4c32eba Mon Sep 17 00:00:00 2001 From: qiucong Date: Fri, 6 Nov 2020 14:15:48 +0800 Subject: [PATCH] =?UTF-8?q?DEC-15759=20&=20DEC-15764=20=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=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); }