feat: MongoDB支持连接SSL类型

This commit is contained in:
jiangweidong
2022-08-18 10:00:11 +08:00
committed by 老广
parent 5bfe2497fd
commit 34d9790a04
2 changed files with 15 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
<script>
import { GenericCreateUpdatePage } from '@/layout/components'
import { getDatabaseTypeFieldsMap } from '@/views/applications/DatabaseApp/const'
import { UploadKey } from '@/components'
export default {
components: {
GenericCreateUpdatePage
@@ -36,6 +37,14 @@ export default {
fieldsMeta: {
host: {
type: 'input'
},
use_ssl: {
component: 'el-switch'
},
ca_cert: {
label: this.$t('common.Certificate'),
hidden: (form) => { return !form.use_ssl },
component: UploadKey
}
}
}

View File

@@ -1,10 +1,13 @@
import { ORACLE } from '../const'
import { ORACLE, MONGODB } from '../const'
export function getDatabaseTypeFieldsMap(type) {
const baseParams = ['host', 'port', 'database']
switch (type) {
case ORACLE:
return ['host', 'port', 'database', 'version']
return baseParams.concat(['version'])
case MONGODB:
return baseParams.concat(['use_ssl', 'ca_cert'])
default:
return ['host', 'port', 'database']
return baseParams
}
}