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