Browse Source

Merge pull request #714 in DEC/decision-webui-dcm from release/10.0 to final/10.0

* commit 'af7a64c0f2d2bde2f774921cd23ac36e08e71f17':
  DEC-15287 fix: 【迭代】【数据连接】数据连接信息页面,没有主机ip和端口号
  DEC-14579 feat: 支持clickHouse数据库
  DEC-14856 fix: fusioninsight HD数据连接的默认值有问题
  DEC-14713 feat: 新增websocket连接失败文档链接
final/10.0 10.0.10.2020.10.15.final
superman 4 years ago
parent
commit
ab3dd86661
  1. 12
      assets/scripts/dec.js
  2. 1
      i18n/zh_cn.properties
  3. 1
      private/i18n.ts
  4. 2
      src/modules/app.service.ts
  5. 41
      src/modules/components/link_button/link.ts
  6. 13
      src/modules/constants/constant.ts
  7. 5
      src/modules/crud/api.ts
  8. 4
      src/modules/crud/decision.api.ts
  9. 5
      src/modules/crud/design.api.ts
  10. 12
      src/modules/pages/maintain/maintain.ts
  11. 4
      types/globals.d.ts

12
assets/scripts/dec.js

@ -16,6 +16,11 @@ window.DecCst = {
OPEN: 'getConnectionStatus', OPEN: 'getConnectionStatus',
SHUTDOWN: 'shutdownConnectionStatus', SHUTDOWN: 'shutdownConnectionStatus',
} }
},
Hyperlink: {
Database: {},
DECISION_HYPERLINK_CONFIG: "hyperlink",
WEBSOCKET_CONNECT: "websocket"
} }
}; };
@ -25,6 +30,11 @@ window.Dec = {
connected: false, connected: false,
}, },
personal: { personal: {
username: '' username: '',
},
system: {
hyperlink: {
websocket: "http://help.finebi.com/doc-view-183.html",
},
} }
} }

1
i18n/zh_cn.properties

@ -303,3 +303,4 @@ BI-Basic_No_Select= 不选
BI-Basic_Now= 此刻 BI-Basic_Now= 此刻
Dec-Dcm_Connection_Analytic_DB=阿里云AnalyticDB Dec-Dcm_Connection_Analytic_DB=阿里云AnalyticDB
Dec-Dcm_Connection_Value_Out_Range=数值超出范围 Dec-Dcm_Connection_Value_Out_Range=数值超出范围
Dec-Dcm_Socket_Unable_Connect_Tip=可能出现编辑冲突

1
private/i18n.ts

@ -302,4 +302,5 @@ export default {
'BI-Basic_Now': '此刻', 'BI-Basic_Now': '此刻',
'Dec-Dcm_Connection_Analytic_DB': '阿里云AnalyticDB', 'Dec-Dcm_Connection_Analytic_DB': '阿里云AnalyticDB',
'Dec-Dcm_Connection_Value_Out_Range': '数值超出范围', 'Dec-Dcm_Connection_Value_Out_Range': '数值超出范围',
'Dec-Dcm_Socket_Unable_Connect_Tip': '可能出现编辑冲突',
}; };

2
src/modules/app.service.ts

@ -68,7 +68,7 @@ export function resolveUrlInfo (url: string) {
urlInfo: greenplumUrl[9], urlInfo: greenplumUrl[9],
}; };
} }
const result = url.match(/^jdbc:(mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i); const result = url.match(/^jdbc:(mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i);
if (result) { if (result) {
return { return {
host: result[5], host: result[5],

41
src/modules/components/link_button/link.ts

@ -0,0 +1,41 @@
import { CenterAdapt, Label } from 'ui';
import { shortcut } from '@core/core';
export const LinkXtype = 'dec.dcm.components.link.button';
const DEFAULT_LINK = '/';
@shortcut(LinkXtype)
export class LinkButton extends BI.BasicButton {
props = {
text: '',
cls: 'cursor-pointer',
$testId: 'dec-dcm-link-button',
}
render() {
return {
type: CenterAdapt,
cls: 'bi-high-light',
items: [
{
type: Label,
cls: 'bi-high-light-border-bottom',
text: this.options.text,
},
],
};
}
getLink() {
const link = this.options.link;
return (BI.isFunction(link) ? link() : link) || DEFAULT_LINK;
}
setText(v: string) {
this.text.setText(v);
}
doClick() {
window.open(this.getLink());
}
}

13
src/modules/constants/constant.ts

@ -259,6 +259,17 @@ export const DATA_BASE_TYPES = [
hasSchema: true, hasSchema: true,
kerberos: true, kerberos: true,
}, },
{
text: 'ClickHouse',
databaseType: 'clickhouse',
driver: 'ru.yandex.clickhouse.ClickHouseDriver',
url: 'jdbc:clickhouse://hostname:port',
commonly: false,
internal: true,
type: 'jdbc',
hasSchema: true,
kerberos: false,
},
{ {
text: 'DERBY', text: 'DERBY',
databaseType: 'derby', databaseType: 'derby',
@ -340,7 +351,7 @@ export const DATA_BASE_TYPES = [
text: 'FusionInsight HD', text: 'FusionInsight HD',
databaseType: 'hw-fusioninsight-hd', databaseType: 'hw-fusioninsight-hd',
driver: 'org.apache.hive.jdbc.HiveDriver', driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://10.135.0.110:24002,10.135.0.67:24002,10.135.0.66:24002/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;sasl.qop=auth-conf;auth=KERBEROS;zk.principal=zookeeper/hadoop;principal=hive/hadoop.hadoop.com@HADOOP.COM;', url: 'jdbc:hive2://hostname1:port,hostname2:port,hostname3:port/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;sasl.qop=auth-conf;auth=KERBEROS;zk.principal=zookeeper/hadoop;principal=hive/hadoop.hadoop.com@HADOOP.COM;',
commonly: false, commonly: false,
internal: true, internal: true,
type: 'jdbc', type: 'jdbc',

5
src/modules/crud/api.ts

@ -66,4 +66,9 @@ export interface Api {
* *
*/ */
getCipher(password: string): string; getCipher(password: string): string;
/**
*
*/
getHyperlink(name: string): string;
} }

4
src/modules/crud/decision.api.ts

@ -97,6 +97,10 @@ export class DecisionApi implements Api {
return BI.Providers.getProvider('dec.provider.cipher').getCipher(password); return BI.Providers.getProvider('dec.provider.cipher').getCipher(password);
} }
getHyperlink(name: string) {
return Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][name];
}
private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> { private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> {
return new Promise(resolve => { return new Promise(resolve => {
if (Dec && Dec.socket.connected) { if (Dec && Dec.socket.connected) {

5
src/modules/crud/design.api.ts

@ -71,4 +71,9 @@ export class DesignApi implements Api {
// 设计器加密方法 // 设计器加密方法
return password; return password;
} }
getHyperlink(name: string) {
// 设计器获取超链
return '';
}
} }

12
src/modules/pages/maintain/maintain.ts

@ -2,6 +2,7 @@ import { Vtape, Label, VerticalAdapt, ListView, IconButton } from 'ui';
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { MaintainModel, MaintainModelXtype } from './maintain.model'; import { MaintainModel, MaintainModelXtype } from './maintain.model';
import { MaintainFormXtype } from './forms/form'; import { MaintainFormXtype } from './forms/form';
import { LinkXtype } from 'src/modules/components/link_button/link';
import { PAGE_INDEX } from '@constants/constant'; import { PAGE_INDEX } from '@constants/constant';
import { ApiFactory } from 'src/modules/crud/apiFactory'; import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create(); const api = new ApiFactory().create();
@ -48,6 +49,16 @@ export class Maintain extends BI.Widget {
text: titleText, text: titleText,
height: 15, height: 15,
}, },
{
type: LinkXtype,
invisible: true,
lgap: 10,
text: BI.i18nText('Dec-Dcm_Socket_Unable_Connect_Tip'),
link: api.getHyperlink(DecCst.Hyperlink.WEBSOCKET_CONNECT),
ref: (_ref: any) => {
this.socketTip = _ref;
},
},
], ],
}, },
{ {
@ -66,6 +77,7 @@ export class Maintain extends BI.Widget {
BI.Msg.toast(BI.i18nText('Dec-Dcm_Socket_Unable_Connect'), { BI.Msg.toast(BI.i18nText('Dec-Dcm_Socket_Unable_Connect'), {
level: 'warning', level: 'warning',
}); });
this.socketTip.setVisible(true);
} }
} }

4
types/globals.d.ts vendored

@ -9,10 +9,14 @@ declare const Dec: {
fineServletURL: string; fineServletURL: string;
socket: { socket: {
connected: boolean; connected: boolean;
};
system: {
}; };
personal: { personal: {
username: string; username: string;
}; };
socketEmit: (type: string, name: string, callback: (re: any) => void) => void;
reqGet: (url: string, data: any, callback: (re: any) => void) => void; reqGet: (url: string, data: any, callback: (re: any) => void) => void;
reqPost: (url: string, data: any, callback: (re: any) => void) => void; reqPost: (url: string, data: any, callback: (re: any) => void) => void;
reqPut: (url: string, data: any, callback: (re: any) => void) => void; reqPut: (url: string, data: any, callback: (re: any) => void) => void;

Loading…
Cancel
Save