mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
feat: MongoDB支持连接SSL类型
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user