Browse Source

DEC-22408 feat:【迭代】【数据连接支持SSH及SSL】调整gap

feature/x
Cauchy.Ke 3 years ago
parent
commit
f427f41fd8
  1. 3
      src/modules/components/file_chooser/file_chooser.ts
  2. 241
      src/modules/pages/connection/connection_jdbc/connection_jdbc.ts
  3. 859
      src/modules/pages/maintain/forms/components/form.jdbc.ts

3
src/modules/components/file_chooser/file_chooser.ts

@ -37,12 +37,13 @@ export class FileChooser extends BI.Widget {
return { return {
type: BI.VerticalAdaptLayout.xtype, type: BI.VerticalAdaptLayout.xtype,
height: 20, height: 24,
items: [ items: [
{ {
type: BI.SignEditor.xtype, type: BI.SignEditor.xtype,
cls: 'bi-border bi-focus-shadow', cls: 'bi-border bi-focus-shadow',
width, width,
height: 22,
watermark, watermark,
title: value, title: value,
value, value,

241
src/modules/pages/connection/connection_jdbc/connection_jdbc.ts

@ -152,46 +152,47 @@ export class ConnectionJdbc extends BI.Widget {
], ],
}, },
{ {
type: BI.VerticalLayout.xtype, el: {
tgap: -15, type: BI.VerticalLayout.xtype,
vgap, bgap: vgap,
invisible: true, invisible: true,
ref: (_ref: VerticalLayout) => { ref: (_ref: VerticalLayout) => {
this.sshSet = _ref; this.sshSet = _ref;
},
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
value: sshIp,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
value: sshPort,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
value: sshUser,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'),
value: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).text,
}, },
{ items: [
type: FormItem.xtype, {
invisible: sshType !== 'KEY', type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'), name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
value: sshPrivateKeyPath, value: sshIp,
}, },
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).secretFormName, name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
value: sshSecret, value: sshPort,
}, },
], {
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
value: sshUser,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'),
value: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).text,
},
{
type: FormItem.xtype,
invisible: sshType !== 'KEY',
name: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'),
value: sshPrivateKeyPath,
},
{
type: FormItem.xtype,
name: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).secretFormName,
value: sshSecret,
},
],
},
}, },
// ssl设置 // ssl设置
{ {
@ -209,36 +210,37 @@ export class ConnectionJdbc extends BI.Widget {
], ],
}, },
{ {
type: BI.VerticalLayout.xtype, el: {
tgap: -15, type: BI.VerticalLayout.xtype,
vgap, bgap: vgap,
invisible: true, invisible: true,
ref: (_ref: VerticalLayout) => { ref: (_ref: VerticalLayout) => {
this.sslSet = _ref; this.sslSet = _ref;
},
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'),
value: caCertificate,
}, },
{ items: [
type: FormItem.xtype, {
invisible: !caCertificate, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'), name: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'),
value: verifyCa ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'), value: caCertificate,
}, },
{ {
type: FormItem.xtype, type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'), invisible: !caCertificate,
value: sslClientPrivateKey, name: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'),
}, value: verifyCa ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
{ },
type: FormItem.xtype, {
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'), type: FormItem.xtype,
value: sslClientCertificate, name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'),
}, value: sslClientPrivateKey,
], },
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'),
value: sslClientCertificate,
},
],
},
}, },
// 更多设置 // 更多设置
{ {
@ -255,58 +257,59 @@ export class ConnectionJdbc extends BI.Widget {
], ],
}, },
{ {
type: BI.VerticalLayout.xtype, el: {
tgap: -15, type: BI.VerticalLayout.xtype,
vgap, bgap: vgap,
invisible: true, invisible: true,
ref: (_ref: VerticalLayout) => { ref: (_ref: VerticalLayout) => {
this.advancedSet = _ref; this.advancedSet = _ref;
},
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
value: connectionPoolAttr.initialSize,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
value: connectionPoolAttr.minIdle,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
value: connectionPoolAttr.testOnReturn ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
value: connectionPoolAttr.testWhileIdle ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'),
value: connectionPoolAttr.timeBetweenEvictionRunsMillis,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'),
value: connectionPoolAttr.numTestsPerEvictionRun,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'),
value: connectionPoolAttr.minEvictableIdleTimeMillis,
unit: BI.i18nText('BI-Basic_Seconds'),
},
{
type: FormItem.xtype,
invisible: fetchSize < 0 && fetchSize !== -2,
name: 'Fetchsize',
value: fetchSize === -2 ? '' : fetchSize,
}, },
], items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
value: connectionPoolAttr.initialSize,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
value: connectionPoolAttr.minIdle,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
value: connectionPoolAttr.testOnReturn ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
value: connectionPoolAttr.testWhileIdle ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'),
value: connectionPoolAttr.timeBetweenEvictionRunsMillis,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'),
value: connectionPoolAttr.numTestsPerEvictionRun,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'),
value: connectionPoolAttr.minEvictableIdleTimeMillis,
unit: BI.i18nText('BI-Basic_Seconds'),
},
{
type: FormItem.xtype,
invisible: fetchSize < 0 && fetchSize !== -2,
name: 'Fetchsize',
value: fetchSize === -2 ? '' : fetchSize,
},
],
},
}, },
], ],
}; };

859
src/modules/pages/maintain/forms/components/form.jdbc.ts

@ -639,162 +639,166 @@ export class FormJdbc extends BI.Widget {
], ],
}, },
{ {
type: BI.VerticalLayout.xtype, el: {
ref: (_ref: VerticalLayout) => { type: BI.VerticalLayout.xtype,
this.sshSet = _ref; ref: (_ref: VerticalLayout) => {
}, this.sshSet = _ref;
invisible: true,
items: [
{
type: FormItem.xtype,
bgap: -15,
name: BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSH'),
forms: [
{
type: BI.MultiSelectItem.xtype,
ref: (_ref: MultiSelectItem) => {
this.form.usingSsh = _ref;
},
logic: { dynamic: true },
text: BI.i18nText('Dec-Basic_Use') + BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSH'),
selected: usingSsh,
listeners: [
{
eventName: BI.MultiSelectItem.EVENT_CHANGE,
action: () => {
const value = this.form.usingSsh.isSelected();
this.sshForm.setVisible(value);
},
},
],
},
],
}, },
{ bgap: vgap,
type: BI.VerticalLayout.xtype, invisible: true,
ref: (_ref: VerticalLayout) => { items: [
this.sshForm = _ref; {
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSH'),
forms: [
{
type: BI.MultiSelectItem.xtype,
ref: (_ref: MultiSelectItem) => {
this.form.usingSsh = _ref;
},
logic: { dynamic: true },
text: BI.i18nText('Dec-Basic_Use') + BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSH'),
selected: usingSsh,
listeners: [
{
eventName: BI.MultiSelectItem.EVENT_CHANGE,
action: () => {
const value = this.form.usingSsh.isSelected();
this.sshForm.setVisible(value);
},
},
],
},
],
}, },
vgap, {
invisible: !usingSsh, el: {
items: [ type: BI.VerticalLayout.xtype,
{ ref: (_ref: VerticalLayout) => {
type: FormItem.xtype, this.sshForm = _ref;
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'), },
forms: [ bgap: vgap,
invisible: !usingSsh,
items: [
{ {
type: TextChecker.xtype, type: FormItem.xtype,
ref: (_ref: TextChecker) => { name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
this.form.sshIp = _ref; forms: [
}, {
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Host'), type: TextChecker.xtype,
allowBlank: false, ref: (_ref: TextChecker) => {
value: sshIp || 'hostname', this.form.sshIp = _ref;
},
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
allowBlank: false,
value: sshIp || 'hostname',
},
],
}, },
],
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
forms: [
{ {
type: TextChecker.xtype, type: FormItem.xtype,
ref: (_ref: TextChecker) => { name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
this.form.sshPort = _ref; forms: [
},
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
allowBlank: false,
validationChecker: [
{ {
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), type: TextChecker.xtype,
checker: (value: string) => this.checkInteger(value), ref: (_ref: TextChecker) => {
autoFix: true, this.form.sshPort = _ref;
},
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
allowBlank: false,
validationChecker: [
{
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
checker: (value: string) => this.checkInteger(value),
autoFix: true,
},
valueRangeConfig,
],
value: String(sshPort || 22),
}, },
valueRangeConfig,
], ],
value: String(sshPort || 22),
}, },
],
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
forms: [
{ {
type: TextChecker.xtype, type: FormItem.xtype,
ref: (_ref: TextChecker) => { name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
this.form.sshUser = _ref; forms: [
}, {
watermark: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), type: TextChecker.xtype,
value: sshUser, ref: (_ref: TextChecker) => {
this.form.sshUser = _ref;
},
watermark: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
value: sshUser,
},
],
}, },
],
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'),
forms: [
{ {
type: BI.TextValueCombo.xtype, type: FormItem.xtype,
ref: (_ref: TextValueCombo) => { name: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'),
this.form.sshType = _ref; forms: [
},
width: 300,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'),
items: CONNECT_SSH_TYPE,
value: sshType,
listeners: [
{ {
eventName: BI.TextValueCombo.EVENT_CHANGE, type: BI.TextValueCombo.xtype,
action: () => { ref: (_ref: TextValueCombo) => {
const sshType = this.form.sshType.getValue()[0]; this.form.sshType = _ref;
this.onSshTypeChange(sshType);
}, },
width: 300,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'),
items: CONNECT_SSH_TYPE,
value: sshType,
listeners: [
{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action: () => {
const sshType = this.form.sshType.getValue()[0];
this.onSshTypeChange(sshType);
},
},
],
}, },
], ],
}, },
],
},
{
type: FormItem.xtype,
ref: (_ref: FormItem) => {
this.form.sshPrivateKeyPathForm = _ref;
},
name: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'),
forms: [
{ {
type: FileChooser.xtype, type: FormItem.xtype,
ref: (_ref: TextChecker) => { ref: (_ref: FormItem) => {
this.form.sshPrivateKeyPath = _ref; this.form.sshPrivateKeyPathForm = _ref;
}, },
root: 'certificates', name: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'),
watermark: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'), forms: [
value: sshPrivateKeyPath, {
type: FileChooser.xtype,
ref: (_ref: TextChecker) => {
this.form.sshPrivateKeyPath = _ref;
},
root: 'certificates',
watermark: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'),
value: sshPrivateKeyPath,
},
],
}, },
],
},
{
type: FormItem.xtype,
ref: (ref: FormItem) => {
this.form.sshSecretForm = ref;
},
name: BI.i18nText(''),
forms: [
{ {
type: TextChecker.xtype, type: FormItem.xtype,
ref: (_ref: TextChecker) => { ref: (ref: FormItem) => {
this.form.sshSecret = _ref; this.form.sshSecretForm = ref;
}, },
watermark: BI.i18nText(''), name: BI.i18nText(''),
inputType: 'password', forms: [
autocomplete: 'new-password', {
value: sshSecret, type: TextChecker.xtype,
ref: (_ref: TextChecker) => {
this.form.sshSecret = _ref;
},
watermark: BI.i18nText(''),
inputType: 'password',
autocomplete: 'new-password',
value: sshSecret,
},
],
}, },
], ],
}, },
], },
}, ],
], },
}, },
// SSL设置 // SSL设置
{ {
@ -812,114 +816,117 @@ export class FormJdbc extends BI.Widget {
], ],
}, },
{ {
type: BI.VerticalLayout.xtype, el: {
ref: (_ref: VerticalLayout) => { type: BI.VerticalLayout.xtype,
this.sslSet = _ref; ref: (_ref: VerticalLayout) => {
}, this.sslSet = _ref;
invisible: true,
items: [
{
type: FormItem.xtype,
bgap: -15,
name: BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSL'),
forms: [
{
type: BI.MultiSelectItem.xtype,
ref: (_ref: MultiSelectItem) => {
this.form.usingSsl = _ref;
},
logic: { dynamic: true },
text: BI.i18nText('Dec-Basic_Use') + BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSL'),
selected: usingSsl,
listeners: [
{
eventName: BI.MultiSelectItem.EVENT_CHANGE,
action: () => {
const value = this.form.usingSsl.isSelected();
this.sslForm.setVisible(value);
},
},
],
},
],
}, },
{ bgap: vgap,
type: BI.VerticalLayout.xtype, invisible: true,
ref: (_ref: VerticalLayout) => { items: [
this.sslForm = _ref; {
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSL'),
forms: [
{
type: BI.MultiSelectItem.xtype,
ref: (_ref: MultiSelectItem) => {
this.form.usingSsl = _ref;
},
logic: { dynamic: true },
text: BI.i18nText('Dec-Basic_Use') + BI.i18nText('Dec-Dcm_Connection_Tunnel', 'SSL'),
selected: usingSsl,
listeners: [
{
eventName: BI.MultiSelectItem.EVENT_CHANGE,
action: () => {
const value = this.form.usingSsl.isSelected();
this.sslForm.setVisible(value);
},
},
],
},
],
}, },
vgap, {
invisible: !usingSsl, el: {
items: [ type: BI.VerticalLayout.xtype,
{ ref: (_ref: VerticalLayout) => {
type: FormItem.xtype, this.sslForm = _ref;
name: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'), },
forms: [ bgap: vgap,
invisible: !usingSsl,
items: [
{ {
type: FileChooser.xtype, type: FormItem.xtype,
ref: (_ref: FileChooser) => { name: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'),
this.form.caCertificate = _ref; forms: [
}, {
root: 'certificates', type: FileChooser.xtype,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'), ref: (_ref: FileChooser) => {
value: caCertificate, this.form.caCertificate = _ref;
},
root: 'certificates',
watermark: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'),
value: caCertificate,
},
],
}, },
],
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'),
forms: [
{ {
type: BI.TextValueCombo.xtype, type: FormItem.xtype,
ref: (_ref: TextValueCombo) => { name: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'),
this.form.verifyCa = _ref; forms: [
}, {
width: 300, type: BI.TextValueCombo.xtype,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'), ref: (_ref: TextValueCombo) => {
items: this.getBooleanItem(), this.form.verifyCa = _ref;
value: verifyCa, },
width: 300,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'),
items: this.getBooleanItem(),
value: verifyCa,
},
],
}, },
],
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'),
forms: [
{ {
type: FileChooser.xtype, type: FormItem.xtype,
ref: (_ref: FileChooser) => { name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'),
this.form.sslClientPrivateKey = _ref; forms: [
}, {
root: 'certificates', type: FileChooser.xtype,
watermark: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'), ref: (_ref: FileChooser) => {
value: sslClientPrivateKey, this.form.sslClientPrivateKey = _ref;
},
root: 'certificates',
watermark: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'),
value: sslClientPrivateKey,
},
],
}, },
],
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'),
forms: [
{ {
type: FileChooser.xtype, type: FormItem.xtype,
ref: (_ref: FileChooser) => { name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'),
this.form.sslClientCertificate = _ref; forms: [
}, {
root: 'certificates', type: FileChooser.xtype,
watermark: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'), ref: (_ref: FileChooser) => {
value: sslClientCertificate, this.form.sslClientCertificate = _ref;
},
root: 'certificates',
watermark: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'),
value: sslClientCertificate,
},
],
}, },
], ],
}, },
], },
}, ],
], },
}, },
// 高级设置 // 高级设置
{ {
type: Collapse.xtype, type: Collapse.xtype,
bgap: -15,
width: 100, width: 100,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_More_Setting'), name: BI.i18nText('Dec-Dcm_Connection_Form_Database_More_Setting'),
listeners: [ listeners: [
@ -932,226 +939,226 @@ export class FormJdbc extends BI.Widget {
], ],
}, },
{ {
type: BI.VerticalLayout.xtype, el: {
vgap, type: BI.VerticalLayout.xtype,
tgap: -15, bgap: vgap,
invisible: true, invisible: true,
ref: (_ref: VerticalLayout) => { ref: (_ref: VerticalLayout) => {
this.advancedSet = _ref; this.advancedSet = _ref;
}, },
items: [ items: [
{ {
type: FormItem.xtype, type: FormItem.xtype,
tgap: 15, name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'), forms: [
forms: [ {
{ type: TextChecker.xtype,
type: TextChecker.xtype, $value: 'initial-size',
$value: 'initial-size', width: 300,
width: 300, allowBlank: false,
allowBlank: false, value: initialSize,
value: initialSize, validationChecker: [
validationChecker: [ {
{ errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value),
checker: (value: string) => this.checkInteger(value), autoFix: true,
autoFix: true, },
valueRangeConfig,
],
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
ref: (_ref: TextChecker) => {
this.form.initialSize = _ref;
}, },
valueRangeConfig,
],
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
ref: (_ref: TextChecker) => {
this.form.initialSize = _ref;
}, },
}, ],
], },
}, {
{ type: FormItem.xtype,
type: FormItem.xtype, name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'), forms: [
forms: [ {
{ type: TextChecker.xtype,
type: TextChecker.xtype, $value: 'min-idle',
$value: 'min-idle', width: 300,
width: 300, allowBlank: false,
allowBlank: false, 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: [
validationChecker: [ {
{ errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value),
checker: (value: string) => this.checkInteger(value), autoFix: true,
autoFix: true, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.minIdle = _ref;
}, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.minIdle = _ref;
}, },
}, ],
], },
}, {
{ type: FormItem.xtype,
type: FormItem.xtype, 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: BI.TextValueCombo.xtype,
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: TextValueCombo) => {
ref: (_ref: TextValueCombo) => { this.form.testOnReturn = _ref;
this.form.testOnReturn = _ref; },
}, },
}, ],
], },
}, {
{ type: FormItem.xtype,
type: FormItem.xtype, 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: BI.TextValueCombo.xtype,
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: TextValueCombo) => {
ref: (_ref: TextValueCombo) => { this.form.testWhileIdle = _ref;
this.form.testWhileIdle = _ref; },
}, },
}, ],
], },
}, {
{ type: FormItem.xtype,
type: FormItem.xtype, 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: TextChecker.xtype,
type: TextChecker.xtype, $value: 'test-between-evicition-millis',
$value: 'test-between-evicition-millis', width: 300,
width: 300, allowBlank: false,
allowBlank: false, 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: [
validationChecker: [ {
{ errorText: BI.i18nText('Dec-Dcm_Connection_Check_Number'),
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Number'), checker: (value: string) => this.checkNumber(value),
checker: (value: string) => this.checkNumber(value), autoFix: true,
autoFix: true, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.timeBetweenEvictionRunsMillis = _ref;
}, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.timeBetweenEvictionRunsMillis = _ref;
}, },
}, {
{ type: BI.Label.xtype,
type: BI.Label.xtype, lgap: 5,
lgap: 5, height: CONNECTION_LAYOUT.labelHeight,
height: CONNECTION_LAYOUT.labelHeight, text: BI.i18nText('Dec-Dcm_Millisecond'),
text: BI.i18nText('Dec-Dcm_Millisecond'), },
}, ],
], },
}, {
{ type: FormItem.xtype,
type: FormItem.xtype, 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: TextChecker.xtype,
type: TextChecker.xtype, $value: 'test-pereviction-run-num',
$value: 'test-pereviction-run-num', width: 300,
width: 300, allowBlank: false,
allowBlank: false, 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: [
validationChecker: [ {
{ errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value),
checker: (value: string) => this.checkInteger(value), autoFix: true,
autoFix: true, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.numTestsPerEvictionRun = _ref;
}, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.numTestsPerEvictionRun = _ref;
}, },
}, ],
], },
}, {
{ type: FormItem.xtype,
type: FormItem.xtype, 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: TextChecker.xtype,
type: TextChecker.xtype, $value: 'min-evictable-idle-time-millis',
$value: 'min-evictable-idle-time-millis', width: 300,
width: 300, allowBlank: false,
allowBlank: false, 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: [
validationChecker: [ {
{ errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'),
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Integer'), checker: (value: string) => this.checkInteger(value),
checker: (value: string) => this.checkInteger(value), autoFix: true,
autoFix: true, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.minEvictableIdleTimeMillis = _ref;
}, },
valueRangeConfig,
],
ref: (_ref: TextChecker) => {
this.form.minEvictableIdleTimeMillis = _ref;
}, },
},
{
type: BI.Label.xtype,
lgap: 5,
height: CONNECTION_LAYOUT.labelHeight,
text: BI.i18nText('BI-Basic_Seconds'),
},
],
},
{
el: {
type: BI.VerticalLayout.xtype,
cls: 'bi-border-top',
invisible: fetchSize < 0 && fetchSize !== -2,
items: [
{ {
el: { type: BI.Label.xtype,
type: FormItem.xtype, lgap: 5,
name: 'Fetchsize', height: CONNECTION_LAYOUT.labelHeight,
forms: [ text: BI.i18nText('BI-Basic_Seconds'),
{ },
type: TextChecker.xtype, ],
$value: 'fetch-size', },
width: 300, {
allowBlank: true, el: {
value: fetchSize === -2 ? '' : fetchSize, type: BI.VerticalLayout.xtype,
watermark: 'Fetchsize', cls: 'bi-border-top',
validationChecker: [ invisible: fetchSize < 0 && fetchSize !== -2,
{ items: [
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Fetch_Size_Range'), {
checker: (value: string) => el: {
BI.isInteger(value) && BI.parseInt(value) >= 0 && BI.parseInt(value) <= 1000000, type: FormItem.xtype,
autoFix: true, name: 'Fetchsize',
forms: [
{
type: TextChecker.xtype,
$value: 'fetch-size',
width: 300,
allowBlank: true,
value: fetchSize === -2 ? '' : fetchSize,
watermark: 'Fetchsize',
validationChecker: [
{
errorText: BI.i18nText('Dec-Dcm_Connection_Check_Fetch_Size_Range'),
checker: (value: string) =>
BI.isInteger(value) && BI.parseInt(value) >= 0 && BI.parseInt(value) <= 1000000,
autoFix: true,
},
],
ref: (_ref: TextChecker) => {
this.form.fetchSize = _ref;
}, },
],
ref: (_ref: TextChecker) => {
this.form.fetchSize = _ref;
}, },
}, ],
], },
vgap: 15,
}, },
vgap: 15, ],
}, },
],
}, },
}, ],
], },
}, },
], ],
}; };

Loading…
Cancel
Save