|
|
@ -23,6 +23,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
formPassword: any; |
|
|
|
formPassword: any; |
|
|
|
formPrincipal: any; |
|
|
|
formPrincipal: any; |
|
|
|
formKeyPath: any; |
|
|
|
formKeyPath: any; |
|
|
|
|
|
|
|
labelTips: any; |
|
|
|
|
|
|
|
|
|
|
|
form = { |
|
|
|
form = { |
|
|
|
connectionName: null, |
|
|
|
connectionName: null, |
|
|
@ -53,9 +54,9 @@ export class FormJdbc extends BI.Widget { |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const { connectionName, connectionData } = this.options.formData; |
|
|
|
const { connectionName, connectionData } = this.options.formData; |
|
|
|
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, connectionPoolAttr, 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 } = connectionPoolAttr as ConnectionPoolJDBC; |
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
this.oldPassword = password; |
|
|
|
this.oldPassword = password; |
|
|
|
|
|
|
|
|
|
|
@ -111,9 +112,8 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: TextEditor, |
|
|
|
type: TextEditor, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
disabled: true, |
|
|
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
value: databaseType.databaseType, |
|
|
|
value: '', // TODO: 数据库名称待适配
|
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.database = _ref; |
|
|
|
this.form.database = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -172,7 +172,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
items: [ |
|
|
|
items: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), |
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName_Password'), |
|
|
|
value: '', |
|
|
|
value: '', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -189,6 +189,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
this.formKeyPath.setVisible(!!type); |
|
|
|
this.formKeyPath.setVisible(!!type); |
|
|
|
this.formUser.setVisible(!type); |
|
|
|
this.formUser.setVisible(!type); |
|
|
|
this.formPassword.setVisible(!type); |
|
|
|
this.formPassword.setVisible(!type); |
|
|
|
|
|
|
|
this.labelTips.setVisible(!!type); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
@ -269,6 +270,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}], |
|
|
|
}], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: Label, |
|
|
|
|
|
|
|
cls: 'bi-tips', |
|
|
|
|
|
|
|
textAlign: 'left', |
|
|
|
|
|
|
|
invisible: true, |
|
|
|
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Warning'), |
|
|
|
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
|
|
|
this.labelTips = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
|
|
@ -590,16 +601,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
|
|
|
|
|
|
|
|
public getSubmitValue():Connection { |
|
|
|
public getSubmitValue():Connection { |
|
|
|
const connectionData = this.options.formData.connectionData as ConnectionJDBC; |
|
|
|
const connectionData = this.options.formData.connectionData as ConnectionJDBC; |
|
|
|
const connectionPool = connectionData.connectionPool; |
|
|
|
const connectionPoolAttr = connectionData.connectionPoolAttr; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
connectionType: connectionType.JDBC, |
|
|
|
connectionType: connectionType.JDBC, |
|
|
|
connectionId: this.form.connectionName.getValue(), |
|
|
|
connectionId: this.form.connectionName.getValue(), |
|
|
|
connectionName: this.form.connectionName.getValue(), |
|
|
|
connectionName: this.form.connectionName.getValue(), |
|
|
|
connectionData: { |
|
|
|
connectionData: { |
|
|
|
database: this.form.database.getValue(), |
|
|
|
database: connectionData.database, |
|
|
|
connectionName: this.form.connectionName.getValue(), |
|
|
|
connectionName: this.form.connectionName.getValue(), |
|
|
|
driver: this.form.driver.getValue()[0], |
|
|
|
driver: this.form.driver.getValue(), |
|
|
|
url: this.form.url.getValue(), |
|
|
|
url: this.form.url.getValue(), |
|
|
|
user: this.form.user.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.encode(this.form.password.getValue()), |
|
|
@ -613,15 +624,15 @@ export class FormJdbc extends BI.Widget { |
|
|
|
creator: Dec ? Dec.personal.username : '', |
|
|
|
creator: Dec ? Dec.personal.username : '', |
|
|
|
principal: this.form.principal.getValue(), |
|
|
|
principal: this.form.principal.getValue(), |
|
|
|
keyPath: this.form.principal.getValue(), |
|
|
|
keyPath: this.form.principal.getValue(), |
|
|
|
connectionPool: { |
|
|
|
connectionPoolAttr: { |
|
|
|
initialSize: this.form.initialSize.getValue(), |
|
|
|
initialSize: this.form.initialSize.getValue(), |
|
|
|
maxActive: this.form.maxActive.getValue(), |
|
|
|
maxActive: this.form.maxActive.getValue(), |
|
|
|
maxIdle: this.form.maxIdle.getValue(), |
|
|
|
maxIdle: this.form.maxIdle.getValue(), |
|
|
|
maxWait: this.form.maxWait.getValue(), |
|
|
|
maxWait: this.form.maxWait.getValue(), |
|
|
|
validationQuery: this.form.validationQuery.getValue(), |
|
|
|
validationQuery: this.form.validationQuery.getValue(), |
|
|
|
testOnBorrow: this.form.testOnBorrow.getValue()[0] || connectionPool.testOnBorrow, |
|
|
|
testOnBorrow: this.form.testOnBorrow.getValue()[0] || connectionPoolAttr.testOnBorrow, |
|
|
|
testOnReturn: this.form.testOnReturn.getValue()[0] || connectionPool.testOnReturn, |
|
|
|
testOnReturn: this.form.testOnReturn.getValue()[0] || connectionPoolAttr.testOnReturn, |
|
|
|
testWhileIdle: this.form.testWhileIdle.getValue()[0] || connectionPool.testWhileIdle, |
|
|
|
testWhileIdle: this.form.testWhileIdle.getValue()[0] || connectionPoolAttr.testWhileIdle, |
|
|
|
timeBetweenEvictionRunsMillis: this.form.timeBetweenEvictionRunsMillis.getValue(), |
|
|
|
timeBetweenEvictionRunsMillis: this.form.timeBetweenEvictionRunsMillis.getValue(), |
|
|
|
numTestsPerEvictionRun: this.form.numTestsPerEvictionRun.getValue(), |
|
|
|
numTestsPerEvictionRun: this.form.numTestsPerEvictionRun.getValue(), |
|
|
|
minEvictableIdleTimeMillis: this.form.minEvictableIdleTimeMillis.getValue(), |
|
|
|
minEvictableIdleTimeMillis: this.form.minEvictableIdleTimeMillis.getValue(), |
|
|
|