|
|
|
@ -1,19 +1,19 @@
|
|
|
|
|
import { shortcut } from '@core/core'; |
|
|
|
|
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; |
|
|
|
|
import { FormItemXtype } from '../../components/form_item/form_item'; |
|
|
|
|
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; |
|
|
|
|
import { FormItem } from '../../components/form_item/form_item'; |
|
|
|
|
import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings'; |
|
|
|
|
import { connectionType } from '@constants/env'; |
|
|
|
|
import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; |
|
|
|
|
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; |
|
|
|
|
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; |
|
|
|
|
import { TextChecker } from '../../../../components/text_checker/text_checker'; |
|
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
|
import { Editor, EditorIconCheckCombo, Label, TextAreaEditor, TextEditor, TextValueCombo, VerticalLayout } from '@fui/core'; |
|
|
|
|
import { FormItem } from '../../../connection/components/form_item/form_item'; |
|
|
|
|
const api = new ApiFactory().create(); |
|
|
|
|
|
|
|
|
|
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; |
|
|
|
|
@shortcut(FormJdbcXtype) |
|
|
|
|
@shortcut() |
|
|
|
|
export class FormJdbc extends BI.Widget { |
|
|
|
|
static xtype = 'dec.dcm.maintain.form.jdbc'; |
|
|
|
|
|
|
|
|
|
props = { |
|
|
|
|
formData: {} as Connection, |
|
|
|
|
} |
|
|
|
@ -77,22 +77,22 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
vgap, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Name'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'connection-name', |
|
|
|
|
width: 300, |
|
|
|
|
value: connectionName, |
|
|
|
|
allowBlank: true, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.connectionName = _ref; |
|
|
|
|
}, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Data_Connections'), |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.EditorIconCheckCombo.xtype, |
|
|
|
@ -121,7 +121,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
@ -142,7 +142,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
@ -163,10 +163,10 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'database-port', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
@ -177,7 +177,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.port = _ref; |
|
|
|
|
}, |
|
|
|
|
listeners: [{ |
|
|
|
@ -189,7 +189,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), |
|
|
|
|
invisible: !databaseType.kerberos, |
|
|
|
|
forms: [{ |
|
|
|
@ -226,7 +226,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), |
|
|
|
|
invisible: !!authType, |
|
|
|
|
ref: (_ref: FormItem) => { |
|
|
|
@ -245,7 +245,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Password'), |
|
|
|
|
invisible: !!authType, |
|
|
|
|
ref: (_ref: FormItem) => { |
|
|
|
@ -268,7 +268,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Principal'), |
|
|
|
|
invisible: !authType, |
|
|
|
|
ref: (_ref: FormItem) => { |
|
|
|
@ -287,7 +287,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_KeyPath'), |
|
|
|
|
invisible: !authType, |
|
|
|
|
ref: (_ref: FormItem) => { |
|
|
|
@ -318,7 +318,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
@ -332,7 +332,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
invisible: !databaseType.hasSchema, |
|
|
|
|
height: 64, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'), |
|
|
|
@ -373,7 +373,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
bgap: 8, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
@ -397,7 +397,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: CollapseXtype, |
|
|
|
|
type: Collapse.xtype, |
|
|
|
|
bgap: -15, |
|
|
|
|
width: 70, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'), |
|
|
|
@ -420,11 +420,11 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
tgap: 15, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'initial-size', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -435,16 +435,16 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.initialSize = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'max-active', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -455,16 +455,16 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.maxActive = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'max-idle', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -475,16 +475,16 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.maxIdle = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'min-idle', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -495,17 +495,17 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.minIdle = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'), |
|
|
|
|
forms: [ |
|
|
|
|
{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'max-wait', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -516,7 +516,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.maxWait = _ref; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -529,7 +529,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextAreaEditor.xtype, |
|
|
|
@ -546,7 +546,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
@ -562,7 +562,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
@ -578,7 +578,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
@ -594,11 +594,11 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'), |
|
|
|
|
forms: [ |
|
|
|
|
{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'test-between-evicition-millis', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -609,7 +609,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkNumber(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.timeBetweenEvictionRunsMillis = _ref; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -622,10 +622,10 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'test-pereviction-run-num', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -636,17 +636,17 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.numTestsPerEvictionRun = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: FormItemXtype, |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'), |
|
|
|
|
forms: [ |
|
|
|
|
{ |
|
|
|
|
type: TextCheckerXtype, |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'min-evictable-idle-time-millis', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: false, |
|
|
|
@ -657,7 +657,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
checker: (value: string) => this.checkInteger(value), |
|
|
|
|
autoFix: true, |
|
|
|
|
}, valueRangeConfig], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextChecker) => { |
|
|
|
|
this.form.minEvictableIdleTimeMillis = _ref; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|