|
|
@ -7,6 +7,9 @@ import { connectionType } from '@constants/env'; |
|
|
|
import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; |
|
|
|
import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; |
|
|
|
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; |
|
|
|
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; |
|
|
|
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; |
|
|
|
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; |
|
|
|
|
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
|
|
|
|
const api = new ApiFactory().create(); |
|
|
|
|
|
|
|
|
|
|
|
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; |
|
|
|
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; |
|
|
|
@shortcut(FormJdbcXtype) |
|
|
|
@shortcut(FormJdbcXtype) |
|
|
|
export class FormJdbc extends BI.Widget { |
|
|
|
export class FormJdbc extends BI.Widget { |
|
|
@ -78,6 +81,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Name'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Name'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'connection-name', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
value: connectionName, |
|
|
|
value: connectionName, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
@ -92,6 +96,8 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: EdirotIconCheckCombo, |
|
|
|
type: EdirotIconCheckCombo, |
|
|
|
|
|
|
|
$testId: 'dec-editor-icon-check-combo', |
|
|
|
|
|
|
|
$value: 'driver', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
value: driver, |
|
|
|
value: driver, |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
@ -119,6 +125,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextEditor, |
|
|
|
|
|
|
|
$value: 'database-name', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
@ -139,6 +146,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextEditor, |
|
|
|
|
|
|
|
$value: 'database-host', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: host, |
|
|
|
value: host, |
|
|
@ -159,6 +167,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'database-port', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: port, |
|
|
|
value: port, |
|
|
@ -185,6 +194,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
invisible: !databaseType.kerberos, |
|
|
|
invisible: !databaseType.kerberos, |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextValueCombo, |
|
|
|
type: TextValueCombo, |
|
|
|
|
|
|
|
$value: 'auth-type', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
value: authType, |
|
|
|
value: authType, |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
@ -224,6 +234,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextEditor, |
|
|
|
|
|
|
|
$value: 'username', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: user, |
|
|
|
value: user, |
|
|
@ -242,6 +253,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: Editor, |
|
|
|
type: Editor, |
|
|
|
|
|
|
|
$value: 'password', |
|
|
|
cls: 'bi-border bi-border-radius', |
|
|
|
cls: 'bi-border bi-border-radius', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
height: 20, |
|
|
|
height: 20, |
|
|
@ -263,6 +275,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextEditor, |
|
|
|
|
|
|
|
$value: 'principal', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: principal, |
|
|
|
value: principal, |
|
|
@ -281,6 +294,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: Editor, |
|
|
|
type: Editor, |
|
|
|
|
|
|
|
$value: 'key-path', |
|
|
|
cls: 'bi-border', |
|
|
|
cls: 'bi-border', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
height: 20, |
|
|
|
height: 20, |
|
|
@ -307,6 +321,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextValueCombo, |
|
|
|
type: TextValueCombo, |
|
|
|
|
|
|
|
$value: 'original-charset-name', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
value: originalCharsetName ? originalCharsetName : '', |
|
|
|
value: originalCharsetName ? originalCharsetName : '', |
|
|
|
items: CONNECT_CHARSET, |
|
|
|
items: CONNECT_CHARSET, |
|
|
@ -339,6 +354,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}], |
|
|
|
}], |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: TextValueCombo, |
|
|
|
type: TextValueCombo, |
|
|
|
|
|
|
|
$value: 'schema', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
vgap: 15, |
|
|
|
vgap: 15, |
|
|
|
disabled: true, |
|
|
|
disabled: true, |
|
|
@ -360,6 +376,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextEditor, |
|
|
|
|
|
|
|
$value: 'database-url', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: url, |
|
|
|
value: url, |
|
|
@ -407,6 +424,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'initial-size', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: initialSize, |
|
|
|
value: initialSize, |
|
|
@ -426,6 +444,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'max-active', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: maxActive, |
|
|
|
value: maxActive, |
|
|
@ -445,6 +464,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'max-idle', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: maxIdle, |
|
|
|
value: maxIdle, |
|
|
@ -464,6 +484,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'min-idle', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: minIdle, |
|
|
|
value: minIdle, |
|
|
@ -484,6 +505,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
forms: [ |
|
|
|
forms: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'max-wait', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: maxWait, |
|
|
|
value: maxWait, |
|
|
@ -510,6 +532,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextAreaEditor, |
|
|
|
type: TextAreaEditor, |
|
|
|
|
|
|
|
$value: 'validation-query', |
|
|
|
cls: 'bi-border', |
|
|
|
cls: 'bi-border', |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), |
|
|
@ -526,6 +549,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextValueCombo, |
|
|
|
type: TextValueCombo, |
|
|
|
|
|
|
|
$value: 'check', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: testOnBorrow, |
|
|
|
value: testOnBorrow, |
|
|
@ -541,6 +565,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextValueCombo, |
|
|
|
type: TextValueCombo, |
|
|
|
|
|
|
|
$value: 'test-on-return', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: testOnReturn, |
|
|
|
value: testOnReturn, |
|
|
@ -556,6 +581,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextValueCombo, |
|
|
|
type: TextValueCombo, |
|
|
|
|
|
|
|
$value: 'test-while-idle', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: testWhileIdle, |
|
|
|
value: testWhileIdle, |
|
|
@ -572,6 +598,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
forms: [ |
|
|
|
forms: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'test-between-evicition-millis', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: timeBetweenEvictionRunsMillis, |
|
|
|
value: timeBetweenEvictionRunsMillis, |
|
|
@ -598,6 +625,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'test-pereviction-run-num', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: numTestsPerEvictionRun, |
|
|
|
value: numTestsPerEvictionRun, |
|
|
@ -618,6 +646,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
forms: [ |
|
|
|
forms: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: TextCheckerXtype, |
|
|
|
type: TextCheckerXtype, |
|
|
|
|
|
|
|
$value: 'min-evictable-idle-time-millis', |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: false, |
|
|
|
allowBlank: false, |
|
|
|
value: minEvictableIdleTimeMillis, |
|
|
|
value: minEvictableIdleTimeMillis, |
|
|
@ -742,7 +771,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
driver: this.form.driver.getValue(), |
|
|
|
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.Providers.getProvider('dec.provider.cipher').getCipher(this.form.password.getValue()), |
|
|
|
password: this.oldPassword === this.form.password.getValue() ? this.oldPassword : api.getCipher(this.form.password.getValue()), |
|
|
|
queryType: '', |
|
|
|
queryType: '', |
|
|
|
newCharsetName: originalCharsetName ? 'gbk' : '', // 后台要求,originalCharsetName不为空时,newCharsetName为gbk
|
|
|
|
newCharsetName: originalCharsetName ? 'gbk' : '', // 后台要求,originalCharsetName不为空时,newCharsetName为gbk
|
|
|
|
originalCharsetName, |
|
|
|
originalCharsetName, |
|
|
@ -761,7 +790,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
validationQuery: this.form.validationQuery.getValue(), |
|
|
|
validationQuery: this.form.validationQuery.getValue(), |
|
|
|
testOnBorrow: BI.size(this.form.testOnBorrow.getValue()) > 0 ? this.form.testOnBorrow.getValue()[0] : connectionPoolAttr.testOnBorrow, |
|
|
|
testOnBorrow: BI.size(this.form.testOnBorrow.getValue()) > 0 ? this.form.testOnBorrow.getValue()[0] : connectionPoolAttr.testOnBorrow, |
|
|
|
testOnReturn: BI.size(this.form.testOnReturn.getValue()) > 0 ? this.form.testOnReturn.getValue()[0] : connectionPoolAttr.testOnReturn, |
|
|
|
testOnReturn: BI.size(this.form.testOnReturn.getValue()) > 0 ? this.form.testOnReturn.getValue()[0] : connectionPoolAttr.testOnReturn, |
|
|
|
testWhileIdle: BI.size(this.form.testOnReturn.getValue()) > 0 ? this.form.testWhileIdle.getValue()[0] : connectionPoolAttr.testWhileIdle, |
|
|
|
testWhileIdle: BI.size(this.form.testWhileIdle.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(), |
|
|
|