|
|
|
@ -86,12 +86,15 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
// more
|
|
|
|
|
validationQuery: null, |
|
|
|
|
testOnBorrow: null, |
|
|
|
|
keepAlive: null, |
|
|
|
|
testOnReturn: null, |
|
|
|
|
testWhileIdle: null, |
|
|
|
|
timeBetweenEvictionRunsMillis: null, |
|
|
|
|
numTestsPerEvictionRun: null, |
|
|
|
|
minIdle: null, |
|
|
|
|
minEvictableIdleTimeMillis: null, |
|
|
|
|
maxEvictableIdleTimeMillis: null, |
|
|
|
|
keepAliveBetweenTimeMillis: null, |
|
|
|
|
fetchSize: null, |
|
|
|
|
// 并行装载
|
|
|
|
|
parallelLoad: { |
|
|
|
@ -152,12 +155,15 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
maxWait, |
|
|
|
|
validationQuery, |
|
|
|
|
testOnBorrow, |
|
|
|
|
keepAlive, |
|
|
|
|
testOnReturn, |
|
|
|
|
testWhileIdle, |
|
|
|
|
timeBetweenEvictionRunsMillis, |
|
|
|
|
numTestsPerEvictionRun, |
|
|
|
|
minIdle, |
|
|
|
|
minEvictableIdleTimeMillis, |
|
|
|
|
maxEvictableIdleTimeMillis, |
|
|
|
|
keepAliveBetweenTimeMillis, |
|
|
|
|
} = connectionPoolAttr as ConnectionPoolJDBC; |
|
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
|
this.databaseType = databaseType; |
|
|
|
@ -222,6 +228,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
this.sslCollapse.setCollapse(true); |
|
|
|
|
this.sslCollapse.setVisible(this.getSslSetEnabled()); |
|
|
|
|
!BI.isUndefined(databaseType.hasSchemas) && this.schemaForm.setVisible(databaseType.hasSchemas[version]); |
|
|
|
|
!BI.isUndefined(databaseType.versionConfig?.[version]?.fetchSize) && this.form.fetchSize.setValue(databaseType.versionConfig[version].fetchSize); |
|
|
|
|
this.form.driver.setDefaultDrivers(version); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -356,7 +363,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
@ -894,7 +901,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
@ -925,6 +932,25 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
// 空闲连接可用性定期检查
|
|
|
|
|
{ |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow'), |
|
|
|
|
forms: [ |
|
|
|
|
{ |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
|
$value: 'keep-alive-check', |
|
|
|
|
width: EDITOR_WIDTH, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: keepAlive, |
|
|
|
|
items: this.getBooleanItem(), |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow'), |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.keepAlive = _ref; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
// 校验语句
|
|
|
|
|
{ |
|
|
|
|
type: FormItem.xtype, |
|
|
|
@ -959,7 +985,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
@ -1068,7 +1094,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
allowBlank: false, |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
@ -1331,7 +1357,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
value: initialSize, |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
@ -1357,7 +1383,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
@ -1422,6 +1448,11 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkNumber(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Util-Must_Less_Than', BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow_Threshold')), |
|
|
|
|
checker: (value: string) => this.checkNumber(value) && (parseInt(value) < parseInt(this.form.keepAliveBetweenTimeMillis.getValue())), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
valueRangeConfig, |
|
|
|
|
], |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
@ -1449,7 +1480,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
@ -1474,8 +1505,13 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 30), |
|
|
|
|
checker: (value: string) => this.checkNumber(value) && (parseInt(value) >= 30), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Util-Must_Less_Than', BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Evictable_Idle_Time_Millis')), |
|
|
|
|
checker: (value: string) => parseInt(value) < parseInt(this.form.maxEvictableIdleTimeMillis.getValue()), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
valueRangeConfig, |
|
|
|
@ -1492,6 +1528,80 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Evictable_Idle_Time_Millis'), |
|
|
|
|
forms: [ |
|
|
|
|
{ |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'max-evictable-idle-time-millis', |
|
|
|
|
width: EDITOR_WIDTH, |
|
|
|
|
allowBlank: false, |
|
|
|
|
value: maxEvictableIdleTimeMillis, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Evictable_Idle_Time_Millis'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 0), |
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Util-Must_More_Than', BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Evictable_Idle_Time_Millis'), BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis')), |
|
|
|
|
checker: (value: string) => parseInt(value) > parseInt(this.form.minEvictableIdleTimeMillis.getValue()), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
valueRangeConfig, |
|
|
|
|
], |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.maxEvictableIdleTimeMillis = _ref; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: BI.Label.xtype, |
|
|
|
|
lgap: 5, |
|
|
|
|
height: CONNECTION_LAYOUT.labelHeight, |
|
|
|
|
text: BI.i18nText('BI-Basic_Seconds'), |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow_Threshold'), |
|
|
|
|
forms: [ |
|
|
|
|
{ |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'keep-live-between-time-millis', |
|
|
|
|
width: EDITOR_WIDTH, |
|
|
|
|
allowBlank: false, |
|
|
|
|
value: keepAliveBetweenTimeMillis, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow_Threshold'), |
|
|
|
|
validationChecker: [ |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer', 30000), |
|
|
|
|
checker: (value: string) => this.checkNumber(value) && (parseInt(value) > 30000), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
errorText: BI.i18nText('Dec-Util-Must_More_Than', BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow_Threshold'), BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis')), |
|
|
|
|
checker: (value: string) => this.checkNumber(value) && (parseInt(value) > parseInt(this.form.timeBetweenEvictionRunsMillis.getValue())), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, |
|
|
|
|
valueRangeConfig, |
|
|
|
|
], |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.keepAliveBetweenTimeMillis = _ref; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: BI.Label.xtype, |
|
|
|
|
lgap: 5, |
|
|
|
|
height: CONNECTION_LAYOUT.labelHeight, |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Millisecond'), |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
el: { |
|
|
|
|
type: BI.VerticalLayout.xtype, |
|
|
|
@ -1740,11 +1850,14 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
maxWait: this.form.maxWait.getValue(), |
|
|
|
|
validationQuery: api.getCipher(this.form.validationQuery.getValue()), |
|
|
|
|
testOnBorrow: BI.size(this.form.testOnBorrow.getValue()) > 0 ? this.form.testOnBorrow.getValue()[0] : connectionPoolAttr.testOnBorrow, |
|
|
|
|
keepAlive: BI.size(this.form.keepAlive.getValue()) > 0 ? this.form.keepAlive.getValue()[0] : connectionPoolAttr.keepAlive, |
|
|
|
|
testOnReturn: BI.size(this.form.testOnReturn.getValue()) > 0 ? this.form.testOnReturn.getValue()[0] : connectionPoolAttr.testOnReturn, |
|
|
|
|
testWhileIdle: BI.size(this.form.testWhileIdle.getValue()) > 0 ? this.form.testWhileIdle.getValue()[0] : connectionPoolAttr.testWhileIdle, |
|
|
|
|
timeBetweenEvictionRunsMillis: this.form.timeBetweenEvictionRunsMillis.getValue(), |
|
|
|
|
numTestsPerEvictionRun: this.form.numTestsPerEvictionRun.getValue(), |
|
|
|
|
minEvictableIdleTimeMillis: this.form.minEvictableIdleTimeMillis.getValue(), |
|
|
|
|
maxEvictableIdleTimeMillis: this.form.maxEvictableIdleTimeMillis.getValue(), |
|
|
|
|
keepAliveBetweenTimeMillis: this.form.keepAliveBetweenTimeMillis.getValue(), |
|
|
|
|
}, |
|
|
|
|
// 并行装载
|
|
|
|
|
parallelLoad: { |
|
|
|
|