|
|
@ -6,7 +6,7 @@ import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud |
|
|
|
import { connectionType } from '@constants/env'; |
|
|
|
import { connectionType } from '@constants/env'; |
|
|
|
import { CONNECT_CHARSET, CONNECTION_LAYOUT } from '@constants/constant'; |
|
|
|
import { CONNECT_CHARSET, CONNECTION_LAYOUT } 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'; |
|
|
|
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 { |
|
|
@ -71,7 +71,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Name'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Name'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
value: connectionName, |
|
|
|
value: connectionName, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
@ -167,13 +167,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: port, |
|
|
|
value: port, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
|
|
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'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.port = _ref; |
|
|
|
this.form.port = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -403,12 +406,15 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: initialSize, |
|
|
|
value: initialSize, |
|
|
|
|
|
|
|
validationChecker: [{ |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.initialSize = _ref; |
|
|
|
this.form.initialSize = _ref; |
|
|
@ -419,13 +425,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: maxActive, |
|
|
|
value: maxActive, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
|
|
|
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'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.maxActive = _ref; |
|
|
|
this.form.maxActive = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -435,13 +444,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: maxIdle, |
|
|
|
value: maxIdle, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
|
|
|
|
|
|
|
validationChecker: [{ |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.maxIdle = _ref; |
|
|
|
this.form.maxIdle = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -451,13 +463,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
forms: [{ |
|
|
|
forms: [{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: minIdle, |
|
|
|
value: minIdle, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
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'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.minIdle = _ref; |
|
|
|
this.form.minIdle = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -468,13 +483,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
|
|
|
forms: [ |
|
|
|
forms: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: maxWait, |
|
|
|
value: maxWait, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
|
|
|
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'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.maxWait = _ref; |
|
|
|
this.form.maxWait = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -552,13 +570,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), |
|
|
|
forms: [ |
|
|
|
forms: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: timeBetweenEvictionRunsMillis, |
|
|
|
value: timeBetweenEvictionRunsMillis, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), |
|
|
|
|
|
|
|
validationChecker: [{ |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Number'), |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Number'), |
|
|
|
validationChecker: (value: string) => this.checkNumber(value), |
|
|
|
checker: (value: string) => this.checkNumber(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.timeBetweenEvictionRunsMillis = _ref; |
|
|
|
this.form.timeBetweenEvictionRunsMillis = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -574,13 +595,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
type: FormItemXtype, |
|
|
|
type: FormItemXtype, |
|
|
|
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: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: numTestsPerEvictionRun, |
|
|
|
value: numTestsPerEvictionRun, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'), |
|
|
|
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'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.numTestsPerEvictionRun = _ref; |
|
|
|
this.form.numTestsPerEvictionRun = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -591,13 +615,16 @@ export class FormJdbc extends BI.Widget { |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
|
|
|
forms: [ |
|
|
|
forms: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: TextEditor, |
|
|
|
type: TextCheckerXtype, |
|
|
|
width: 300, |
|
|
|
width: 300, |
|
|
|
allowBlank: true, |
|
|
|
allowBlank: true, |
|
|
|
value: minEvictableIdleTimeMillis, |
|
|
|
value: minEvictableIdleTimeMillis, |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
|
|
|
|
|
|
|
validationChecker: [{ |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), |
|
|
|
validationChecker: (value: string) => this.checkInteger(value), |
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
|
|
|
autoFix: true, |
|
|
|
|
|
|
|
}], |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.form.minEvictableIdleTimeMillis = _ref; |
|
|
|
this.form.minEvictableIdleTimeMillis = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -615,6 +642,10 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public setError(value: string) { |
|
|
|
|
|
|
|
this.form.connectionName.setError(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private checkInteger(value: string) { |
|
|
|
private checkInteger(value: string) { |
|
|
|
return /^[\d]+$/.test(value); |
|
|
|
return /^[\d]+$/.test(value); |
|
|
|
} |
|
|
|
} |
|
|
|