Compare commits

..

86 Commits

Author SHA1 Message Date
superman aaf74b2767 Merge pull request #10611 in DEC/decision-webui-dcm from final/11.0 to persist/11.0 14 hours ago
superman d451a4220c Merge pull request #10534 in DEC/decision-webui-dcm from release/11.0 to final/11.0 1 week ago
superman 5c6beefd9e Merge pull request #10447 in DEC/decision-webui-dcm from bugfix/11.0 to release/11.0 3 weeks ago
superman 361c9f7f0a Merge pull request #10445 in DEC/decision-webui-dcm from feature/x to bugfix/11.0 3 weeks ago
superman 8c7ab94869 Merge pull request #10402 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 3 weeks ago
superman c50975313f Merge pull request #10401 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 3 weeks ago
superman a78871d7a5 Pull request #10391: 无jira任务, feature/x 合 release/11.0 4 weeks ago
superman 7d1f925661 Merge pull request #10352 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 4 weeks ago
superman e7026ff252 Merge pull request #10351 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 4 weeks ago
superman 0931c1db61 Merge pull request #10350 in DEC/decision-webui-dcm from final/11.0 to release/11.0 4 weeks ago
superman b782a7bf95 Merge pull request #10349 in DEC/decision-webui-dcm from persist/11.0 to final/11.0 4 weeks ago
superman 3d641f63ce Merge pull request #10342 in DEC/decision-webui-dcm from final/11.0 to persist/11.0 4 weeks ago
superman cf84f85db7 Merge pull request #10207 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 1 month ago
superman 99a8690f78 Merge pull request #10206 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 1 month ago
superman ff3aa42fac Merge pull request #10205 in DEC/decision-webui-dcm from final/11.0 to release/11.0 1 month ago
superman 2c7e4bdcbe Merge pull request #10199 in DEC/decision-webui-dcm from release/11.0 to final/11.0 1 month ago
superman 7125112e61 Merge pull request #10131 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 2 months ago
superman d162369b5e Merge pull request #10130 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 2 months ago
superman e3925580da Merge pull request #10129 in DEC/decision-webui-dcm from final/11.0 to release/11.0 2 months ago
superman aff9b028cd Merge pull request #10128 in DEC/decision-webui-dcm from persist/11.0 to final/11.0 2 months ago
superman 0a206cfd50 Merge pull request #10120 in DEC/decision-webui-dcm from bugfix/11.0 to release/11.0 2 months ago
superman a8a774e245 Pull request #10113: 无jira任务, feature/x 合 bugfix/11.0 2 months ago
superman 9614f7befa Merge pull request #9985 in DEC/decision-webui-dcm from final/11.0 to persist/11.0 3 months ago
superman ddf79abf67 Pull request #9744: 无jira任务, bugfix/11.0 合 feature/x 4 months ago
superman fae8c8b743 Merge pull request #9743 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 4 months ago
superman 95a142fb36 Merge pull request #9742 in DEC/decision-webui-dcm from final/11.0 to release/11.0 4 months ago
superman 5e74901dd0 Merge pull request #9741 in DEC/decision-webui-dcm from persist/11.0 to final/11.0 4 months ago
superman e38b579294 Merge pull request #9736 in DEC/decision-webui-dcm from final/11.0 to persist/11.0 4 months ago
superman fa47cec090 Merge pull request #9666 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 4 months ago
superman d3da23ed00 Merge pull request #9665 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 4 months ago
superman c99acd797b Merge pull request #9664 in DEC/decision-webui-dcm from final/11.0 to release/11.0 4 months ago
superman d8f36eff4a Merge pull request #9658 in DEC/decision-webui-dcm from release/11.0 to final/11.0 4 months ago
superman fb2842a94e Merge pull request #9641 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 4 months ago
superman 290a4c69d5 Merge pull request #9640 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 4 months ago
superman 76b699c197 Pull request #9631: 无jira任务, final/11.0 合 release/11.0 4 months ago
superman c2bce27ae6 Merge pull request #9630 in DEC/decision-webui-dcm from persist/11.0 to final/11.0 4 months ago
superman 6627357743 Merge pull request #9625 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 4 months ago
superman b066df6bd3 Merge pull request #9619 in DEC/decision-webui-dcm from bugfix/11.0 to release/11.0 5 months ago
superman 7f564a5d41 Merge pull request #9618 in DEC/decision-webui-dcm from feature/x to bugfix/11.0 5 months ago
superman a97abbc859 Merge pull request #9573 in DEC/decision-webui-dcm from final/11.0 to persist/11.0 5 months ago
superman 26dca18095 Merge pull request #9536 in DEC/decision-webui-dcm from release/11.0 to final/11.0 5 months ago
superman 997339a605 Merge pull request #9438 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 6 months ago
superman 902d026e3a Merge pull request #9437 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 6 months ago
superman 6160ca3c58 Merge pull request #9430 in DEC/decision-webui-dcm from bugfix/11.0 to release/11.0 6 months ago
superman f1c4b1a901 Merge pull request #9429 in DEC/decision-webui-dcm from feature/x to bugfix/11.0 6 months ago
superman 8a5983a808 Merge pull request #9386 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 6 months ago
superman 5ff9006436 Merge pull request #9376 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 6 months ago
superman 035b84a38e Merge pull request #9375 in DEC/decision-webui-dcm from final/11.0 to release/11.0 6 months ago
superman eeca4747fa Merge pull request #9374 in DEC/decision-webui-dcm from persist/11.0 to final/11.0 6 months ago
superman eccc736ea4 Merge pull request #9357 in DEC/decision-webui-dcm from final/11.0 to persist/11.0 6 months ago
superman f0d4110b8f Merge pull request #9343 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 6 months ago
superman 57f367d3aa Merge pull request #9304 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 6 months ago
superman 6b30b3bfb0 Merge pull request #9303 in DEC/decision-webui-dcm from final/11.0 to release/11.0 6 months ago
superman 18f979c949 Merge pull request #9297 in DEC/decision-webui-dcm from release/11.0 to final/11.0 6 months ago
superman 352753b9d2 Merge pull request #9228 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 7 months ago
superman 40e174a026 Merge pull request #9227 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 7 months ago
superman c86f19349c Pull request #9218: 无jira任务, final/11.0 合 release/11.0 7 months ago
superman 5d9c786518 Merge pull request #9217 in DEC/decision-webui-dcm from persist/11.0 to final/11.0 7 months ago
superman 02ecf42291 Merge pull request #9212 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 7 months ago
superman a674710088 Merge pull request #9211 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 7 months ago
superman 075ae092ee Merge pull request #9204 in DEC/decision-webui-dcm from bugfix/11.0 to release/11.0 7 months ago
superman c22217e22d Merge pull request #9203 in DEC/decision-webui-dcm from feature/x to bugfix/11.0 7 months ago
superman 6db3736016 Merge pull request #9109 in DEC/decision-webui-dcm from final/11.0 to persist/11.0 8 months ago
superman 7af9ee3416 Merge pull request #9053 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 8 months ago
superman 816138af57 Merge pull request #9052 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 8 months ago
superman 4e63da2f29 Merge pull request #9051 in DEC/decision-webui-dcm from final/11.0 to release/11.0 8 months ago
superman ae401046cf Merge pull request #9045 in DEC/decision-webui-dcm from release/11.0 to final/11.0 8 months ago
superman 2c44d7237b Merge pull request #8963 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 8 months ago
superman d99170420d Merge pull request #8962 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 8 months ago
superman 9c32107d5b Merge pull request #8954 in DEC/decision-webui-dcm from bugfix/11.0 to release/11.0 8 months ago
superman b5e1c42b82 Merge pull request #8953 in DEC/decision-webui-dcm from feature/x to bugfix/11.0 8 months ago
superman c64b818d3d Merge pull request #8869 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 9 months ago
superman 4aeb240a0b Merge pull request #8868 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 9 months ago
superman 102c82fc62 Merge pull request #8867 in DEC/decision-webui-dcm from final/11.0 to release/11.0 9 months ago
superman d151d15312 Merge pull request #8866 in DEC/decision-webui-dcm from persist/11.0 to final/11.0 9 months ago
superman 76b313752f Merge pull request #8850 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 9 months ago
superman 3bd58876a6 Merge pull request #8849 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 9 months ago
superman 4fcb12556b Merge pull request #8848 in DEC/decision-webui-dcm from final/11.0 to release/11.0 9 months ago
superman e76754f5b2 Merge pull request #8842 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 9 months ago
superman 6a6ff1c1a6 Merge pull request #8841 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 9 months ago
superman 3aee05d032 Merge pull request #8839 in DEC/decision-webui-dcm from final/11.0 to release/11.0 9 months ago
superman 4d35886a75 Merge pull request #8790 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 9 months ago
superman 0e8af1c8f2 Merge pull request #8789 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 9 months ago
superman 2da1fec841 Merge pull request #8788 in DEC/decision-webui-dcm from final/11.0 to release/11.0 9 months ago
superman aaa86e2fdd Merge pull request #8773 in DEC/decision-webui-dcm from bugfix/11.0 to feature/x 9 months ago
superman 90e9f66923 Merge pull request #8772 in DEC/decision-webui-dcm from release/11.0 to bugfix/11.0 9 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,8 +16,6 @@ window.DecCst = {
EditStatusEvent: { EditStatusEvent: {
OPEN: 'getConnectionStatus', OPEN: 'getConnectionStatus',
SHUTDOWN: 'shutdownConnectionStatus', SHUTDOWN: 'shutdownConnectionStatus',
CONNECTION_EDITED: 'connectionEdited',
CONNECTION_RELEASED: 'connectionReleased',
} }
}, },
Hyperlink: { Hyperlink: {

10
src/modules/constants/env.ts

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

6
src/modules/crud/api.ts

@ -75,12 +75,6 @@ export interface Api {
*/ */
getConnectionStatus(name: string): Promise<SocketResult>; getConnectionStatus(name: string): Promise<SocketResult>;
/**
*
* @param name
*/
setEditedConnectionStatus(name: string): void;
/** /**
* *
* @param name * @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>> { getDriverLoadPath(data: Connection): Promise<ResultType<string>> {
const form = { const form = {
@ -82,19 +82,11 @@ export class DecisionApi implements Api {
} }
getConnectionStatus(name: string): Promise<SocketResult> { getConnectionStatus(name: string): Promise<SocketResult> {
// TODO: 当前emit同步回调已无法执行 return this.sendEditStatusEvent(name, editStatusEvent.OPEN)
this.sendEditStatusEvent(name, editStatusEvent.OPEN); .then(re => {
if (re.errorCode) {
if (!Dec.socket?.connected) {
return Promise.resolve({ data: 'success' });
}
return new Promise((resolve, rejected) => {
this.addEventListener(editStatusEvent.OPEN, data => {
if (data.errorCode) {
let errorMessage = ''; let errorMessage = '';
switch (data.errorCode) { switch (re.errorCode) {
case errorCode.CONNECTION_DELETED: case errorCode.CONNECTION_DELETED:
errorMessage = 'Dec-Dcm_Connection_Deleted'; errorMessage = 'Dec-Dcm_Connection_Deleted';
break; break;
@ -102,30 +94,29 @@ export class DecisionApi implements Api {
errorMessage = 'Dec-Dcm_Connection_Is_Using'; errorMessage = 'Dec-Dcm_Connection_Is_Using';
break; break;
default: default:
errorMessage = data.errorMessage; errorMessage = re.errorMsg;
break; break;
} }
BI.Msg.toast(BI.i18nText(errorMessage, data.errorMessage), { BI.Msg.toast(BI.i18nText(errorMessage, re.errorMsg), {
level: 'error', level: 'error',
}); });
rejected(data); throw re;
} else { } else {
resolve(data); return re;
} }
}); });
});
}
setEditedConnectionStatus(name: string): Promise<SocketResult> {
return this.sendEditStatusEvent(name, editStatusEvent.CONNECTION_EDITED);
} }
shutdownConnectionStatus(name: string): Promise<SocketResult> { shutdownConnectionStatus(name: string): Promise<SocketResult> {
return this.sendEditStatusEvent(name, editStatusEvent.CONNECTION_RELEASED); return this.sendEditStatusEvent(name, editStatusEvent.SHUTDOWN);
} }
getSocketStatus(): boolean { getSocketStatus(): boolean {
return !!Dec?.socket?.connected; if (Dec) {
return Dec.socket.connected;
}
return false;
} }
isDriverError(errorCode: string) { isDriverError(errorCode: string) {
@ -173,8 +164,8 @@ export class DecisionApi implements Api {
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?.socket?.connected) { if (Dec && Dec.socket.connected) {
Dec.socket.emit(type, BI.encode(name), (re: any) => { Dec.socketEmit(type, BI.encode(name), (re: any) => {
resolve(re); resolve(re);
}); });
} else { } else {
@ -182,14 +173,4 @@ 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() { render() {
const { isEdit, databaseType } = this.getEditConnection(); const { isEdit, databaseType } = this.getEditConnection();
const titleText = getTextByDatabaseType(databaseType); const titleText = getTextByDatabaseType(databaseType);
return { return {
type: BI.VTapeLayout.xtype, type: BI.VTapeLayout.xtype,
hgap: 16, hgap: 16,
@ -81,14 +81,11 @@ export class Maintain extends BI.Widget {
}); });
this.socketTip.setVisible(true); this.socketTip.setVisible(true);
} }
this.model.connectionSelectedOne
&& api.setEditedConnectionStatus(this.model.connectionSelectedOne.connectionName);
} }
private renderItems() { private renderItems() {
const { type } = this.getEditConnection(); const { type } = this.getEditConnection();
return [{ return [{
type: MaintainForm.xtype, type: MaintainForm.xtype,
connectionType: type, connectionType: type,
@ -109,7 +106,7 @@ export class Maintain extends BI.Widget {
const connectionJDBC = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; const connectionJDBC = this.model.connectionSelectedOne.connectionData as ConnectionJDBC;
databaseType = getJdbcDatabaseType(connectionJDBC.database, connectionJDBC.driver).databaseType; databaseType = getJdbcDatabaseType(connectionJDBC.database, connectionJDBC.driver).databaseType;
} }
return { return {
type: this.model.connectionSelectedOne.connectionType, type: this.model.connectionSelectedOne.connectionType,
text: this.model.connectionSelectedOne.connectionName, text: this.model.connectionSelectedOne.connectionName,

4
types/globals.d.ts vendored

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

Loading…
Cancel
Save