|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
import {shortcut} from '@core/core'; |
|
|
|
|
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 {TextChecker} from '../../../../components/text_checker/text_checker'; |
|
|
|
|
import {ApiFactory} from 'src/modules/crud/apiFactory'; |
|
|
|
|
import { shortcut } from '@core/core'; |
|
|
|
|
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 { TextChecker } from '../../../../components/text_checker/text_checker'; |
|
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
|
import { |
|
|
|
|
Editor, |
|
|
|
|
EditorIconCheckCombo, |
|
|
|
@ -14,7 +14,7 @@ import {
|
|
|
|
|
TextAreaEditor, |
|
|
|
|
TextEditor, |
|
|
|
|
TextValueCombo, |
|
|
|
|
VerticalLayout |
|
|
|
|
VerticalLayout, |
|
|
|
|
} from '@fui/core'; |
|
|
|
|
|
|
|
|
|
const api = new ApiFactory().create(); |
|
|
|
@ -25,7 +25,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
|
|
|
|
|
props = { |
|
|
|
|
formData: {} as Connection, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
oldPassword = ''; |
|
|
|
|
allDatabaseTypes = getAllDatabaseTypes(); |
|
|
|
@ -63,10 +63,11 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
numTestsPerEvictionRun: null, |
|
|
|
|
minIdle: null, |
|
|
|
|
minEvictableIdleTimeMillis: null, |
|
|
|
|
fetchSize: null, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
const {connectionName, connectionData} = this.options.formData; |
|
|
|
|
const { connectionName, connectionData } = this.options.formData; |
|
|
|
|
const { |
|
|
|
|
driver, |
|
|
|
|
user, |
|
|
|
@ -78,7 +79,8 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
database, |
|
|
|
|
authType, |
|
|
|
|
principal, |
|
|
|
|
keyPath |
|
|
|
|
keyPath, |
|
|
|
|
fetchSize, |
|
|
|
|
} = connectionData as ConnectionJDBC; |
|
|
|
|
const { |
|
|
|
|
initialSize, |
|
|
|
@ -92,12 +94,12 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
timeBetweenEvictionRunsMillis, |
|
|
|
|
numTestsPerEvictionRun, |
|
|
|
|
minIdle, |
|
|
|
|
minEvictableIdleTimeMillis |
|
|
|
|
minEvictableIdleTimeMillis, |
|
|
|
|
} = connectionPoolAttr as ConnectionPoolJDBC; |
|
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
|
this.oldPassword = password; |
|
|
|
|
const {host, port, databaseName} = resolveUrlInfo(url, database); |
|
|
|
|
const {hgap, vgap} = CONNECTION_LAYOUT; |
|
|
|
|
const { host, port, databaseName } = resolveUrlInfo(url, database); |
|
|
|
|
const { hgap, vgap } = CONNECTION_LAYOUT; |
|
|
|
|
|
|
|
|
|
const valueRangeConfig = { |
|
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Value_Out_Range'), |
|
|
|
@ -394,7 +396,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
vgap: 15, |
|
|
|
|
disabled: true, |
|
|
|
|
value: schema, |
|
|
|
|
items: schema ? [{text: schema, value: schema}] : [], |
|
|
|
|
items: schema ? [{ text: schema, value: schema }] : [], |
|
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
|
this.form.schema = _ref; |
|
|
|
|
}, |
|
|
|
@ -702,6 +704,37 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
text: BI.i18nText('BI-Basic_Seconds'), |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
|
type: BI.VerticalLayout.xtype, |
|
|
|
|
cls: 'bi-border-top', |
|
|
|
|
invisible: BI.parseInt(fetchSize) < 0, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
el: { |
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
name: 'Fetchsize', |
|
|
|
|
forms: [{ |
|
|
|
|
type: TextChecker.xtype, |
|
|
|
|
$value: 'fetch-size', |
|
|
|
|
width: 300, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: 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; |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
vgap: 15, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
@ -767,7 +800,7 @@ export class FormJdbc extends BI.Widget {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private onHostPortChange(databaseType) { |
|
|
|
|
const {urls, url} = databaseType; |
|
|
|
|
const { urls, url } = databaseType; |
|
|
|
|
const driver = this.form.driver.getValue(); |
|
|
|
|
const selectUrl = BI.get(urls, driver) || url; |
|
|
|
|
const host = this.form.host.getValue(); |
|
|
|
|