|
|
@ -38,7 +38,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
authType: null, |
|
|
|
authType: null, |
|
|
|
principal: null, |
|
|
|
principal: null, |
|
|
|
keyPath: null, |
|
|
|
keyPath: null, |
|
|
|
newCharsetName: null, |
|
|
|
originalCharsetName: null, |
|
|
|
schema: null, |
|
|
|
schema: null, |
|
|
|
url: null, |
|
|
|
url: null, |
|
|
|
initialSize: null, |
|
|
|
initialSize: null, |
|
|
@ -51,14 +51,14 @@ export class FormJdbc extends BI.Widget { |
|
|
|
testWhileIdle: null, |
|
|
|
testWhileIdle: null, |
|
|
|
timeBetweenEvictionRunsMillis: null, |
|
|
|
timeBetweenEvictionRunsMillis: null, |
|
|
|
numTestsPerEvictionRun: null, |
|
|
|
numTestsPerEvictionRun: null, |
|
|
|
|
|
|
|
minIdle: null, |
|
|
|
minEvictableIdleTimeMillis: null, |
|
|
|
minEvictableIdleTimeMillis: null, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const { connectionName, connectionData } = this.options.formData; |
|
|
|
const { connectionName, connectionData } = this.options.formData; |
|
|
|
const { driver, user, password, newCharsetName, schema, url, connectionPoolAttr, database, authType, principal, keyPath } = connectionData as ConnectionJDBC; |
|
|
|
const { driver, user, password, originalCharsetName, schema, url, connectionPoolAttr, database, authType, principal, keyPath } = connectionData as ConnectionJDBC; |
|
|
|
// minIdle 暂未使用
|
|
|
|
const { initialSize, maxActive, maxIdle, maxWait, validationQuery, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minIdle, minEvictableIdleTimeMillis } = connectionPoolAttr 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; |
|
|
|
const { host, port, databaseName } = resolveUrlInfo(url); |
|
|
|
const { host, port, databaseName } = resolveUrlInfo(url); |
|
|
@ -316,10 +316,10 @@ export class FormJdbc extends BI.Widget { |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextValueCombo, |
|
|
|
type: TextValueCombo, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
value: newCharsetName ? newCharsetName : '', |
|
|
|
value: originalCharsetName ? originalCharsetName : '', |
|
|
|
items: CONNECT_CHARSET, |
|
|
|
items: CONNECT_CHARSET, |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.newCharsetName = _ref; |
|
|
|
this.form.originalCharsetName = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}], |
|
|
|
}], |
|
|
|
}, |
|
|
|
}, |
|
|
@ -449,6 +449,22 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}], |
|
|
|
}], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
|
|
|
|
forms: [{ |
|
|
|
|
|
|
|
type: TextEditor, |
|
|
|
|
|
|
|
width: 300, |
|
|
|
|
|
|
|
allowBlank: true, |
|
|
|
|
|
|
|
value: minIdle, |
|
|
|
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
|
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
|
|
|
this.form.minIdle = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}], |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
|
|
@ -675,6 +691,8 @@ 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 connectionPoolAttr = connectionData.connectionPoolAttr; |
|
|
|
const connectionPoolAttr = connectionData.connectionPoolAttr; |
|
|
|
|
|
|
|
const originalCharsetName = this.form.originalCharsetName.getValue()[0] || ''; |
|
|
|
|
|
|
|
// TODO 获取表单数据这里待优化
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
connectionType: connectionType.JDBC, |
|
|
|
connectionType: connectionType.JDBC, |
|
|
@ -688,8 +706,8 @@ export class FormJdbc extends BI.Widget { |
|
|
|
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()), |
|
|
|
queryType: '', |
|
|
|
queryType: '', |
|
|
|
newCharsetName: this.form.newCharsetName.getValue()[0] || '', |
|
|
|
newCharsetName: originalCharsetName ? 'gbk' : '', // 后台要求,originalCharsetName不为空时,newCharsetName为gbk
|
|
|
|
originalCharsetName: this.form.newCharsetName.getValue()[0] || '', |
|
|
|
originalCharsetName, |
|
|
|
schema: this.form.schema.getValue()[0], |
|
|
|
schema: this.form.schema.getValue()[0], |
|
|
|
host: this.form.host.getValue(), |
|
|
|
host: this.form.host.getValue(), |
|
|
|
authType: this.form.authType.getValue()[0] || '', |
|
|
|
authType: this.form.authType.getValue()[0] || '', |
|
|
@ -700,11 +718,12 @@ export class FormJdbc extends BI.Widget { |
|
|
|
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(), |
|
|
|
|
|
|
|
minIdle: this.form.minIdle.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] || connectionPoolAttr.testOnBorrow, |
|
|
|
testOnBorrow: BI.size(this.form.testOnBorrow.getValue()) > 0 ? this.form.testOnBorrow.getValue()[0] : connectionPoolAttr.testOnBorrow, |
|
|
|
testOnReturn: this.form.testOnReturn.getValue()[0] || connectionPoolAttr.testOnReturn, |
|
|
|
testOnReturn: BI.size(this.form.testOnReturn.getValue()) > 0 ? this.form.testOnReturn.getValue()[0] : connectionPoolAttr.testOnReturn, |
|
|
|
testWhileIdle: this.form.testWhileIdle.getValue()[0] || connectionPoolAttr.testWhileIdle, |
|
|
|
testWhileIdle: BI.size(this.form.testOnReturn.getValue()) > 0 ? 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(), |
|
|
|