From 8158bc5a03e5f58349445106196d74172422e892 Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Wed, 10 Aug 2022 14:11:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-75699=20fix:=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E9=87=8D=E5=A4=8D=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/file_upload/file_upload.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/components/file_upload/file_upload.ts b/src/modules/components/file_upload/file_upload.ts index f81f622..9a6b406 100644 --- a/src/modules/components/file_upload/file_upload.ts +++ b/src/modules/components/file_upload/file_upload.ts @@ -326,5 +326,3 @@ export class FileUpload extends BI.Widget { this.store.setFileInfo(params); } } - -BI.shortcut("dec.dcm.components.file_upload", FileUpload); From 10098674456884dbf462cd67a1ac7eefefaa7835 Mon Sep 17 00:00:00 2001 From: "Kevin.King" Date: Sat, 13 Aug 2022 15:06:51 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-77480=20fix:SSRF=E6=BC=8F=E6=B4=9E?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/test_status/test_status.ts | 13 ++++++++++--- .../components/test_status/tip_icon/tip_fail.ts | 11 +++++++++-- src/modules/pages/maintain/forms/form.server.ts | 4 ++++ src/modules/pages/maintain/forms/form.ts | 10 ++++++++++ webpack/webpack.dev.js | 2 +- 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/modules/components/test_status/test_status.ts b/src/modules/components/test_status/test_status.ts index 0cfba82..96b32af 100644 --- a/src/modules/components/test_status/test_status.ts +++ b/src/modules/components/test_status/test_status.ts @@ -29,6 +29,7 @@ export class TestStatus extends BI.Widget { failDriverMessage: Label; driverLink: FloatLeftLayout; detail: VerticalLayout; + failMaskers:any; watch = { status: (status: string) => { @@ -38,7 +39,7 @@ export class TestStatus extends BI.Widget { render() { const { loadingCls, loadingText, successCls, successText, failCls, failText, retryText } = this.options; - + var self=this; return { type: BI.CenterAdaptLayout.xtype, cls: 'bi-z-index-mask', @@ -51,7 +52,7 @@ export class TestStatus extends BI.Widget { cls: 'bi-card', width: 450, height: 250, - single: true, + // single: true, showIndex: this.model.status, ref: (_ref: Tab) => { this.tab = _ref; @@ -70,6 +71,12 @@ export class TestStatus extends BI.Widget { tipCls: failCls, tipText: failText, retryText, + ref:(_ref:any)=>{ + self.failMaskers=_ref; + if(this.failMessage.getText()===''){ + this.failMaskers.populateFail(BI.i18nText("Dec-Connect-Failed"),false); + } + }, listeners: [ { eventName: TipFail.EVENT_RELOAD, @@ -168,7 +175,7 @@ export class TestStatus extends BI.Widget { this.store.setStatus(TEST_STATUS.SUCCESS); } - setFail(message: string, driver = '', link = '') { + setFail(message: string='', driver = '', link = '') { this.store.setStatus(TEST_STATUS.FAIL); this.failMessage.setText(message); this.failDriverMessage.setVisible(!!driver); diff --git a/src/modules/components/test_status/tip_icon/tip_fail.ts b/src/modules/components/test_status/tip_icon/tip_fail.ts index 05ef93f..f8a77f3 100644 --- a/src/modules/components/test_status/tip_icon/tip_fail.ts +++ b/src/modules/components/test_status/tip_icon/tip_fail.ts @@ -1,5 +1,5 @@ import { shortcut, store } from '@core/core'; -import { Button } from '@fui/core'; +import { Button, Label } from '@fui/core'; import { TipFailModel } from './tip_fail.model'; @shortcut() @@ -21,7 +21,7 @@ export class TipFail extends BI.Widget { store: TipFailModel['store']; detailButton: Button; - + failText:Label; watch = { isCollapse: (isCollapse: boolean) => { this.detailButton.setText(isCollapse ? @@ -29,6 +29,10 @@ export class TipFail extends BI.Widget { BI.i18nText('Dec-Dcm_Connection_Detailed_Information')); }, } + populateFail(text:string,isVisible:boolean){ + this.failText.setText(text); + this.detailButton.setVisible(isVisible); + } render() { const { tipCls, tipText, retryText } = this.options; @@ -53,6 +57,9 @@ export class TipFail extends BI.Widget { height: 14, bgap: 10, text: tipText, + ref:(_ref:Label)=>{ + this.failText=_ref; + } }, { type: BI.VerticalAdaptLayout.xtype, diff --git a/src/modules/pages/maintain/forms/form.server.ts b/src/modules/pages/maintain/forms/form.server.ts index d378768..67647fc 100644 --- a/src/modules/pages/maintain/forms/form.server.ts +++ b/src/modules/pages/maintain/forms/form.server.ts @@ -20,6 +20,10 @@ export function testConnection(value: Connection): Promise { const formValue = value; api.testConnection(formValue).then(re => { if (re && re.errorCode) { + if(re.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED){ + testStatus.setFail(); + return; + } // 判断是否是缺少驱动,如果缺少驱动则显示下载驱动的连接 if (api.isDriverError(re.errorCode)) { if (formValue.connectionType === connectionType.JDBC) { diff --git a/src/modules/pages/maintain/forms/form.ts b/src/modules/pages/maintain/forms/form.ts index 5cc3b2a..9ac3908 100644 --- a/src/modules/pages/maintain/forms/form.ts +++ b/src/modules/pages/maintain/forms/form.ts @@ -38,6 +38,11 @@ export class MaintainForm extends BI.Widget { value.creator = BI.get(this.getFormData(), 'creator'); this.store.updateConnection(this.connectionName, value).then(result => { if (result.errorCode) { + if(result.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED){ + BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"),{ + level: "error", + }); + } this.showError(result); return; @@ -253,6 +258,11 @@ export class MaintainForm extends BI.Widget { private addConnection(form: Connection) { this.store.addConnection(form).then(result => { if (result.errorCode) { + if(result.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED){ + BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"),{ + level: "error", + }); + } if (result.errorCode === errorCode.DUPLICATE_NAMES) { if (form.connectionType !== connectionType.JDBC && form.connectionType !== connectionType.JNDI) { // 如果不是jdbc或jndi,即如果是插件,名称重复的时候需要修改名字重新提交给后台 diff --git a/webpack/webpack.dev.js b/webpack/webpack.dev.js index 2d280f8..39912ca 100644 --- a/webpack/webpack.dev.js +++ b/webpack/webpack.dev.js @@ -36,7 +36,7 @@ chokidar module.exports = merge(common, { devtool: 'eval-source-map', entry: { - show: ['./src/i18n.ts', './src/request.ts', './src/index.ts'], + show: ['./src/i18n.ts', './src/request.ts', './src/modules/app.ts'], }, output: { path: dirs.DEST, From 50debb93e9bf850838668bad3ae5073f7729d1a8 Mon Sep 17 00:00:00 2001 From: "Kevin.King" Date: Sat, 13 Aug 2022 15:21:09 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-77480=20fix:SSRF=E6=BC=8F=E6=B4=9E?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/test_status/test_status.ts | 2 +- webpack/webpack.dev.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/components/test_status/test_status.ts b/src/modules/components/test_status/test_status.ts index 96b32af..8929f7d 100644 --- a/src/modules/components/test_status/test_status.ts +++ b/src/modules/components/test_status/test_status.ts @@ -74,7 +74,7 @@ export class TestStatus extends BI.Widget { ref:(_ref:any)=>{ self.failMaskers=_ref; if(this.failMessage.getText()===''){ - this.failMaskers.populateFail(BI.i18nText("Dec-Connect-Failed"),false); + this.failMaskers.populateFail(BI.i18nText("Dec-Conn-ect-Failed"),false); } }, listeners: [ diff --git a/webpack/webpack.dev.js b/webpack/webpack.dev.js index 39912ca..2d280f8 100644 --- a/webpack/webpack.dev.js +++ b/webpack/webpack.dev.js @@ -36,7 +36,7 @@ chokidar module.exports = merge(common, { devtool: 'eval-source-map', entry: { - show: ['./src/i18n.ts', './src/request.ts', './src/modules/app.ts'], + show: ['./src/i18n.ts', './src/request.ts', './src/index.ts'], }, output: { path: dirs.DEST, From 08c8df4012fbd86f11a2c68312eb60965c303c84 Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Mon, 15 Aug 2022 16:29:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?BI-108526=20BI-111537=20feat:=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0trino=20tdsql=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 4fabf64..1615dc6 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -692,6 +692,29 @@ export const DATA_BASE_TYPES = [ 'org.sqlite.JDBC': 'jdbc:sqlite:[PATH_TO_DB_FILES]', }, }, + { + text: 'trino', + databaseType: 'trino', + driver: 'io.trino.jdbc.TrinoDriver', + url: 'jdbc:trino://hostname:port/database', + commonly: false, + internal: true, + type: 'jdbc', + hasSchema: true, + kerberos: false, + }, + { + text: BI.i18nText('Dec-Dcm_Connection_TDSQL'), + databaseType: 'tdsql', + driver: 'org.postgresql.Driver', + url: 'jdbc:postgresql://hostname:port/database', + commonly: false, + internal: true, + type: 'jdbc', + hasSchema: true, + kerberos: false, + fetchSize: 10000, + } ];