Browse Source

Merge pull request #850 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0

* commit '7b7cf0fa5e88fc2cc26f888113c241c2cc722865':
  DEC-15759 & DEC-15764 帮助文档链接
  DEC-15747 feat: 【BI】ODPS数据库支持适配
bugfix/10.0
superman 4 years ago
parent
commit
46bda9c2cd
  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_NOT_AVAILABLE: '21300014',
LOGIN_INFO_ERROR: '21300018', LOGIN_INFO_ERROR: '21300018',
TIMEOUT: '21300001', TIMEOUT: '21300001',
LACK_DRIVER: '22400037'
}, },
Connect: { Connect: {
ConnectionType: { ConnectionType: {
@ -18,7 +19,9 @@ window.DecCst = {
} }
}, },
Hyperlink: { Hyperlink: {
Database: {}, Database: {
ODPS: "odps"
},
DECISION_HYPERLINK_CONFIG: "hyperlink", DECISION_HYPERLINK_CONFIG: "hyperlink",
WEBSOCKET_CONNECT: "websocket" WEBSOCKET_CONNECT: "websocket"
} }
@ -35,6 +38,7 @@ window.Dec = {
system: { system: {
hyperlink: { hyperlink: {
websocket: "http://help.finebi.com/doc-view-183.html", 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', databaseType: 'derby',
link: DecCst.Hyperlink.Database.DERBY, link: DecCst.Hyperlink.Database.DERBY,
}, },
{
databaseType: 'clickhouse',
link: DecCst.Hyperlink.Database.CLICKHOUSE,
},
{ {
databaseType: 'gbase-8a', databaseType: 'gbase-8a',
link: DecCst.Hyperlink.Database.GBASE8A, link: DecCst.Hyperlink.Database.GBASE8A,
@ -123,6 +127,10 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [
databaseType: 'mysql', databaseType: 'mysql',
link: DecCst.Hyperlink.Database.MYSQL, link: DecCst.Hyperlink.Database.MYSQL,
}, },
{
databaseType: 'odps',
link: DecCst.Hyperlink.Database.ODPS,
},
{ {
databaseType: 'oracle', databaseType: 'oracle',
link: DecCst.Hyperlink.Database.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', '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', text: 'Oracle',
databaseType: '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 { connectionType, errorCode } from '@constants/env';
import { DATA_BASE_DRIVER_LINK, JDBC_ODBC_DRIVER, JDBC_ODBC_DRIVER_HELP_LINK } from '@constants/constant'; 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 { TestStatusXtype, EVENT_RELOAD, EVENT_CLOSE } from '../../../components/test_status/test_status';
import { getJdbcDatabaseType } from '../../../app.service';
import { ApiFactory } from '../../../crud/apiFactory'; import { ApiFactory } from '../../../crud/apiFactory';
const api = new ApiFactory().create(); const api = new ApiFactory().create();
export function testConnection(value: Connection): Promise<string[]> { 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 databaseType = (formValue.connectionData as ConnectionJDBC).database;
const databaseLink = BI.get(DATA_BASE_DRIVER_LINK.find(item => item.databaseType === databaseType), 'link'); 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 { } else {
testStatus.setFail(re.errorMsg); testStatus.setFail(re.errorMsg);
} }

Loading…
Cancel
Save