Browse Source

Merge pull request #748 in DEC/decision-webui-dcm from final/10.0 to persist/10.0

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

12
assets/scripts/dec.js

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

3
i18n/zh_cn.properties

@ -302,4 +302,5 @@ BI-Basic_Quarter= 季度
BI-Basic_No_Select= 不选
BI-Basic_Now= 此刻
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
package.json

@ -72,4 +72,4 @@
"pre-push": "npm run eslint && npm run test"
}
}
}
}

1
private/i18n.ts

@ -302,4 +302,5 @@ export default {
'BI-Basic_Now': '此刻',
'Dec-Dcm_Connection_Analytic_DB': '阿里云AnalyticDB',
'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],
};
}
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) {
return {
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,
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',
databaseType: 'derby',
@ -340,7 +351,7 @@ export const DATA_BASE_TYPES = [
text: 'FusionInsight HD',
databaseType: 'hw-fusioninsight-hd',
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,
internal: true,
type: 'jdbc',

5
src/modules/crud/api.ts

@ -66,4 +66,9 @@ export interface Api {
*
*/
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);
}
getHyperlink(name: string) {
return Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][name];
}
private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> {
return new Promise(resolve => {
if (Dec && Dec.socket.connected) {

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

@ -71,4 +71,9 @@ export class DesignApi implements Api {
// 设计器加密方法
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 { MaintainModel, MaintainModelXtype } from './maintain.model';
import { MaintainFormXtype } from './forms/form';
import { LinkXtype } from 'src/modules/components/link_button/link';
import { PAGE_INDEX } from '@constants/constant';
import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create();
@ -48,6 +49,16 @@ export class Maintain extends BI.Widget {
text: titleText,
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'), {
level: 'warning',
});
this.socketTip.setVisible(true);
}
}

6
types/globals.d.ts vendored

@ -9,10 +9,14 @@ declare const Dec: {
fineServletURL: string;
socket: {
connected: boolean;
};
system: {
};
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;
reqPost: (url: string, data: any, callback: (re: any) => void) => void;
reqPut: (url: string, data: any, callback: (re: any) => void) => void;

Loading…
Cancel
Save