From f466d42980d7f8b593ce0c089a4982be514ab61e Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Mon, 31 May 2021 17:13:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?DEC-18828=20feat:=20=E9=9A=94=E7=A6=BB?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=94=AF=E6=8C=81kerberos=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=AB=AF=E4=BA=A4=E4=BA=92connectionData?= =?UTF-8?q?=E4=B8=AD=E6=96=B0=E5=A2=9EuseJaas=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/crud.typings.d.ts | 3 +- .../maintain/forms/components/form.jdbc.ts | 72 ++++++++++++++----- .../maintain/forms/components/form.jndi.ts | 32 +++++---- .../maintain/forms/components/form.plugin.ts | 12 ++-- 4 files changed, 77 insertions(+), 42 deletions(-) diff --git a/src/modules/crud/crud.typings.d.ts b/src/modules/crud/crud.typings.d.ts index 239180e..84181fe 100644 --- a/src/modules/crud/crud.typings.d.ts +++ b/src/modules/crud/crud.typings.d.ts @@ -1,4 +1,3 @@ - export interface CrudReqOpts { url?: string; type?: 'GET' | 'POST' | 'DELETE' | 'PUT'; @@ -83,7 +82,7 @@ export interface ConnectionJDBC { /** * 端口号 */ - port?: number|''; + port?: number | ''; /** * 主机名 */ diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index a527cd6..1684f5e 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -1,13 +1,22 @@ -import { shortcut } from '@core/core'; -import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; -import { FormItem } 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, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; -import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; -import { TextChecker } from '../../../../components/text_checker/text_checker'; -import { ApiFactory } from 'src/modules/crud/apiFactory'; -import { Editor, EditorIconCheckCombo, Label, TextAreaEditor, TextEditor, TextValueCombo, VerticalLayout } from '@fui/core'; +import {shortcut} from '@core/core'; +import {Collapse, EVENT_CHANGE} from 'src/modules/components/collapse/collapse'; +import {FormItem} 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, INT_MAX_VALUE, INT_MIN_VALUE} from '@constants/constant'; +import {getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl} from '../../../../app.service'; +import {TextChecker} from '../../../../components/text_checker/text_checker'; +import {ApiFactory} from 'src/modules/crud/apiFactory'; +import { + Editor, + EditorIconCheckCombo, + Label, + TextAreaEditor, + TextEditor, + TextValueCombo, + VerticalLayout +} from '@fui/core'; + const api = new ApiFactory().create(); @shortcut() @@ -57,13 +66,38 @@ export class FormJdbc extends BI.Widget { }; render() { - const { connectionName, connectionData } = this.options.formData; - const { driver, user, password, originalCharsetName, schema, url, connectionPoolAttr, database, authType, principal, keyPath } = connectionData as ConnectionJDBC; - const { initialSize, maxActive, maxIdle, maxWait, validationQuery, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minIdle, minEvictableIdleTimeMillis } = connectionPoolAttr as ConnectionPoolJDBC; + const {connectionName, connectionData} = this.options.formData; + const { + driver, + user, + password, + originalCharsetName, + schema, + url, + connectionPoolAttr, + database, + authType, + principal, + keyPath + } = connectionData as ConnectionJDBC; + const { + initialSize, + maxActive, + maxIdle, + maxWait, + validationQuery, + testOnBorrow, + testOnReturn, + testWhileIdle, + timeBetweenEvictionRunsMillis, + numTestsPerEvictionRun, + minIdle, + minEvictableIdleTimeMillis + } = connectionPoolAttr as ConnectionPoolJDBC; const databaseType = getJdbcDatabaseType(database, driver); this.oldPassword = password; - const { host, port, databaseName } = resolveUrlInfo(url, database); - const { hgap, vgap } = CONNECTION_LAYOUT; + const {host, port, databaseName} = resolveUrlInfo(url, database); + const {hgap, vgap} = CONNECTION_LAYOUT; const valueRangeConfig = { errorText: BI.i18nText('Dec-Dcm_Connection_Value_Out_Range'), @@ -360,7 +394,7 @@ export class FormJdbc extends BI.Widget { vgap: 15, disabled: true, value: schema, - items: schema ? [{ text: schema, value: schema }] : [], + items: schema ? [{text: schema, value: schema}] : [], ref: (_ref: TextValueCombo) => { this.form.schema = _ref; }, @@ -733,7 +767,7 @@ export class FormJdbc extends BI.Widget { } private onHostPortChange(databaseType) { - const { urls, url } = databaseType; + const {urls, url} = databaseType; const driver = this.form.driver.getValue(); const selectUrl = BI.get(urls, driver) || url; const host = this.form.host.getValue(); @@ -766,7 +800,7 @@ export class FormJdbc extends BI.Widget { connectionType: connectionType.JDBC, connectionId: this.form.connectionName.getValue(), connectionName: this.form.connectionName.getValue(), - connectionData: { + connectionData: BI.extend({}, connectionData, { database: connectionData.database, connectionName: this.form.connectionName.getValue(), driver: this.form.driver.getValue(), @@ -796,7 +830,7 @@ export class FormJdbc extends BI.Widget { numTestsPerEvictionRun: this.form.numTestsPerEvictionRun.getValue(), minEvictableIdleTimeMillis: this.form.minEvictableIdleTimeMillis.getValue(), }, - }, + }), }; } } diff --git a/src/modules/pages/maintain/forms/components/form.jndi.ts b/src/modules/pages/maintain/forms/components/form.jndi.ts index 7295a93..c3ff9c3 100644 --- a/src/modules/pages/maintain/forms/components/form.jndi.ts +++ b/src/modules/pages/maintain/forms/components/form.jndi.ts @@ -1,11 +1,11 @@ -import { shortcut } from '@core/core'; -import { FormItem } from '../../components/form_item/form_item'; -import { ConnectionJNDI, Connection, ContextHashtable } from 'src/modules/crud/crud.typings'; -import { CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS } from '@constants/constant'; -import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; -import { connectionType } from '@constants/env'; -import { TextChecker } from '../../../../components/text_checker/text_checker'; -import { EditorIconCheckCombo, TextEditor, TextValueCombo, VerticalLayout } from '@fui/core'; +import {shortcut} from '@core/core'; +import {FormItem} from '../../components/form_item/form_item'; +import {ConnectionJNDI, Connection, ContextHashtable} from 'src/modules/crud/crud.typings'; +import {CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS} from '@constants/constant'; +import {Collapse, EVENT_CHANGE} from 'src/modules/components/collapse/collapse'; +import {connectionType} from '@constants/env'; +import {TextChecker} from '../../../../components/text_checker/text_checker'; +import {EditorIconCheckCombo, TextEditor, TextValueCombo, VerticalLayout} from '@fui/core'; @shortcut() export class FormJndi extends BI.Widget { @@ -37,9 +37,9 @@ export class FormJndi extends BI.Widget { } render() { - const { connectionName, connectionData } = this.options.formData; - const { jndiName, newCharsetName, contextHashtable } = connectionData as ConnectionJNDI; - const { hgap, vgap } = CONNECTION_LAYOUT; + const {connectionName, connectionData} = this.options.formData; + const {jndiName, newCharsetName, contextHashtable} = connectionData as ConnectionJNDI; + const {hgap, vgap} = CONNECTION_LAYOUT; return { type: BI.VerticalLayout.xtype, @@ -399,7 +399,9 @@ export class FormJndi extends BI.Widget { this.form.connectionName.setError(value); } - public getSubmitValue():Connection { + public getSubmitValue(): Connection { + const connectionData = this.options.formData.connectionData as ConnectionJNDI; + const contextHashtable = { 'java.naming.factory.initial': this.form.initial.getValue(), 'java.naming.provider.url': this.form.providerUrl.getValue(), @@ -423,18 +425,18 @@ export class FormJndi extends BI.Widget { delete contextHashtable[propName]; } } - + return { connectionId: this.form.connectionName.getValue(), connectionName: this.form.connectionName.getValue(), connectionType: connectionType.JNDI, - connectionData: { + connectionData: BI.extend({}, connectionData, { jndiName: this.form.jndiName.getValue(), newCharsetName: this.form.newCharsetName.getValue()[0] || '', originalCharsetName: this.form.newCharsetName.getValue()[0] || '', creator: Dec ? Dec.personal.username : '', contextHashtable: contextHashtable as ContextHashtable, - }, + }), }; } } diff --git a/src/modules/pages/maintain/forms/components/form.plugin.ts b/src/modules/pages/maintain/forms/components/form.plugin.ts index 8fd8fc9..6282203 100644 --- a/src/modules/pages/maintain/forms/components/form.plugin.ts +++ b/src/modules/pages/maintain/forms/components/form.plugin.ts @@ -1,13 +1,13 @@ -import {shortcut} from '@core/core'; -import {Connection} from 'src/modules/crud/crud.typings'; -import {getPluginWidgetEdit} from '../../../../app.service'; +import { shortcut } from '@core/core'; +import { Connection, ConnectionPlugin } from 'src/modules/crud/crud.typings'; +import { getPluginWidgetEdit } from '../../../../app.service'; @shortcut() export class FormPlugin extends BI.Widget { static xtype = 'dec.dcm.maintain_plugin'; props = { formData: {} as Connection, - } + }; plugin: any; @@ -28,13 +28,13 @@ export class FormPlugin extends BI.Widget { } public getSubmitValue(): Connection { - const { connectionType, connectionId, connectionName } = this.options.formData; + const { connectionType, connectionId, connectionName, connectionData } = this.options.formData; return { connectionId, connectionType, connectionName: this.plugin.getConnectionName ? this.plugin.getConnectionName() : connectionName, - connectionData: this.plugin.getValue(), + connectionData: BI.extend({}, connectionData, this.plugin.getValue()), }; } } From 3b7ed235df9de466ce1d2b3693c614f571975987 Mon Sep 17 00:00:00 2001 From: youki Date: Thu, 3 Jun 2021 18:22:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?DEC-18651=20feat:=20=E9=80=82=E9=85=8Dholog?= =?UTF-8?q?res=E6=95=B0=E6=8D=AE=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 31d11b4..f55c358 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -400,6 +400,16 @@ export const DATA_BASE_TYPES = [ type: 'jdbc', hasSchema: true, kerberos: true, + }, { + text: 'Hologres', + databaseType: 'hologres', + driver: 'org.postgresql.Driver', + url: 'jdbc:postgresql://hostname:port/database', + commonly: false, + internal: true, + type: 'jdbc', + hasSchema: true, + kerberos: false, }, { text: 'HP Vertica', databaseType: 'hp-vertica', From e989e0e2a0c4e72fe877fe6935ce5575ab781f65 Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Tue, 15 Jun 2021 10:08:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?DEC-19116=20fix:=20=E3=80=90=E4=B8=93?= =?UTF-8?q?=E9=A2=98=E3=80=91=E3=80=90=E4=B8=BB=E9=A2=98=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E3=80=91=E9=83=A8=E5=88=86=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E9=A9=B1=E5=8A=A8=E6=97=B6=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E8=B7=B3=E8=BD=AC=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 31d11b4..3d4eaeb 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -45,7 +45,7 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [ }, { databaseType: 'apache-kylin', - link: DecCst.Hyperlink.Database.PHOENIX, + link: DecCst.Hyperlink.Database.KYLIN, }, { databaseType: 'apache-phoenix', From d8db3d69e4a8410ea70273da5d96160431228cb3 Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Wed, 16 Jun 2021 14:34:35 +0800 Subject: [PATCH 4/4] =?UTF-8?q?DEC-19154=20fix:=20=E3=80=90=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E3=80=91=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?-=E9=AB=98=E7=BA=A7=E8=AE=BE=E7=BD=AE=E4=B8=AD=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=92=8C=E7=BC=96=E8=BE=91=E6=97=B6-=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=BF=9E=E6=8E=A5=E5=89=8D=E6=A3=80=E9=AA=8C=E7=9A=84?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E4=B8=8D=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/components/form.jdbc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 1684f5e..b00d993 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -581,7 +581,7 @@ export class FormJdbc extends BI.Widget { }, { type: FormItem.xtype, - name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), + name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'), forms: [{ type: BI.TextValueCombo.xtype, $value: 'check', @@ -589,7 +589,7 @@ export class FormJdbc extends BI.Widget { allowBlank: true, value: testOnBorrow, items: this.getBooleanItem(), - watermark: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), + watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'), ref: (_ref: TextValueCombo) => { this.form.testOnBorrow = _ref; },