|
|
@ -1,12 +1,12 @@ |
|
|
|
import {shortcut} from '@core/core'; |
|
|
|
import { shortcut } from '@core/core'; |
|
|
|
import {Collapse, EVENT_CHANGE} from 'src/modules/components/collapse/collapse'; |
|
|
|
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse'; |
|
|
|
import {FormItem} from '../../components/form_item/form_item'; |
|
|
|
import { FormItem } 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'; |
|
|
|
import {connectionType} from '@constants/env'; |
|
|
|
import { connectionType } from '@constants/env'; |
|
|
|
import {CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE} from '@constants/constant'; |
|
|
|
import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant'; |
|
|
|
import {getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl} from '../../../../app.service'; |
|
|
|
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service'; |
|
|
|
import {TextChecker} from '../../../../components/text_checker/text_checker'; |
|
|
|
import { TextChecker } from '../../../../components/text_checker/text_checker'; |
|
|
|
import {ApiFactory} from 'src/modules/crud/apiFactory'; |
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
import { |
|
|
|
import { |
|
|
|
Editor, |
|
|
|
Editor, |
|
|
|
EditorIconCheckCombo, |
|
|
|
EditorIconCheckCombo, |
|
|
@ -14,7 +14,7 @@ import { |
|
|
|
TextAreaEditor, |
|
|
|
TextAreaEditor, |
|
|
|
TextEditor, |
|
|
|
TextEditor, |
|
|
|
TextValueCombo, |
|
|
|
TextValueCombo, |
|
|
|
VerticalLayout |
|
|
|
VerticalLayout, |
|
|
|
} from '@fui/core'; |
|
|
|
} from '@fui/core'; |
|
|
|
|
|
|
|
|
|
|
|
const api = new ApiFactory().create(); |
|
|
|
const api = new ApiFactory().create(); |
|
|
@ -25,7 +25,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
|
|
|
|
|
|
|
|
props = { |
|
|
|
props = { |
|
|
|
formData: {} as Connection, |
|
|
|
formData: {} as Connection, |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
oldPassword = ''; |
|
|
|
oldPassword = ''; |
|
|
|
allDatabaseTypes = getAllDatabaseTypes(); |
|
|
|
allDatabaseTypes = getAllDatabaseTypes(); |
|
|
@ -63,10 +63,11 @@ export class FormJdbc extends BI.Widget { |
|
|
|
numTestsPerEvictionRun: null, |
|
|
|
numTestsPerEvictionRun: null, |
|
|
|
minIdle: null, |
|
|
|
minIdle: null, |
|
|
|
minEvictableIdleTimeMillis: null, |
|
|
|
minEvictableIdleTimeMillis: null, |
|
|
|
|
|
|
|
fetchSize: null, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const {connectionName, connectionData} = this.options.formData; |
|
|
|
const { connectionName, connectionData } = this.options.formData; |
|
|
|
const { |
|
|
|
const { |
|
|
|
driver, |
|
|
|
driver, |
|
|
|
user, |
|
|
|
user, |
|
|
@ -78,7 +79,8 @@ export class FormJdbc extends BI.Widget { |
|
|
|
database, |
|
|
|
database, |
|
|
|
authType, |
|
|
|
authType, |
|
|
|
principal, |
|
|
|
principal, |
|
|
|
keyPath |
|
|
|
keyPath, |
|
|
|
|
|
|
|
fetchSize, |
|
|
|
} = connectionData as ConnectionJDBC; |
|
|
|
} = connectionData as ConnectionJDBC; |
|
|
|
const { |
|
|
|
const { |
|
|
|
initialSize, |
|
|
|
initialSize, |
|
|
@ -92,12 +94,12 @@ export class FormJdbc extends BI.Widget { |
|
|
|
timeBetweenEvictionRunsMillis, |
|
|
|
timeBetweenEvictionRunsMillis, |
|
|
|
numTestsPerEvictionRun, |
|
|
|
numTestsPerEvictionRun, |
|
|
|
minIdle, |
|
|
|
minIdle, |
|
|
|
minEvictableIdleTimeMillis |
|
|
|
minEvictableIdleTimeMillis, |
|
|
|
} = connectionPoolAttr as ConnectionPoolJDBC; |
|
|
|
} = connectionPoolAttr as ConnectionPoolJDBC; |
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
this.oldPassword = password; |
|
|
|
this.oldPassword = password; |
|
|
|
const {host, port, databaseName} = resolveUrlInfo(url, database); |
|
|
|
const { host, port, databaseName } = resolveUrlInfo(url, database); |
|
|
|
const {hgap, vgap} = CONNECTION_LAYOUT; |
|
|
|
const { hgap, vgap } = CONNECTION_LAYOUT; |
|
|
|
|
|
|
|
|
|
|
|
const valueRangeConfig = { |
|
|
|
const valueRangeConfig = { |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Value_Out_Range'), |
|
|
|
errorText: BI.i18nText('Dec-Dcm_Connection_Value_Out_Range'), |
|
|
@ -394,7 +396,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
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: TextValueCombo) => { |
|
|
|
ref: (_ref: TextValueCombo) => { |
|
|
|
this.form.schema = _ref; |
|
|
|
this.form.schema = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -702,6 +704,37 @@ export class FormJdbc extends BI.Widget { |
|
|
|
text: BI.i18nText('BI-Basic_Seconds'), |
|
|
|
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) { |
|
|
|
private onHostPortChange(databaseType) { |
|
|
|
const {urls, url} = databaseType; |
|
|
|
const { urls, url } = databaseType; |
|
|
|
const driver = this.form.driver.getValue(); |
|
|
|
const driver = this.form.driver.getValue(); |
|
|
|
const selectUrl = BI.get(urls, driver) || url; |
|
|
|
const selectUrl = BI.get(urls, driver) || url; |
|
|
|
const host = this.form.host.getValue(); |
|
|
|
const host = this.form.host.getValue(); |
|
|
@ -816,6 +849,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
creator: Dec ? Dec.personal.username : '', |
|
|
|
creator: Dec ? Dec.personal.username : '', |
|
|
|
principal: this.form.principal.getValue(), |
|
|
|
principal: this.form.principal.getValue(), |
|
|
|
keyPath: this.form.keyPath.getValue(), |
|
|
|
keyPath: this.form.keyPath.getValue(), |
|
|
|
|
|
|
|
fetchSize: this.form.fetchSize.getValue(), |
|
|
|
connectionPoolAttr: { |
|
|
|
connectionPoolAttr: { |
|
|
|
initialSize: this.form.initialSize.getValue(), |
|
|
|
initialSize: this.form.initialSize.getValue(), |
|
|
|
maxActive: this.form.maxActive.getValue(), |
|
|
|
maxActive: this.form.maxActive.getValue(), |
|
|
|