|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { shortcut } from '@core/core'; |
|
|
|
|
import { Vertical, TextEditor, TextValueCombo, Label, TextAreaEditor, Editor, EdirotIconCheckCombo, Left, TextButton, Layout } from 'ui'; |
|
|
|
|
import { Vertical, Left, Layout } from 'ui'; |
|
|
|
|
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; |
|
|
|
|
import { FormItemXtype } from '../../components/form_item/form_item'; |
|
|
|
|
import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings'; |
|
|
|
@ -8,6 +8,7 @@ import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from
|
|
|
|
|
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; |
|
|
|
|
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker'; |
|
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
|
import { Editor, EditorIconCheckCombo, Label, TextAreaEditor, TextEditor, TextValueCombo } from '@fui/core'; |
|
|
|
|
const api = new ApiFactory().create(); |
|
|
|
|
|
|
|
|
|
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc'; |
|
|
|
@ -95,12 +96,12 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: EdirotIconCheckCombo, |
|
|
|
|
type: BI.EditorIconCheckCombo.xtype, |
|
|
|
|
$testId: 'dec-editor-icon-check-combo', |
|
|
|
|
$value: 'driver', |
|
|
|
|
width: 300, |
|
|
|
|
value: driver, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: EditorIconCheckCombo) => { |
|
|
|
|
this.form.driver = _ref; |
|
|
|
|
}, |
|
|
|
|
items: this.getDrivers(), |
|
|
|
@ -124,7 +125,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextEditor, |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
|
$value: 'database-name', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
@ -145,7 +146,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextEditor, |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
|
$value: 'database-host', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
@ -193,11 +194,11 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'), |
|
|
|
|
invisible: !databaseType.kerberos, |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextValueCombo, |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
|
$value: 'auth-type', |
|
|
|
|
width: 300, |
|
|
|
|
value: authType, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.authType = _ref; |
|
|
|
|
}, |
|
|
|
|
items: [ |
|
|
|
@ -233,13 +234,13 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
this.formUser = _ref; |
|
|
|
|
}, |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextEditor, |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
|
$value: 'username', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: user, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextEditor) => { |
|
|
|
|
this.form.user = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -252,7 +253,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
this.formPassword = _ref; |
|
|
|
|
}, |
|
|
|
|
forms: [{ |
|
|
|
|
type: Editor, |
|
|
|
|
type: BI.Editor.xtype, |
|
|
|
|
$value: 'password', |
|
|
|
|
cls: 'bi-border bi-border-radius', |
|
|
|
|
width: 300, |
|
|
|
@ -262,7 +263,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
inputType: 'password', |
|
|
|
|
autocomplete: 'new-password', |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Password'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: Editor) => { |
|
|
|
|
this.form.password = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -275,13 +276,13 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
this.formPrincipal = _ref; |
|
|
|
|
}, |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextEditor, |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
|
$value: 'principal', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: principal, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Principal'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextEditor) => { |
|
|
|
|
this.form.principal = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -294,7 +295,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
this.formKeyPath = _ref; |
|
|
|
|
}, |
|
|
|
|
forms: [{ |
|
|
|
|
type: Editor, |
|
|
|
|
type: BI.Editor.xtype, |
|
|
|
|
$value: 'key-path', |
|
|
|
|
cls: 'bi-border', |
|
|
|
|
width: 300, |
|
|
|
@ -302,18 +303,18 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
allowBlank: true, |
|
|
|
|
value: keyPath, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_KeyPath'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: Editor) => { |
|
|
|
|
this.form.keyPath = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label, |
|
|
|
|
type: BI.Label.xtype, |
|
|
|
|
cls: 'bi-tips', |
|
|
|
|
textAlign: 'left', |
|
|
|
|
invisible: true, |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_JDBC_Warning'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: Label) => { |
|
|
|
|
this.labelTips = _ref; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -321,12 +322,12 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextValueCombo, |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
|
$value: 'original-charset-name', |
|
|
|
|
width: 300, |
|
|
|
|
value: originalCharsetName ? originalCharsetName : '', |
|
|
|
|
items: CONNECT_CHARSET, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.originalCharsetName = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -341,27 +342,27 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
items: [{ |
|
|
|
|
type: Left, |
|
|
|
|
items: [{ |
|
|
|
|
type: TextButton, |
|
|
|
|
type: BI.TextButton.xtype, |
|
|
|
|
cls: 'bi-high-light', |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_Click_Connect_Database'), |
|
|
|
|
handler: () => { |
|
|
|
|
this.fireEvent('EVENT_TEST_CONNECTION'); |
|
|
|
|
}, |
|
|
|
|
}, { |
|
|
|
|
type: Label, |
|
|
|
|
type: BI.Label.xtype, |
|
|
|
|
cls: 'bi-tips', |
|
|
|
|
lgap: 3, |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_Read_Mode_List'), |
|
|
|
|
}], |
|
|
|
|
}, { |
|
|
|
|
type: TextValueCombo, |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
|
$value: 'schema', |
|
|
|
|
width: 300, |
|
|
|
|
vgap: 15, |
|
|
|
|
disabled: true, |
|
|
|
|
value: schema, |
|
|
|
|
items: schema ? [{ text: schema, value:schema }] : [], |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.schema = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -376,13 +377,13 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextEditor, |
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
|
$value: 'database-url', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: url, |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextEditor) => { |
|
|
|
|
this.form.url = _ref; |
|
|
|
|
}, |
|
|
|
|
listeners: [{ |
|
|
|
@ -521,7 +522,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label, |
|
|
|
|
type: BI.Label.xtype, |
|
|
|
|
lgap: 5, |
|
|
|
|
height: CONNECTION_LAYOUT.labelHeight, |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Millisecond'), |
|
|
|
@ -532,7 +533,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextAreaEditor, |
|
|
|
|
type: BI.TextAreaEditor.xtype, |
|
|
|
|
$value: 'validation-query', |
|
|
|
|
cls: 'bi-border', |
|
|
|
|
allowBlank: true, |
|
|
|
@ -540,7 +541,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
value: validationQuery, |
|
|
|
|
width: 300, |
|
|
|
|
height: 100, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextAreaEditor) => { |
|
|
|
|
this.form.validationQuery = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -549,14 +550,14 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextValueCombo, |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
|
$value: 'check', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: testOnBorrow, |
|
|
|
|
items: this.getBooleanItem(), |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.testOnBorrow = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -565,14 +566,14 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextValueCombo, |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
|
$value: 'test-on-return', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: testOnReturn, |
|
|
|
|
items: this.getBooleanItem(), |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.testOnReturn = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -581,14 +582,14 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
type: FormItemXtype, |
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextValueCombo, |
|
|
|
|
type: BI.TextValueCombo.xtype, |
|
|
|
|
$value: 'test-while-idle', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: testWhileIdle, |
|
|
|
|
items: this.getBooleanItem(), |
|
|
|
|
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.testWhileIdle = _ref; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -614,7 +615,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label, |
|
|
|
|
type: BI.Label.xtype, |
|
|
|
|
lgap: 5, |
|
|
|
|
height: CONNECTION_LAYOUT.labelHeight, |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Millisecond'), |
|
|
|
@ -662,7 +663,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label, |
|
|
|
|
type: BI.Label.xtype, |
|
|
|
|
lgap: 5, |
|
|
|
|
height: CONNECTION_LAYOUT.labelHeight, |
|
|
|
|
text: BI.i18nText('BI-Basic_Seconds'), |
|
|
|
|