Compare commits

..

36 Commits

Author SHA1 Message Date
Hans-杨瀚 439b8bc8ad Pull request #9647: REPORT-126948 合并WebSocket的namespace和event FBP部分 4 months ago
hans f4140b1035 REPORT-126948 合并WebSocket的namespace和event FBP部分 数据结构调整 4 months ago
Hans-杨瀚 50b9a9a181 Pull request #9644: REPORT-126948 合并WebSocket的namespace和event FBP部分 4 months ago
hans 564c5ac01c REPORT-126948 合并WebSocket的namespace和event FBP部分 数据结构调整 4 months ago
hans 626c712ce6 REPORT-126948 合并WebSocket的namespace和event FBP部分 4 months ago
superman b65b5d17ee Merge pull request #9594 in DEC/decision-webui-dcm from research/fbp-1.0 to research/mss-2.0 5 months ago
superman 8d5549c908 Merge pull request #9388 in DEC/decision-webui-dcm from research/mss-2.0 to research/fbp-1.0 6 months ago
superman 0127ccfc6e Merge pull request #9387 in DEC/decision-webui-dcm from research/11.0 to research/mss-2.0 6 months ago
superman 1967092641 Merge pull request #9385 in DEC/decision-webui-dcm from research/mss-2.0 to research/11.0 6 months ago
superman 3a2ad47cb6 Merge pull request #9311 in DEC/decision-webui-dcm from research/mss-2.0 to research/fbp-1.0 6 months ago
superman f86b5ec86f Merge pull request #9310 in DEC/decision-webui-dcm from research/11.0 to research/mss-2.0 6 months ago
superman 9518f7aa5a Merge pull request #9309 in DEC/decision-webui-dcm from research/mss-2.0 to research/11.0 6 months ago
superman b0eed777e6 Merge pull request #9164 in DEC/decision-webui-dcm from research/mss-2.0 to research/fbp-1.0 7 months ago
superman c58b16497d Merge pull request #9161 in DEC/decision-webui-dcm from research/fbp-1.0 to research/mss-2.0 7 months ago
Austin.Duan-段嗣跃 e89681f83c Pull request #9150: 无JIRA任务,解决冲突 7 months ago
Austin.Duan e331143a9f 无JIRA任务,解决冲突 7 months ago
superman 8bd01fdff6 Merge pull request #9147 in DEC/decision-webui-dcm from research/11.0 to research/mss-2.0 7 months ago
Austin.Duan-段嗣跃 2b5d1144f3 Pull request #9145: REPORT-114169 fix: 【多租户】新建数据连接输入框样式问题 7 months ago
Austin.Duan 008573646a REPORT-114169 fix: 【多租户】新建数据连接输入框样式问题 7 months ago
superman 570e6fd9d2 Merge pull request #9144 in DEC/decision-webui-dcm from research/mss-2.0 to research/11.0 7 months ago
superman 9c75596e56 Merge pull request #9125 in DEC/decision-webui-dcm from research/mss-2.0 to research/fbp-1.0 7 months ago
Austin.Duan-段嗣跃 7a0c99f0ad Pull request #9123: REPORT-118414 fix: 【多租户】修复数据连接编辑异常问题 7 months ago
Austin.Duan 14ea780da8 REPORT-118414 fix: 【多租户】修复数据连接编辑异常问题 7 months ago
superman 8a84d4e1e0 Pull request #9094: 无jira任务, persist/11.0 合 research/fbp-1.0 8 months ago
Austin.Duan-段嗣跃 a50190eb1c Pull request #8996: KERNEL-15739 fix: 【服务拆分】数据连接补充下socket连接异常场景 8 months ago
Austin.Duan 1b8aa4e63a Merge branch 'research/11.0' of ssh://code.fineres.com:7999/~austin.duan/decision-webui-dcm into research/11.0 8 months ago
Austin.Duan 680c195084 KERNEL-15739 fix: 【服务拆分】数据连接补充下socket连接异常场景 8 months ago
Austin.Duan-段嗣跃 159428317b Pull request #8955: REPORT-116621 fix: 【服务拆分】数据连接消息结构适配 8 months ago
Austin.Duan db636f32ed Merge branch 'research/11.0' of ssh://code.fineres.com:7999/~austin.duan/decision-webui-dcm into research/11.0 8 months ago
Austin.Duan 70a96925b7 REPORT-116621 fix: 【服务拆分】数据连接消息结构适配 8 months ago
Austin.Duan-段嗣跃 babc7aafa1 Pull request #8944: REPORT-116621 fix: 【服务拆分】emit回调无法触发问题 8 months ago
Austin.Duan 4847988a92 REPORT-116621 fix: 【服务拆分】emit回调无法触发问题 8 months ago
Austin.Duan-段嗣跃 ba44e417e6 Pull request #8927: REPORT-115929 fix: 【服务拆分】数据连接适配通知中心 8 months ago
Austin.Duan c8aceb8349 REPORT-115929 fix: 【服务拆分】数据连接适配通知中心 8 months ago
Austin.Duan-段嗣跃 62064baa0f Pull request #8564: REPORT-110595 fix: socket相关内容加个容错 12 months ago
Austin.Duan 2d14eb0480 REPORT-110595 fix: 数据连接-删除数据连接失败 12 months ago
  1. 2
      assets/scripts/dec.js
  2. 10
      src/modules/constants/env.ts
  3. 6
      src/modules/crud/api.ts
  4. 53
      src/modules/crud/decision.api.ts
  5. 9
      src/modules/pages/maintain/maintain.ts
  6. 4
      types/globals.d.ts

2
assets/scripts/dec.js

@ -16,6 +16,8 @@ window.DecCst = {
EditStatusEvent: {
OPEN: 'getConnectionStatus',
SHUTDOWN: 'shutdownConnectionStatus',
CONNECTION_EDITED: 'connectionEdited',
CONNECTION_RELEASED: 'connectionReleased',
}
},
Hyperlink: {

10
src/modules/constants/env.ts

@ -9,10 +9,12 @@ export const connectionType: {
JNDI: string;
} = DecCst.Connect.ConnectionType;
export const editStatusEvent: {
OPEN: string;
SHUTDOWN: string;
} = DecCst.Connect.EditStatusEvent;
export const editStatusEvent = {
OPEN: 'getConnectionStatus',
SHUTDOWN: 'shutdownConnectionStatus',
CONNECTION_EDITED: 'connectionEdited',
CONNECTION_RELEASED: 'connectionReleased',
};
export const errorCode: {
CONNECTION_DELETED: string;

6
src/modules/crud/api.ts

@ -75,6 +75,12 @@ export interface Api {
*/
getConnectionStatus(name: string): Promise<SocketResult>;
/**
*
* @param name
*/
setEditedConnectionStatus(name: string): void;
/**
*
* @param name

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

@ -50,7 +50,7 @@ export class DecisionApi implements Api {
/**
*
* @returns
* @returns
*/
getDriverLoadPath(data: Connection): Promise<ResultType<string>> {
const form = {
@ -82,11 +82,19 @@ export class DecisionApi implements Api {
}
getConnectionStatus(name: string): Promise<SocketResult> {
return this.sendEditStatusEvent(name, editStatusEvent.OPEN)
.then(re => {
if (re.errorCode) {
// TODO: 当前emit同步回调已无法执行
this.sendEditStatusEvent(name, editStatusEvent.OPEN);
if (!Dec.socket?.connected) {
return Promise.resolve({ data: 'success' });
}
return new Promise((resolve, rejected) => {
this.addEventListener(editStatusEvent.OPEN, data => {
if (data.errorCode) {
let errorMessage = '';
switch (re.errorCode) {
switch (data.errorCode) {
case errorCode.CONNECTION_DELETED:
errorMessage = 'Dec-Dcm_Connection_Deleted';
break;
@ -94,29 +102,30 @@ export class DecisionApi implements Api {
errorMessage = 'Dec-Dcm_Connection_Is_Using';
break;
default:
errorMessage = re.errorMsg;
errorMessage = data.errorMessage;
break;
}
BI.Msg.toast(BI.i18nText(errorMessage, re.errorMsg), {
BI.Msg.toast(BI.i18nText(errorMessage, data.errorMessage), {
level: 'error',
});
throw re;
rejected(data);
} else {
return re;
resolve(data);
}
});
});
}
setEditedConnectionStatus(name: string): Promise<SocketResult> {
return this.sendEditStatusEvent(name, editStatusEvent.CONNECTION_EDITED);
}
shutdownConnectionStatus(name: string): Promise<SocketResult> {
return this.sendEditStatusEvent(name, editStatusEvent.SHUTDOWN);
return this.sendEditStatusEvent(name, editStatusEvent.CONNECTION_RELEASED);
}
getSocketStatus(): boolean {
if (Dec) {
return Dec.socket.connected;
}
return false;
return !!Dec?.socket?.connected;
}
isDriverError(errorCode: string) {
@ -164,8 +173,8 @@ export class DecisionApi implements Api {
private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> {
return new Promise(resolve => {
if (Dec && Dec.socket.connected) {
Dec.socketEmit(type, BI.encode(name), (re: any) => {
if (Dec?.socket?.connected) {
Dec.socket.emit(type, BI.encode(name), (re: any) => {
resolve(re);
});
} else {
@ -173,4 +182,14 @@ export class DecisionApi implements Api {
}
});
}
private addEventListener(name: string, callback: Function) {
if (!Dec.socket) return;
if (Dec.socket.hasListeners(name)) {
Dec.socket.removeListener(name);
}
Dec.socket.on(name, callback, false);
}
}

9
src/modules/pages/maintain/maintain.ts

@ -25,7 +25,7 @@ export class Maintain extends BI.Widget {
render() {
const { isEdit, databaseType } = this.getEditConnection();
const titleText = getTextByDatabaseType(databaseType);
return {
type: BI.VTapeLayout.xtype,
hgap: 16,
@ -81,11 +81,14 @@ export class Maintain extends BI.Widget {
});
this.socketTip.setVisible(true);
}
this.model.connectionSelectedOne
&& api.setEditedConnectionStatus(this.model.connectionSelectedOne.connectionName);
}
private renderItems() {
const { type } = this.getEditConnection();
return [{
type: MaintainForm.xtype,
connectionType: type,
@ -106,7 +109,7 @@ export class Maintain extends BI.Widget {
const connectionJDBC = this.model.connectionSelectedOne.connectionData as ConnectionJDBC;
databaseType = getJdbcDatabaseType(connectionJDBC.database, connectionJDBC.driver).databaseType;
}
return {
type: this.model.connectionSelectedOne.connectionType,
text: this.model.connectionSelectedOne.connectionName,

4
types/globals.d.ts vendored

@ -11,6 +11,10 @@ declare const Dec: {
fineServletURL: string;
socket: {
connected: boolean;
emit: Function;
on: Function;
hasListeners: Function;
removeListener: Function;
};
system: {};
personal: {

Loading…
Cancel
Save