From 03ae058adc5d1d027d4aa2bde6cbf1ffcd9d5360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=8D=A3=E6=AD=86?= Date: Thu, 6 Feb 2020 14:50:07 +0800 Subject: [PATCH 1/8] =?UTF-8?q?DEC-11996=20feat:=20=E3=80=90=E5=8D=8E?= =?UTF-8?q?=E4=B8=BA=E5=AE=89=E5=85=A8=E3=80=91=E5=86=85=E5=AD=98=E7=AD=89?= =?UTF-8?q?=E6=95=8F=E6=84=9F=E4=BF=A1=E6=81=AF=E9=9C=80=E8=A6=81=E9=89=B4?= =?UTF-8?q?=E6=9D=83=E6=89=8D=E8=83=BD=E8=8E=B7=E5=BE=97,=E5=89=8D?= =?UTF-8?q?=E5=8F=B0websocket=E4=BA=8B=E4=BB=B6=E6=90=BA=E5=B8=A6token?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/decision.api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 55096b1..d046519 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -96,7 +96,7 @@ export class DecisionApi implements Api { private sendEditStatusEvent(name: string, type: string): Promise { return new Promise(resolve => { if (Dec && Dec.socket.connected) { - Dec.socket.emit(type, BI.encode(name), (re: any) => { + Dec.socketEmit(type, BI.encode(name), (re: any) => { resolve(re); }); } else { From 1c60639b44cfb779d6a9a1b1c2b0159feae06087 Mon Sep 17 00:00:00 2001 From: langwenda Date: Tue, 11 Feb 2020 14:56:35 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:=20DEC-12046=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=BF=90=E8=A1=8C=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + webpack/webpack.dev.js | 2 +- yarn.lock | 15 ++++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fe532bf..96d1011 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@babel/core": "7.4.5", "@babel/plugin-proposal-class-properties": "^7.5.0", "@babel/plugin-proposal-decorators": "7.4.4", + "@babel/polyfill": "^7.8.3", "@babel/preset-env": "7.4.5", "@babel/preset-typescript": "7.3.3", "@types/jest": "24.0.11", diff --git a/webpack/webpack.dev.js b/webpack/webpack.dev.js index d93e397..2c6e1ab 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: ['babel-polyfill', './src/i18n.ts', './src/request.ts', './src/index.ts'], }, output: { path: dirs.DEST, diff --git a/yarn.lock b/yarn.lock index bb642bb..e41649b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -606,10 +606,10 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.5.4" -"@babel/polyfill@7.4.4": - version "7.4.4" - resolved "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.4.4.tgz#78801cf3dbe657844eeabf31c1cae3828051e893" - integrity sha512-WlthFLfhQQhh+A2Gn5NSFl0Huxz36x86Jn+E9OW7ibK8edKPq+KLy4apM1yDpQ8kJOVi1OVjpP4vSDLdrI04dg== +"@babel/polyfill@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.8.3.tgz#2333fc2144a542a7c07da39502ceeeb3abe4debd" + integrity sha512-0QEgn2zkCzqGIkSWWAEmvxD7e00Nm9asTtQvi7HdlYvMhjy/J38V/1Y9ode0zEJeIuxAI0uftiAzqc7nVeWUGg== dependencies: core-js "^2.6.5" regenerator-runtime "^0.13.2" @@ -3054,11 +3054,16 @@ core-js-compat@^3.1.1: browserslist "^4.6.6" semver "^6.3.0" -core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: +core-js@^2.4.0, core-js@^2.5.0: version "2.6.9" resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== +core-js@^2.6.5: + version "2.6.11" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" + integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" From 27d19b195fcf197a79e71090fee7e0da7fd41125 Mon Sep 17 00:00:00 2001 From: langwenda Date: Tue, 11 Feb 2020 14:58:01 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9eslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 96d1011..fb56082 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ "scripts": { "dev": "cross-env NODE_ENV=mock webpack-dev-server -p --progress --config=webpack/webpack.dev.js --mode development --open", "build": "webpack -p --progress --config=webpack/webpack.prod.js --mode production", - "eslint": "eslint './*.js' './**/*.js' './**/*.ts'", - "eslint-fix": "eslint './*.js' './**/*.js' './**/*.ts' --fix", + "eslint": "eslint . --ext .ts'", + "eslint-fix": "eslint . --ext .ts --fix", "const": "javac -encoding UTF-8 -d constants/classes constants/*.java && java -cp constants/classes FRConstantsWriter", "i18n": "node ./lib/transform-i18n/transform-i18n.js", "test": "jest --passWithNoTests", From 7734a5cf37f3420f69057e3c76af9acaf59b6564 Mon Sep 17 00:00:00 2001 From: langwenda Date: Tue, 11 Feb 2020 15:03:04 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9eslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb56082..9cd2bb5 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "scripts": { "dev": "cross-env NODE_ENV=mock webpack-dev-server -p --progress --config=webpack/webpack.dev.js --mode development --open", "build": "webpack -p --progress --config=webpack/webpack.prod.js --mode production", - "eslint": "eslint . --ext .ts'", + "eslint": "eslint . --ext .ts", "eslint-fix": "eslint . --ext .ts --fix", "const": "javac -encoding UTF-8 -d constants/classes constants/*.java && java -cp constants/classes FRConstantsWriter", "i18n": "node ./lib/transform-i18n/transform-i18n.js", From d227b60eca8558570681d269d6f9f751da16896b Mon Sep 17 00:00:00 2001 From: "Frank.Qiu" Date: Tue, 11 Feb 2020 15:21:47 +0800 Subject: [PATCH 5/8] =?UTF-8?q?DEC-11995=20feat=EF=BC=9A=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=BC=A0=E8=BE=93=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/components/form.jdbc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 7badcea..f15b410 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -732,7 +732,7 @@ export class FormJdbc extends BI.Widget { driver: this.form.driver.getValue(), url: this.form.url.getValue(), user: this.form.user.getValue(), - password: this.oldPassword === this.form.password.getValue() ? this.oldPassword : BI.encode(this.form.password.getValue()), + password: this.oldPassword === this.form.password.getValue() ? this.oldPassword : BI.Providers.getProvider('dec.provider.cipher').getCipher(this.form.password.getValue()), queryType: '', newCharsetName: originalCharsetName ? 'gbk' : '', // 后台要求,originalCharsetName不为空时,newCharsetName为gbk originalCharsetName, From 35a4a78e8237738de976b8c7c2288c462751a88c Mon Sep 17 00:00:00 2001 From: langwenda Date: Tue, 18 Feb 2020 15:34:41 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fix:=20DEC-11221=20=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=AF=B9=E5=8F=AF=E8=BE=93=E5=85=A5=E6=95=B0=E5=80=BC=E7=9A=84?= =?UTF-8?q?=E5=8C=BA=E9=97=B4=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/zh_cn.properties | 3 +- private/i18n.ts | 1 + src/modules/constants/constant.ts | 2 ++ .../maintain/forms/components/form.jdbc.ts | 30 ++++++++++++------- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/i18n/zh_cn.properties b/i18n/zh_cn.properties index 33db53d..2010d77 100644 --- a/i18n/zh_cn.properties +++ b/i18n/zh_cn.properties @@ -301,4 +301,5 @@ BI-Basic_Billion= 亿 BI-Basic_Quarter= 季度 BI-Basic_No_Select= 不选 BI-Basic_Now= 此刻 -Dec-Dcm_Connection_Analytic_DB=阿里云AnalyticDB \ No newline at end of file +Dec-Dcm_Connection_Analytic_DB=阿里云AnalyticDB +Dec-Dcm_Connection_Value_Out_Range=数值超出范围 \ No newline at end of file diff --git a/private/i18n.ts b/private/i18n.ts index 97b308f..369845f 100644 --- a/private/i18n.ts +++ b/private/i18n.ts @@ -301,4 +301,5 @@ export default { 'BI-Basic_No_Select': '不选', 'BI-Basic_Now': '此刻', 'Dec-Dcm_Connection_Analytic_DB': '阿里云AnalyticDB', + 'Dec-Dcm_Connection_Value_Out_Range': '数值超出范围', }; diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 445b57d..d9ad8f7 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -707,3 +707,5 @@ export const JNDI_FACTORYS = [ ]; export const PAGE_SIZE = 50; +export const INT_MAX_VALUE = 2147483647; +export const INT_MIN_VALUE = -2147483648; diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 7badcea..2b45df6 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -4,7 +4,7 @@ import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/col import { FormItemXtype } from '../../components/form_item/form_item'; import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings'; import { connectionType } from '@constants/env'; -import { CONNECT_CHARSET, CONNECTION_LAYOUT } from '@constants/constant'; +import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; @@ -62,6 +62,12 @@ export class FormJdbc extends BI.Widget { const { host, port, databaseName } = resolveUrlInfo(url); const { hgap, vgap } = CONNECTION_LAYOUT; + const valueRangeConfig = { + errorText: BI.i18nText('Dec-Dcm_Connection_Value_Out_Range'), + checker: (value: string) => this.checkValueRange(value), + autoFix: true, + }; + return { type: Vertical, hgap, @@ -161,7 +167,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.port = _ref; }, @@ -408,7 +414,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), ref: (_ref: any) => { this.form.initialSize = _ref; @@ -428,7 +434,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.maxActive = _ref; }, @@ -447,7 +453,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.maxIdle = _ref; }, @@ -466,7 +472,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.minIdle = _ref; }, @@ -486,7 +492,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.maxWait = _ref; }, @@ -574,7 +580,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Number'), checker: (value: string) => this.checkNumber(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.timeBetweenEvictionRunsMillis = _ref; }, @@ -600,7 +606,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.numTestsPerEvictionRun = _ref; }, @@ -620,7 +626,7 @@ export class FormJdbc extends BI.Widget { errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value), autoFix: true, - }], + }, valueRangeConfig], ref: (_ref: any) => { this.form.minEvictableIdleTimeMillis = _ref; }, @@ -651,6 +657,10 @@ export class FormJdbc extends BI.Widget { return /^[(\-|\+)?\d]+$/.test(value); } + private checkValueRange(value: string) { + return Number(value) <= INT_MAX_VALUE && Number(value) >= INT_MIN_VALUE; + } + private getDrivers() { const connectionData = this.options.formData.connectionData as ConnectionJDBC; const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); From cfd715825a37d502c11e58f61b38f8bd961bbffd Mon Sep 17 00:00:00 2001 From: langwenda Date: Tue, 18 Feb 2020 15:46:35 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix:=20=E7=94=B1=E4=BA=8E=E5=AE=B9=E9=94=99?= =?UTF-8?q?=E7=8E=87=E7=9A=84=E5=85=B3=E7=B3=BB=EF=BC=8CNumber=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=94=B9=E6=88=90parseInt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/components/form.jdbc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index d8a0a37..3af4cf6 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -658,7 +658,7 @@ export class FormJdbc extends BI.Widget { } private checkValueRange(value: string) { - return Number(value) <= INT_MAX_VALUE && Number(value) >= INT_MIN_VALUE; + return parseInt(value, 0) <= INT_MAX_VALUE && parseInt(value, 0) >= INT_MIN_VALUE; } private getDrivers() { From d0814a9acfbf5be5a488545764b3d67bd086f29a Mon Sep 17 00:00:00 2001 From: "Frank.Qiu" Date: Thu, 20 Feb 2020 17:39:16 +0800 Subject: [PATCH 8/8] =?UTF-8?q?DEC-12158=20fix:=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E6=B5=8B=E8=AF=95=EF=BC=8C=E9=81=87=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E7=95=8C=E9=9D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 2 +- src/modules/pages/database/database.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 445b57d..6660598 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -597,7 +597,7 @@ export const DATA_BASE_TYPES = [ export const CONNECT_CHARSET = [ { - text: '自动', + text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'), value: '', }, { diff --git a/src/modules/pages/database/database.ts b/src/modules/pages/database/database.ts index a13921e..e7fa658 100644 --- a/src/modules/pages/database/database.ts +++ b/src/modules/pages/database/database.ts @@ -140,19 +140,23 @@ export class Datebase extends BI.Widget { items: [ { el: { - type: VerticalAdapt, + type: Htape, hgap: 20, invisible: true, items: [ { type: Label, + width: 70, + textAlign: 'left', text: BI.i18nText('Dec-Dcm_Connection_Type_Filter'), + title: BI.i18nText('Dec-Dcm_Connection_Type_Filter'), }, { type: MultiSelectItem, width: 80, selected: this.model.isInternal, text: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), + title: BI.i18nText('Dec-Dcm_Connection_Support_Inner'), ref: (_ref: any) => { this.internalWidget = _ref; }, @@ -165,6 +169,7 @@ export class Datebase extends BI.Widget { width: 80, selected: this.model.isPlugin, text: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), + title: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'), ref: (_ref: any) => { this.pluginWidget = _ref; }, @@ -175,14 +180,16 @@ export class Datebase extends BI.Widget { { type: Label, cls: 'bi-tips', + textAlign: 'left', text: BI.i18nText('Dec-Dcm_Connection_Filter_Tip'), + title: BI.i18nText('Dec-Dcm_Connection_Filter_Tip'), }, ], ref: (_ref: any) => { this.typeFilterWidget = _ref; }, }, - height: 20, + height: 24, }, { type: ButtonGroup,