|
|
|
@ -5,7 +5,7 @@ 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 } from '@constants/constant'; |
|
|
|
|
import { getAllDatabaseTypes } from '../../../../app.service'; |
|
|
|
|
import { getAllDatabaseTypes, getJdbcDatabaseType } from '../../../../app.service'; |
|
|
|
|
|
|
|
|
|
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; |
|
|
|
|
@shortcut(FormJdbcXtype) |
|
|
|
@ -56,7 +56,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
const { driver, host, port, user, password, newCharsetName, schema, url, connectionPool, database, authType, principal, keyPath } = connectionData as ConnectionJDBC; |
|
|
|
|
// minIdle 暂未使用
|
|
|
|
|
const { initialSize, maxActive, maxIdle, maxWait, validationQuery, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis } = connectionPool as ConnectionPoolJDBC; |
|
|
|
|
const databaseType = this.allDatabaseTypes.find(item => item.databaseType === database); |
|
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
|
this.oldPassword = password; |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
@ -100,7 +100,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
allowBlank: true, |
|
|
|
|
disabled: true, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
|
value: database, |
|
|
|
|
value: databaseType.databaseType, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
this.form.database = _ref; |
|
|
|
|
}, |
|
|
|
@ -506,10 +506,9 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private getDrivers() { |
|
|
|
|
const datebastType = (this.options.formData.connectionData as ConnectionJDBC).database; |
|
|
|
|
const connectionType = this.allDatabaseTypes.find(item => item.databaseType === datebastType); |
|
|
|
|
|
|
|
|
|
return connectionType.drivers ? |
|
|
|
|
const connectionData = this.options.formData.connectionData as ConnectionJDBC; |
|
|
|
|
const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); |
|
|
|
|
const drivers = connectionType.drivers ? |
|
|
|
|
connectionType.drivers.map(item => { |
|
|
|
|
return { |
|
|
|
|
text: item, |
|
|
|
@ -520,6 +519,17 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
text: connectionType.driver, |
|
|
|
|
value: connectionType.driver, |
|
|
|
|
}]; |
|
|
|
|
|
|
|
|
|
if (!drivers.some(item => item.text === connectionData.driver)) { |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
text: connectionData.driver, |
|
|
|
|
value: connectionData.driver, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return drivers; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private getBooleanItem() { |
|
|
|
|