From 7f467dab3437d3a4464f5eb49c1365a1f7efb8bf Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Thu, 5 Jan 2023 19:11:15 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-86591=20fix:tdsql=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=9B=B4=E5=90=8D?= 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 9f5f5b0..0baab99 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -704,7 +704,7 @@ export const DATA_BASE_TYPES = [ kerberos: false, }, { - text: BI.i18nText('Dec-Dcm_Connection_TDSQL'), + text: 'TDSQL', databaseType: 'tdsql', driver: 'org.postgresql.Driver', url: 'jdbc:postgresql://hostname:port/database', From 9f5eb9077d661a8c563bf262c27dfca2c3213de2 Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Fri, 6 Jan 2023 16:14:51 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-87662=20feat:=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9C=AC=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.typings.d.ts | 6 +- src/modules/components/collapse/collapse.ts | 4 + .../connection_jdbc/connection_jdbc.ts | 22 +++-- .../driverselector/driverselector.model.ts | 14 +++- .../driverselector/driverselector.ts | 11 +++ .../maintain/forms/components/form.jdbc.ts | 84 ++++++++++++++----- 6 files changed, 109 insertions(+), 32 deletions(-) diff --git a/src/modules/app.typings.d.ts b/src/modules/app.typings.d.ts index 67a5665..f4d0fda 100644 --- a/src/modules/app.typings.d.ts +++ b/src/modules/app.typings.d.ts @@ -8,9 +8,13 @@ export interface DatabaseType { internal: boolean; type: string; hasSchema?: boolean; + hasSchemas?: { + [key: string]: boolean; + }; kerberos?: boolean; iconUrl?: string; + versions?: string[]; urls?: { [key: string]: string; - } + }; } diff --git a/src/modules/components/collapse/collapse.ts b/src/modules/components/collapse/collapse.ts index 58e8db1..edaa9e5 100644 --- a/src/modules/components/collapse/collapse.ts +++ b/src/modules/components/collapse/collapse.ts @@ -64,4 +64,8 @@ export class Collapse extends BI.BasicButton { doClick() { this.store.setCollapse(!this.model.isCollapse); } + + setCollapse(v: boolean) { + this.store.setCollapse(v); + } } diff --git a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts index dd6f50a..9651233 100644 --- a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts +++ b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts @@ -52,7 +52,8 @@ export class ConnectionJdbc extends BI.Widget { sslClientCertificate, } = connectionData; const databaseType = getJdbcDatabaseType(database, driver); - const { host, port, databaseName } = resolveUrlInfo(url, database); + const { host, port, databaseName, version } = resolveUrlInfo(url, database); + this.version = !BI.isUndefined(databaseType.versions) ? (version ?? databaseType.versions[0]) : version; const { hgap, vgap } = CONNECTION_LAYOUT; return { @@ -62,6 +63,13 @@ export class ConnectionJdbc extends BI.Widget { items: [ { type: FormItem.xtype, + name: BI.i18nText('Dec-Basic_Version'), + invisible: BI.isUndefined(this.version), + value: BI.i18nText('Dec-Migration_Database_Version', this.version), + }, + { + type: FormItem.xtype, + _tgap: BI.isUndefined(this.version) ? vgap : 0, name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), value: BI.isKey(driverSource) ? `${driver} (${driverSource})` : driver, }, @@ -82,13 +90,13 @@ export class ConnectionJdbc extends BI.Widget { }, authType ? { - type: FormItem.xtype, - name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), - value: authType, - } + type: FormItem.xtype, + name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), + value: authType, + } : { - type: BI.Layout.xtype, - }, + type: BI.Layout.xtype, + }, { type: FormItem.xtype, name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_Principal') : BI.i18nText('Dec-Dcm_Connection_Form_UserName'), diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts index 382f439..15b164e 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.model.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.model.ts @@ -87,6 +87,12 @@ export class DriverSelectorModel extends Model { changeDriverSource: driverTypeComboValue => { this.model.driverSource = driverTypeComboValue === 'default' ? '' : this.model.driverSource; }, + + setDefaultDrivers: version => { + const defaultDrivers = this.getDrivers(version); + this.model.defaultDrivers = defaultDrivers; + this.changeDefaultDriver(defaultDrivers[0]?.value); + } }; private resolveSelectedDriverType = () => { @@ -97,11 +103,12 @@ export class DriverSelectorModel extends Model { return [this.options.driverSource, this.options.driver]; }; - private getDrivers = () => { + private getDrivers = (version?: string) => { const connectionData = this.options.connectionData as ConnectionJDBC; const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); + const selectedVersion = version ?? this.options.version; const drivers = connectionType.drivers ? - connectionType.drivers.map(item => { + (BI.isUndefined(connectionType.versions) ? connectionType.drivers : connectionType.drivers[selectedVersion]).map(item => { return { text: item, value: item, @@ -111,8 +118,7 @@ export class DriverSelectorModel extends Model { text: connectionType.driver, value: connectionType.driver, }]; - - if (!drivers.some(item => item.text === connectionData.driver)) { + if (BI.isUndefined(connectionType.versions) && !drivers.some(item => item.text === connectionData.driver)) { return [ { text: connectionData.driver, diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.ts b/src/modules/pages/maintain/components/driverselector/driverselector.ts index 7eac368..8408e05 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.ts @@ -24,6 +24,7 @@ export class DriverSelector extends BI.Widget { driver: '', driverSource: '', connectionData: {} as ConnectionJDBC, + version: '', }; defaultDrivers: EditorIconCheckCombo = null; @@ -43,6 +44,12 @@ export class DriverSelector extends BI.Widget { driverManageEntryVisible: b => { this.driverManageEntry.setVisible(b); }, + + defaultDrivers: items => { + this.defaultDrivers.populate(items); + this.defaultDrivers.setValue(this.model.defaultDriver.driver); + this.fireEvent('EVENT_CHANGE'); + } }; private driverManageEntry = null; @@ -182,4 +189,8 @@ export class DriverSelector extends BI.Widget { driver: this.model.driverSource === '' ? this.model.defaultDriver.driver : this.model.customDriver.driver, }; } + + setDefaultDrivers(version: string) { + this.store.setDefaultDrivers(version); + } } diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 90ea1b2..9cf4aad 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -40,9 +40,11 @@ export class FormJdbc extends BI.Widget { formKeyPath: FormItem; formKrb5File: FormItem; labelTips: Label; + schemaForm: FormItem; form = { connectionName: null, + version: null, driver: null, database: null, host: null, @@ -138,8 +140,8 @@ export class FormJdbc extends BI.Widget { } = connectionPoolAttr as ConnectionPoolJDBC; const databaseType = getJdbcDatabaseType(database, driver); this.databaseType = databaseType; - - const { host, port, databaseName } = resolveUrlInfo(url, database); + const { host, port, databaseName, version } = resolveUrlInfo(url, database); + this.version = !BI.isUndefined(databaseType.versions) ? (version ?? databaseType.versions[0]) : version; const { hgap, vgap } = CONNECTION_LAYOUT; const valueRangeConfig = { @@ -171,6 +173,41 @@ export class FormJdbc extends BI.Widget { }, ], }, + // 版本 + { + type: FormItem.xtype, + name: BI.i18nText('Dec-Basic_Version'), + invisible: BI.isUndefined(databaseType.versions), + forms: [ + { + type: BI.TextValueCombo.xtype, + width: 300, + value: this.version, + items: () => databaseType.versions.map(item => { + return { + text: BI.i18nText('Dec-Migration_Database_Version', item), + value: item, + } + }), + ref: (_ref: TextValueCombo) => { + this.form.version = _ref; + }, + listeners: [ + { + eventName: BI.TextValueCombo.EVENT_CHANGE, + action: () => { + const version = this.form.version.getValue()[0]; + this.version = version; + this.sslCollapse.setCollapse(true); + this.sslCollapse.setVisible(this.getSslSetEnabled()); + !BI.isUndefined(databaseType.hasSchemas) && this.schemaForm.setVisible(databaseType.hasSchemas[version]); + this.form.driver.setDefaultDrivers(version); + }, + }, + ], + }, + ], + }, // 驱动 { type: FormItem.xtype, @@ -184,6 +221,7 @@ export class FormJdbc extends BI.Widget { driver, driverSource, connectionData, + version: this.version, listeners: [ { eventName: 'EVENT_CHANGE', @@ -405,7 +443,7 @@ export class FormJdbc extends BI.Widget { { eventName: FileUpload.EVENT_CHECK_SUCCESS, action: (value) => { - const principalsItems = BI.map(value.principals, function(index, item) { + const principalsItems = BI.map(value.principals, function (index, item) { return { text: item, value: item @@ -485,7 +523,7 @@ export class FormJdbc extends BI.Widget { action: () => { this.setKerberos(); }, - } + } ] } ] @@ -510,7 +548,7 @@ export class FormJdbc extends BI.Widget { // 模式 { type: FormItem.xtype, - invisible: !databaseType.hasSchema, + invisible: BI.isUndefined(databaseType.hasSchemas) ? !databaseType.hasSchema : !databaseType.hasSchemas[this.version], height: 64, name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'), forms: [ @@ -551,6 +589,9 @@ export class FormJdbc extends BI.Widget { ], }, ], + ref: (_ref: FormItem) => { + this.schemaForm = _ref; + }, }, // 分隔线 { @@ -866,6 +907,9 @@ export class FormJdbc extends BI.Widget { width: 100, name: BI.i18nText('Dec-Dcm_Connection_Setting', 'SSL'), invisible: !this.getSslSetEnabled(), + ref: (_ref: Collapse) => { + this.sslCollapse = _ref; + }, listeners: [ { eventName: EVENT_CHANGE, @@ -1252,17 +1296,17 @@ export class FormJdbc extends BI.Widget { const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); const drivers = connectionType.drivers ? connectionType.drivers.map((item) => { - return { - text: item, - value: item, - }; - }) + return { + text: item, + value: item, + }; + }) : [ - { - text: connectionType.driver, - value: connectionType.driver, - }, - ]; + { + text: connectionType.driver, + value: connectionType.driver, + }, + ]; if (!drivers.some((item) => item.text === connectionData.driver)) { return [ @@ -1309,7 +1353,7 @@ export class FormJdbc extends BI.Widget { private getSslSetEnabled(): boolean { const { databaseType } = this.databaseType; - return databaseType === 'mysql'; + return databaseType === 'mysql' || this.version === 'mysql'; } public setSchemas(schemas: string[]) { @@ -1329,7 +1373,7 @@ export class FormJdbc extends BI.Widget { } public setKerberos() { - const KerberosParams = BI.extend({},{ + const KerberosParams = BI.extend({}, { keytabPath: this.form.keyPath.getValue(), krb5ConfPath: this.form.krb5Path.getValue(), principal: this.form.principal.getValue()[0] @@ -1341,7 +1385,7 @@ export class FormJdbc extends BI.Widget { public initPrincipals(keyPath, principal) { let self = this; api.getPrincipals(keyPath).then(res => { - const principalsItems = BI.map(res.data, function(index, item) { + const principalsItems = BI.map(res.data, function (index, item) { return { text: item, value: item @@ -1354,12 +1398,12 @@ export class FormJdbc extends BI.Widget { public changePrincipal() { let self = this; - const KerberosParams = BI.extend({},{ + const KerberosParams = BI.extend({}, { keytabPath: this.form.keyPath.getValue(), krb5ConfPath: this.form.krb5Path.getValue(), principal: this.form.principal.getValue()[0] }); - api.changePrincipal(KerberosParams).then(res =>{ + api.changePrincipal(KerberosParams).then(res => { self.form.keyPath.setValue(res.data.keytabPath); self.form.krb5Path.setValue(res.data.krb5ConfPath); }); From 8ed653f04445209261c2d73db6b6bf400dadc442 Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Fri, 6 Jan 2023 16:15:28 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-87662=20feat:tbase=E9=80=82=E9=85=8D?= =?UTF-8?q?tdsql=E7=9A=84=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 0baab99..65df36e 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -708,6 +708,7 @@ export const DATA_BASE_TYPES = [ databaseType: 'tdsql', driver: 'org.postgresql.Driver', url: 'jdbc:postgresql://hostname:port/database', + versions: ['pgsql'], commonly: false, internal: true, type: 'jdbc', From 1cfe9d2ddba0908aee62c6fa43a659068e027347 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Wed, 1 Feb 2023 14:57:51 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-86413=20feat:=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=80=82=E9=85=8D=E5=B9=B3=E5=8F=B0=E5=8A=A0?= =?UTF-8?q?=E8=A7=A3=E5=AF=86=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/decision.api.ts | 6 ++---- types/globals.d.ts | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 3ad6470..5249552 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -107,13 +107,11 @@ export class DecisionApi implements Api { } getCipher(password: string) { - return BI.Providers.getProvider('dec.provider.cipher') - .getCipher(password); + return Dec.Utils['getTransCipherText'](password); } getPlain(cipher: string) { - return BI.Providers.getProvider('dec.provider.cipher') - .getPlain(cipher); + return Dec.Utils['getPlainText'](cipher); } getHyperlink(name: string) { diff --git a/types/globals.d.ts b/types/globals.d.ts index 4d1c456..f936556 100644 --- a/types/globals.d.ts +++ b/types/globals.d.ts @@ -13,6 +13,7 @@ declare const Dec: { connected: boolean; }; system: {}; + Utils: {}, personal: { username: string; }; From 06835d70a5d5d023cc532b4ab3dfd2150f5799da Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 7 Feb 2023 10:24:22 +0800 Subject: [PATCH 5/8] =?UTF-8?q?REPORT-89173=20fix:=20JNDI=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/app.service.ts | 18 +++++++-------- src/modules/crud/api.ts | 10 ++++----- src/modules/crud/decision.api.ts | 7 +++++- src/modules/crud/design.api.ts | 4 ++++ src/modules/pages/database/database.model.ts | 23 ++++++++++++++++---- src/modules/pages/database/database.ts | 13 ++++++++++- 6 files changed, 55 insertions(+), 20 deletions(-) diff --git a/src/modules/app.service.ts b/src/modules/app.service.ts index e35475f..7b0983f 100644 --- a/src/modules/app.service.ts +++ b/src/modules/app.service.ts @@ -1,7 +1,7 @@ import { DATA_BASE_TYPES, DATA_BASE_TYPES_OTHER, DESIGN_DRIVER_TYPE, OTHER_JDBC } from '@constants/constant'; import { DatabaseType } from './app.typings'; import { Connection } from './crud/crud.typings'; -export function getAllDatabaseTypes():DatabaseType[] { +export function getAllDatabaseTypes(): DatabaseType[] { return [ ...DATA_BASE_TYPES, ...BI.Providers.getProvider('dec.connection.provider.datebase').customDatabaseType.map(item => { @@ -45,11 +45,11 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT if (!databaseType) { return DATA_BASE_TYPES_OTHER; } - + return databaseType; } -export function resolveUrlInfo (url: string, database?: string) { +export function resolveUrlInfo(url: string, database?: string) { if (BI.isNull(url)) return {}; return BI.Providers.getProvider('dec.connection.provider.datebase').getJdbcResolveByType(database)(url) || { @@ -70,11 +70,11 @@ export function splitUrl(host: string, port: string, database: string, baseUrl: // https://work.fineres.com/browse/REPORT-72078 if (baseUrl.startsWith('jdbc:informix-sqli')) { return baseUrl.replace('hostname', host) - .replace(':port', port ? `:${port}` : '') - .replace('database', database) - .replace(':INFORMIXSERVER={server}',''); + .replace(':port', port ? `:${port}` : '') + .replace('database', database) + .replace(':INFORMIXSERVER={server}', ''); } - + return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '') .replace('database', database) .replace('dbname', database); @@ -85,13 +85,13 @@ export function connectionCanEdit(connection: Connection) { // privilegeType === 4 代表编辑权限,privilegeValue === 2 代表有权限 return connection.privilegeDetailBeanList.some(item => item.privilegeType === 4 && item.privilegeValue === 2); } - + return true; } export function getTextByDatabaseType(databaseType: string) { const database = getAllDatabaseTypes().find(item => item.databaseType === databaseType); - + return database ? database.text : ''; } diff --git a/src/modules/crud/api.ts b/src/modules/crud/api.ts index 12d4f0c..32fa735 100644 --- a/src/modules/crud/api.ts +++ b/src/modules/crud/api.ts @@ -52,11 +52,6 @@ export interface Api { */ getConnectionPool(name: string): Promise<{ data?: ConnectionPoolType }>; - /** - * 获取自定义驱动列表 - */ - getSimpleDriverList(): Promise<{ data?: any[] }>; - /** * 获取连接状态 * @param name @@ -93,4 +88,9 @@ export interface Api { * 获取外链 */ getHyperlink(name: string): string; + + /** + * 获取JNDI数据库类型可用状态 + */ + getJNDIDatabaseStatus(): Promise<{ data?: boolean }>; } diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 5249552..782779d 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -129,11 +129,16 @@ export class DecisionApi implements Api { getTimeOut(): Promise<{ data?: any }> { return requestGet('kdc/timeout', {}); } - + putTimeOut(value: number) { return requestPut(`kdc/timeout?timeout=${value}`, {}) } + // 获取当前lic是否可以使用JNDI数据库类型 + getJNDIDatabaseStatus(): Promise<{ data?: boolean }> { + return requestGet('databasetype/limit', {}); + } + private sendEditStatusEvent(name: string, type: string): Promise { return new Promise(resolve => { if (Dec && Dec.socket.connected) { diff --git a/src/modules/crud/design.api.ts b/src/modules/crud/design.api.ts index f010918..643ad8e 100644 --- a/src/modules/crud/design.api.ts +++ b/src/modules/crud/design.api.ts @@ -88,4 +88,8 @@ export class DesignApi implements Api { // 设计器获取超链 return ''; } + + getJNDIDatabaseStatus() { + return Promise.resolve({ data: true }); + } } diff --git a/src/modules/pages/database/database.model.ts b/src/modules/pages/database/database.model.ts index 44109ea..0de45eb 100644 --- a/src/modules/pages/database/database.model.ts +++ b/src/modules/pages/database/database.model.ts @@ -2,10 +2,12 @@ import { model, Model } from '@core/core'; import { AppModel } from 'src/modules/app.model'; import { getAllDatabaseTypes } from '../../app.service'; import { DatabaseType } from '../../app.typings'; +import { connectionType } from '@constants/env'; +import { OTHER_JDBC } from '@constants/constant'; @model() export class DatebaseModel extends Model<{ - types : { + types: { filter: AppModel['TYPE']['filter']; datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected']; }, @@ -20,20 +22,30 @@ export class DatebaseModel extends Model<{ isInternal: true, isPlugin: true, datebaseTypes: getAllDatabaseTypes().filter(item => item.commonly), + isJNDILimit: false, }; } + + computed = { + otherDatabases: () => { + return this.model.isJNDILimit + ? [OTHER_JDBC] + : [OTHER_JDBC, connectionType.JNDI]; + } + } + actions = { - setSearch:(search: string) => { + setSearch: (search: string) => { this.model.search = search; }, - setFilter:(filter: string) => { + setFilter: (filter: string) => { this.model.filter = filter; }, setDatebaseTypes: (datebaseTypes: DatabaseType[]) => { this.model.datebaseTypes = datebaseTypes; this.model.datebaseTypeSelected = ''; }, - setInternal:(isInternal: boolean) => { + setInternal: (isInternal: boolean) => { this.model.isInternal = isInternal; }, setPlugin: (isPlugin: boolean) => { @@ -42,5 +54,8 @@ export class DatebaseModel extends Model<{ setDatebaseTypeSelected(datebaseType: string) { this.model.datebaseTypeSelected = datebaseType; }, + setJNDILimit: (v: boolean) => { + this.model.isJNDILimit = v; + }, } } diff --git a/src/modules/pages/database/database.ts b/src/modules/pages/database/database.ts index 93b32ae..7779006 100644 --- a/src/modules/pages/database/database.ts +++ b/src/modules/pages/database/database.ts @@ -6,6 +6,10 @@ import { connectionType } from '@constants/env'; import { DatebaseType } from './database_type/database_type'; import { getAllDatabaseTypes } from '../../app.service'; import { ButtonGroup, MultiSelectItem, SearchEditor } from '@fui/core'; +import { ApiFactory } from 'src/modules/crud/apiFactory'; + +const api = new ApiFactory().create(); + @shortcut() @store(DatebaseModel) export class Datebase extends BI.Widget { @@ -65,6 +69,7 @@ export class Datebase extends BI.Widget { mounted() { this.store.setFilter(DATEBASE_FILTER_TYPE.COMMONLY); this.store.setDatebaseTypeSelected(''); + this.getDatabaseTypeLimit(); } render() { @@ -250,11 +255,17 @@ export class Datebase extends BI.Widget { this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.commonly)); break; case DATEBASE_FILTER_TYPE.OTHER: - this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type === connectionType.JNDI || item.type === OTHER_JDBC)); + this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => this.model.otherDatabases.includes(item.type))); break; default: this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== OTHER_JDBC)); break; } } + + // 获取JNDI + private async getDatabaseTypeLimit() { + const result = await api.getJNDIDatabaseStatus(); + this.store.setJNDILimit(result); + } } From 49779bdcbd5e26f106848b9e968e6fb3628c8f48 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 7 Feb 2023 10:31:35 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=8B=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/api.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/crud/api.ts b/src/modules/crud/api.ts index 32fa735..daa9e4d 100644 --- a/src/modules/crud/api.ts +++ b/src/modules/crud/api.ts @@ -52,6 +52,11 @@ export interface Api { */ getConnectionPool(name: string): Promise<{ data?: ConnectionPoolType }>; + /** + * 获取自定义驱动列表 + */ + getSimpleDriverList(): Promise<{ data?: any[] }>; + /** * 获取连接状态 * @param name From 1665e6ebcaa5395159461da873c6ae4ca491d75f Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Wed, 8 Feb 2023 11:43:55 +0800 Subject: [PATCH 7/8] =?UTF-8?q?REPORT-89173=20fix:=20=E9=80=82=E9=85=8D?= =?UTF-8?q?=E4=B8=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/database/database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pages/database/database.ts b/src/modules/pages/database/database.ts index 7779006..b955b64 100644 --- a/src/modules/pages/database/database.ts +++ b/src/modules/pages/database/database.ts @@ -266,6 +266,6 @@ export class Datebase extends BI.Widget { // 获取JNDI private async getDatabaseTypeLimit() { const result = await api.getJNDIDatabaseStatus(); - this.store.setJNDILimit(result); + this.store.setJNDILimit(result.data); } } From 057f9d804c23daf9bbb64daff0aff31ac760f537 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Fri, 10 Feb 2023 11:40:11 +0800 Subject: [PATCH 8/8] =?UTF-8?q?Revert=20"REPORT-86413=20feat:=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E9=80=82=E9=85=8D=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=8A=A0=E8=A7=A3=E5=AF=86=E6=94=B9=E9=80=A0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1cfe9d2ddba0908aee62c6fa43a659068e027347. --- src/modules/crud/decision.api.ts | 6 ++++-- types/globals.d.ts | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 782779d..b23c31b 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -107,11 +107,13 @@ export class DecisionApi implements Api { } getCipher(password: string) { - return Dec.Utils['getTransCipherText'](password); + return BI.Providers.getProvider('dec.provider.cipher') + .getCipher(password); } getPlain(cipher: string) { - return Dec.Utils['getPlainText'](cipher); + return BI.Providers.getProvider('dec.provider.cipher') + .getPlain(cipher); } getHyperlink(name: string) { diff --git a/types/globals.d.ts b/types/globals.d.ts index f936556..4d1c456 100644 --- a/types/globals.d.ts +++ b/types/globals.d.ts @@ -13,7 +13,6 @@ declare const Dec: { connected: boolean; }; system: {}; - Utils: {}, personal: { username: string; };