@ -2,6 +2,7 @@ import { Connection, ConnectionJDBC } from '../../../crud/crud.typings';
import { connectionType , errorCode } from '@constants/env' ;
import { connectionType , errorCode } from '@constants/env' ;
import { DATA_BASE_DRIVER_LINK , JDBC_ODBC_DRIVER , JDBC_ODBC_DRIVER_HELP_LINK } from '@constants/constant' ;
import { DATA_BASE_DRIVER_LINK , JDBC_ODBC_DRIVER , JDBC_ODBC_DRIVER_HELP_LINK } from '@constants/constant' ;
import { TestStatusXtype , EVENT_RELOAD , EVENT_CLOSE } from '../../../components/test_status/test_status' ;
import { TestStatusXtype , EVENT_RELOAD , EVENT_CLOSE } from '../../../components/test_status/test_status' ;
import { getJdbcDatabaseType } from '../../../app.service' ;
import { ApiFactory } from '../../../crud/apiFactory' ;
import { ApiFactory } from '../../../crud/apiFactory' ;
const api = new ApiFactory ( ) . create ( ) ;
const api = new ApiFactory ( ) . create ( ) ;
export function testConnection ( value : Connection ) : Promise < string [ ] > {
export function testConnection ( value : Connection ) : Promise < string [ ] > {
@ -31,7 +32,8 @@ export function testConnection(value: Connection): Promise<string[]> {
}
}
const databaseType = ( formValue . connectionData as ConnectionJDBC ) . database ;
const databaseType = ( formValue . connectionData as ConnectionJDBC ) . database ;
const databaseLink = BI . get ( DATA_BASE_DRIVER_LINK . find ( item = > item . databaseType === databaseType ) , 'link' ) ;
const databaseLink = BI . get ( DATA_BASE_DRIVER_LINK . find ( item = > item . databaseType === databaseType ) , 'link' ) ;
testStatus . setFail ( re . errorMsg , driver , Dec . system [ DecCst . Hyperlink . DECISION_HYPERLINK_CONFIG ] [ databaseLink ] ) ;
const link = Dec . system [ DecCst . Hyperlink . DECISION_HYPERLINK_CONFIG ] [ databaseLink ] || BI . get ( getJdbcDatabaseType ( databaseType , driver ) , 'link' ) ;
testStatus . setFail ( re . errorMsg , driver , link ) ;
} else {
} else {
testStatus . setFail ( re . errorMsg ) ;
testStatus . setFail ( re . errorMsg ) ;
}
}