Browse Source

Merge pull request #851 in DEC/decision-webui-dcm from bugfix/10.0 to feature/10.0

* commit '46bda9c2cd44d9e4d4b984f73085560b09bdd5cf':
  DEC-15759 & DEC-15764 帮助文档链接
  DEC-15747 feat: 【BI】ODPS数据库支持适配
research/11.0
superman 4 years ago
parent
commit
33166e24d4
  1. 6
      assets/scripts/dec.js
  2. 19
      src/modules/constants/constant.ts
  3. 4
      src/modules/pages/maintain/forms/form.server.ts

6
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",
},
}
}

19
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,
@ -464,6 +472,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:<maxcompute_endpoint>?project=<maxcompute_project_name>',
commonly: false,
internal: true,
type: 'jdbc',
hasSchema: true,
kerberos: false,
},
{
text: 'Oracle',
databaseType: 'oracle',

4
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<string[]> {
@ -31,7 +32,8 @@ export function testConnection(value: Connection): Promise<string[]> {
}
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);
}

Loading…
Cancel
Save