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