|
|
|
@ -16,7 +16,7 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
|
|
|
|
|
props = { |
|
|
|
|
connectionType: '', |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
isEdit = false; |
|
|
|
|
connectionName = ''; |
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
testEvent: () => { |
|
|
|
|
this.testConnection(); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
const formData = BI.clone(this.getFormData()); |
|
|
|
@ -98,7 +98,7 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private getFormData():Connection { |
|
|
|
|
private getFormData(): Connection { |
|
|
|
|
switch (this.options.connectionType) { |
|
|
|
|
case connectionType.JDBC: |
|
|
|
|
return this.getJdbcConnection(); |
|
|
|
@ -111,7 +111,7 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private getJdbcConnection():Connection { |
|
|
|
|
private getJdbcConnection(): Connection { |
|
|
|
|
const connectionName = this.getConnectionName(); |
|
|
|
|
let editConnection: Connection; |
|
|
|
|
let connectionData: ConnectionJDBC; |
|
|
|
@ -122,8 +122,10 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
database: this.model.datebaseTypeSelectedOne.databaseType, |
|
|
|
|
connectionName, |
|
|
|
|
connectionPoolAttr: DEFAULT_JDBC_POOL, |
|
|
|
|
port:'', |
|
|
|
|
port: '', |
|
|
|
|
host: 'localhost', |
|
|
|
|
fetchSize: this.model.datebaseTypeSelectedOne.fetchSize ?? -1, |
|
|
|
|
identity: BI.UUID(), |
|
|
|
|
}; |
|
|
|
|
editConnection = { |
|
|
|
|
connectionId: '', |
|
|
|
@ -143,7 +145,7 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
return connection; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private getJndiConnection():Connection { |
|
|
|
|
private getJndiConnection(): Connection { |
|
|
|
|
if (this.model.datebaseTypeSelected) { |
|
|
|
|
return { |
|
|
|
|
connectionId: '', |
|
|
|
@ -158,7 +160,7 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
return this.model.connectionSelectedOne; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private getPluginConnection():Connection { |
|
|
|
|
private getPluginConnection(): Connection { |
|
|
|
|
if (!this.model.datebaseTypeSelected) { |
|
|
|
|
this.connectionName = this.model.connectionSelectedOne.connectionName; |
|
|
|
|
this.isEdit = true; |
|
|
|
@ -174,7 +176,7 @@ export class MaintainForm extends BI.Widget {
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private testValue():boolean { |
|
|
|
|
private testValue(): boolean { |
|
|
|
|
const value = this.form.getSubmitValue(); |
|
|
|
|
if (!value.connectionName) { |
|
|
|
|
this.setFromError(BI.i18nText('Dec-Dcm_Connection_ConnectionName_Cannt_Null')); |
|
|
|
|