|
|
|
@ -6,6 +6,10 @@ import { connectionType } from '@constants/env';
|
|
|
|
|
import { DatebaseType } from './database_type/database_type'; |
|
|
|
|
import { getAllDatabaseTypes } from '../../app.service'; |
|
|
|
|
import { ButtonGroup, MultiSelectItem, SearchEditor } from '@fui/core'; |
|
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
|
|
|
|
|
|
const api = new ApiFactory().create(); |
|
|
|
|
|
|
|
|
|
@shortcut() |
|
|
|
|
@store(DatebaseModel) |
|
|
|
|
export class Datebase extends BI.Widget { |
|
|
|
@ -65,6 +69,7 @@ export class Datebase extends BI.Widget {
|
|
|
|
|
mounted() { |
|
|
|
|
this.store.setFilter(DATEBASE_FILTER_TYPE.COMMONLY); |
|
|
|
|
this.store.setDatebaseTypeSelected(''); |
|
|
|
|
this.getDatabaseTypeLimit(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
@ -250,11 +255,17 @@ export class Datebase extends BI.Widget {
|
|
|
|
|
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.commonly)); |
|
|
|
|
break; |
|
|
|
|
case DATEBASE_FILTER_TYPE.OTHER: |
|
|
|
|
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type === connectionType.JNDI || item.type === OTHER_JDBC)); |
|
|
|
|
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => this.model.otherDatabases.includes(item.type))); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== OTHER_JDBC)); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 获取JNDI
|
|
|
|
|
private async getDatabaseTypeLimit() { |
|
|
|
|
const result = await api.getJNDIDatabaseStatus(); |
|
|
|
|
this.store.setJNDILimit(result); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|