From aed9cbd4b5cbf65981e62e11213bf41bfc2a811b Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Wed, 19 Oct 2022 15:07:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?BI-115632=20fix:jdbcResolve=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=80=82=E9=85=8DSAPHANA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.provider.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/app.provider.ts b/src/modules/app.provider.ts index e888267..f3e9a60 100644 --- a/src/modules/app.provider.ts +++ b/src/modules/app.provider.ts @@ -35,6 +35,17 @@ BI.provider('dec.connection.provider.datebase', function() { }; } + // 处理SAP HANA数据连接url + const sapHanaUrl = url.match(/^jdbc:(sap):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?([^]+)?(.*)/i); + if (sapHanaUrl) { + return { + host: sapHanaUrl[5], + port: sapHanaUrl[7] === 'port' ? '' : sapHanaUrl[7], + databaseName: '', + urlInfo: sapHanaUrl[9], + }; + } + // 处理oracle的RAC方式 if (/^jdbc:oracle:thin:([0-9a-zA-Z/]*)?@\(DESCRIPTION/i.test(url)) { const host = url.match(/\(HOST\s*=\s*([0-9a-zA-Z_\\.-]+)\)/i); From 566b8b9ed64372dcfb32c68bc2e33a2ae79495e7 Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Mon, 24 Oct 2022 14:55:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-82479=20feat:=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E8=B6=85=E6=97=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/zh_cn.properties | 4 +- src/modules/app.ts | 24 +++++++ src/modules/crud/decision.api.ts | 8 +++ src/modules/pages/setting/setting.ts | 94 ++++++++++++++++++++++++++++ src/modules/title/title.ts | 8 +++ 5 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 src/modules/pages/setting/setting.ts diff --git a/i18n/zh_cn.properties b/i18n/zh_cn.properties index 3170f13..7e5e8a1 100644 --- a/i18n/zh_cn.properties +++ b/i18n/zh_cn.properties @@ -311,4 +311,6 @@ Dec-Dcm_Connection_Value_Out_Range=数值超出范围 Dec-Dcm_Socket_Unable_Connect_Tip=可能出现编辑冲突 Dec-Dcm_Connection_File_Upload_ErrorTip1= 参考 Dec-Dcm_Connection_File_Upload_ErrorTip2= kerberos配置 -Dec-Dcm_Connection_File_Upload_ErrorTip3= 获取帮助或联系技术支持 \ No newline at end of file +Dec-Dcm_Connection_File_Upload_ErrorTip3= 获取帮助或联系技术支持 +Dec-Dcm_Connection_Timeout_Detection=数据连接超时检测 +Dec-Dcm_Connection_Timeout_Millisecond=毫秒(ms) \ No newline at end of file diff --git a/src/modules/app.ts b/src/modules/app.ts index c347927..5155f5b 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -7,6 +7,7 @@ import { Tab } from '@fui/core'; import { Datebase } from './pages/database/database'; import { Maintain } from './pages/maintain/maintain'; import { ConnectionPool } from './pages/connection_pool/connection_pool'; +import { TimeOutSetting } from './pages/setting/setting'; import './app.provider'; import '../less/index.less'; @@ -38,6 +39,12 @@ export class App extends BI.Widget { el: { type: Title.xtype, cls: 'bi-border-bottom', + listeners: [{ + eventName: 'EVENT_CLICK_SETTING', + action:() => { + this._setting(); + }, + }] }, height: 40, }, @@ -84,4 +91,21 @@ export class App extends BI.Widget { ], }; } + + private _setting() { + const settingLayerId = BI.UUID(); + BI.Layers.create(settingLayerId, null, { + container: this, + render: { + type: TimeOutSetting.xtype, + listeners: [{ + eventName: "EVENT_CHANGE", + action: function () { + BI.Layers.remove(settingLayerId); + }, + }], + }, + }, this); + BI.Layers.show(settingLayerId); + } } diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index d399399..3ad6470 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -128,6 +128,14 @@ export class DecisionApi implements Api { return requestGet(`/principals?keytabPath=${keytab}`, {}); } + getTimeOut(): Promise<{ data?: any }> { + return requestGet('kdc/timeout', {}); + } + + putTimeOut(value: number) { + return requestPut(`kdc/timeout?timeout=${value}`, {}) + } + private sendEditStatusEvent(name: string, type: string): Promise { return new Promise(resolve => { if (Dec && Dec.socket.connected) { diff --git a/src/modules/pages/setting/setting.ts b/src/modules/pages/setting/setting.ts new file mode 100644 index 0000000..eaddc96 --- /dev/null +++ b/src/modules/pages/setting/setting.ts @@ -0,0 +1,94 @@ +import { shortcut } from '@core/core'; +import { ApiFactory } from 'src/modules/crud/apiFactory'; + +const api = new ApiFactory().create(); + +@shortcut() +export class TimeOutSetting extends BI.Widget { + public static xtype = 'dec.dcm.page.timeout.setting'; + + public props = { + value: 0, + }; + + beforeRender(cb: Function) { + const self = this; + api.getTimeOut().then(res => { + self.props.value = res.data.count; + cb(); + }); + } + + public render() { + const { value } = this.props; + const self = this; + + return { + type: 'bi.vtape', + cls: 'bi-background', + items: [{ + type: 'dec.setting.header', + height: 40, + listeners: [{ + eventName: 'EVENT_CANCEL', + action: function () { + self.fireEvent('EVENT_CHANGE'); + }, + }, { + eventName: 'EVENT_SAVE', + action: function () { + api.putTimeOut(Number(self.editor.getValue())); + self.fireEvent('EVENT_CHANGE'); + }, + }], + }, { + type: 'bi.vertical', + cls: 'bi-card', + hgap: 10, + vgap: 10, + items: [ + { + type: 'bi.vertical_adapt', + cls: 'bi-border-bottom', + height: 32, + items: [{ + type: 'bi.label', + textAlign: 'left', + width: 120, + cls: 'dec-font-weight-bold', + text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'), + }] + }, + { + type: 'bi.vertical_adapt', + items: [{ + type: 'dec.label.editor.item', + text: BI.i18nText('Dec-Over_Time'), + textWidth: 100, + editorWidth: 80, + allowBlank: false, + value: value, + validationChecker: function(v) { + return BI.isPositiveInteger(v); + }, + errorText: BI.i18nText('BI-Please_Input_Positive_Integer'), + ref: function (_ref) { + self.editor = _ref; + }, + }, { + el: { + type: 'bi.label', + text: BI.i18nText('Dec-Dcm_Connection_Timeout_Millisecond'), + }, + lgap: 10, + }] + + }, + ] + }], + ref: function (_ref) { + self.setting = _ref; + }, + }; + } +} \ No newline at end of file diff --git a/src/modules/title/title.ts b/src/modules/title/title.ts index dc85b0f..73d936b 100644 --- a/src/modules/title/title.ts +++ b/src/modules/title/title.ts @@ -31,6 +31,14 @@ export class Title extends BI.Widget { type: BI.LeftRightVerticalAdaptLayout.xtype, items: { left: [ + { + type: 'bi.icon_button', + cls: 'setting-font', + _lgap: 15, + handler: () => { + this.fireEvent('EVENT_CLICK_SETTING'); + }, + }, { type: BI.LinearSegment.xtype, cls: 'bi-font-bold', From d79323b53c190664ce040d1b9e2267b2ce83070b Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Fri, 4 Nov 2022 16:31:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-83276=20fix:=E4=BF=AE=E5=A4=8DFileUp?= =?UTF-8?q?load=E7=BB=84=E4=BB=B6errorInfo=E6=9C=AA=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/components/file_upload/file_upload.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/components/file_upload/file_upload.ts b/src/modules/components/file_upload/file_upload.ts index 9a6b406..01892c0 100644 --- a/src/modules/components/file_upload/file_upload.ts +++ b/src/modules/components/file_upload/file_upload.ts @@ -157,8 +157,6 @@ export class FileUpload extends BI.Widget { handler: function () { NProgress.set(0.0); self.xhr.abort(); - self.uploadButton.setEnable(true); - self.fileInfo.setVisible(false); self.store.setFileName(''); self.clearInfo(); self.fireEvent(FileUpload.EVENT_CLEAR_FILE); @@ -308,6 +306,7 @@ export class FileUpload extends BI.Widget { public clearInfo() { this.uploadButton.setEnable(true); this.fileInfo.setVisible(false); + this.errorInfo.setVisible(false); this.textEditor.setValue(''); this.options.attachId = ''; }