|
|
@ -51,6 +51,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
connectionName: null, |
|
|
|
connectionName: null, |
|
|
|
version: null, |
|
|
|
version: null, |
|
|
|
driver: null, |
|
|
|
driver: null, |
|
|
|
|
|
|
|
catalog: null, |
|
|
|
database: null, |
|
|
|
database: null, |
|
|
|
host: null, |
|
|
|
host: null, |
|
|
|
port: null, |
|
|
|
port: null, |
|
|
@ -160,7 +161,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
} = connectionPoolAttr as ConnectionPoolJDBC; |
|
|
|
} = connectionPoolAttr as ConnectionPoolJDBC; |
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
const databaseType = getJdbcDatabaseType(database, driver); |
|
|
|
this.databaseType = databaseType; |
|
|
|
this.databaseType = databaseType; |
|
|
|
const { host, port, databaseName, version } = resolveUrlInfo(url, database); |
|
|
|
const { host, port, catalog, databaseName, version } = resolveUrlInfo(url, database); |
|
|
|
this.version = !BI.isUndefined(databaseType.versions) ? (version ?? databaseType.versions[0]) : version; |
|
|
|
this.version = !BI.isUndefined(databaseType.versions) ? (version ?? databaseType.versions[0]) : version; |
|
|
|
const { hgap, vgap } = CONNECTION_LAYOUT; |
|
|
|
const { hgap, vgap } = CONNECTION_LAYOUT; |
|
|
|
|
|
|
|
|
|
|
@ -262,6 +263,33 @@ export class FormJdbc extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// catalog
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: FormItem.xtype, |
|
|
|
|
|
|
|
name: 'catalog', |
|
|
|
|
|
|
|
invisible: database !== 'starrocks', |
|
|
|
|
|
|
|
forms: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: BI.TextEditor.xtype, |
|
|
|
|
|
|
|
$value: 'database-catalog', |
|
|
|
|
|
|
|
width: EDITOR_WIDTH, |
|
|
|
|
|
|
|
allowBlank: true, |
|
|
|
|
|
|
|
watermark: 'catalog', |
|
|
|
|
|
|
|
value: catalog, |
|
|
|
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
|
|
|
this.form.catalog = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
eventName: BI.Editor.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: () => { |
|
|
|
|
|
|
|
this.onHostPortChange(databaseType); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
// 数据库名称
|
|
|
|
// 数据库名称
|
|
|
|
{ |
|
|
|
{ |
|
|
|
type: FormItem.xtype, |
|
|
|
type: FormItem.xtype, |
|
|
@ -843,6 +871,7 @@ export class FormJdbc extends BI.Widget { |
|
|
|
action: () => { |
|
|
|
action: () => { |
|
|
|
const urlInfo = resolveUrlInfo(this.form.url.getValue(), database); |
|
|
|
const urlInfo = resolveUrlInfo(this.form.url.getValue(), database); |
|
|
|
this.form.host.setValue(urlInfo.host); |
|
|
|
this.form.host.setValue(urlInfo.host); |
|
|
|
|
|
|
|
this.form.catalog.setValue(urlInfo.catalog); |
|
|
|
this.form.database.setValue(urlInfo.databaseName); |
|
|
|
this.form.database.setValue(urlInfo.databaseName); |
|
|
|
this.form.port.setValue(urlInfo.port); |
|
|
|
this.form.port.setValue(urlInfo.port); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -1578,8 +1607,9 @@ export class FormJdbc extends BI.Widget { |
|
|
|
const selectUrl = BI.get(urls, driver.driver) || url; |
|
|
|
const selectUrl = BI.get(urls, driver.driver) || url; |
|
|
|
const host = this.form.host.getValue(); |
|
|
|
const host = this.form.host.getValue(); |
|
|
|
const port = this.form.port.getValue(); |
|
|
|
const port = this.form.port.getValue(); |
|
|
|
|
|
|
|
const catalog = this.form.catalog.getValue(); |
|
|
|
const database = this.form.database.getValue(); |
|
|
|
const database = this.form.database.getValue(); |
|
|
|
this.form.url.setValue(splitUrl(host, port, database, selectUrl)); |
|
|
|
this.form.url.setValue(splitUrl(host, port, catalog, database, selectUrl)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private onSshTypeChange(sshType) { |
|
|
|
private onSshTypeChange(sshType) { |
|
|
|