diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 940d6aa54..e804cb02f 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -267,6 +267,11 @@ "IPLoginLimit": "IP login limit", "Setting": "Setting", "Certificate": "Certificate", + "CACertificate": "CA Certificate", + "ClientCertificate": "Client certificate", + "CertificateKey": "Certificate key file", + "AllowInvalidCert": "Allow invalid cert", + "UseSSL": "Use SSL/TLS", "SecretKey": "Secret key", "Scope": "Type", "Builtin": "Builtin", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index aba6a1c4a..3be88e7ad 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -272,6 +272,11 @@ "IPLoginLimit": "IPログイン制限", "Setting": "設定", "Certificate": "証明書", + "CACertificate": "CA 証明書", + "ClientCertificate": "クライアント証明書", + "CertificateKey": "証明書秘密鍵ファイル", + "AllowInvalidCert": "証明書チェックを無視する", + "UseSSL": "使う SSL/TLS", "SecretKey": "鍵", "Scope": "カテゴリ", "Builtin": "内蔵", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 4bbf86c9d..10633abae 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -272,6 +272,11 @@ "IPLoginLimit": "IP 登录限制", "Setting": "设置", "Certificate": "证书", + "CACertificate": "CA 证书", + "ClientCertificate": "客户端证书", + "CertificateKey": "证书秘钥文件", + "AllowInvalidCert": "忽略证书检查", + "UseSSL": "使用 SSL/TLS", "SecretKey": "密钥", "Scope": "类别", "Builtin": "内置", diff --git a/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue b/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue index 3be4af728..91ff1a7c9 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue @@ -39,10 +39,25 @@ export default { type: 'input' }, use_ssl: { + label: this.$t('common.UseSSL'), component: 'el-switch' }, + allow_invalid_cert: { + label: this.$t('common.AllowInvalidCert'), + hidden: (form) => { return !form.use_ssl } + }, ca_cert: { - label: this.$t('common.Certificate'), + label: this.$t('common.CACertificate'), + hidden: (form) => { return !form.use_ssl }, + component: UploadKey + }, + client_cert: { + label: this.$t('common.ClientCertificate'), + hidden: (form) => { return !form.use_ssl }, + component: UploadKey + }, + cert_key: { + label: this.$t('common.CertificateKey'), hidden: (form) => { return !form.use_ssl }, component: UploadKey } diff --git a/src/views/applications/DatabaseApp/const.js b/src/views/applications/DatabaseApp/const.js index 9c9d2f91d..aa723aa25 100644 --- a/src/views/applications/DatabaseApp/const.js +++ b/src/views/applications/DatabaseApp/const.js @@ -2,12 +2,14 @@ import { ORACLE, MONGODB, REDIS } from '../const' export function getDatabaseTypeFieldsMap(type) { const baseParams = ['host', 'port', 'database'] + const tlsParams = ['use_ssl', 'allow_invalid_cert', 'ca_cert'] switch (type) { case ORACLE: return baseParams.concat(['version']) - case MONGODB: case REDIS: - return baseParams.concat(['use_ssl', 'ca_cert']) + return baseParams.concat(tlsParams.concat(['client_cert', 'cert_key'])) + case MONGODB: + return baseParams.concat(tlsParams.concat(['cert_key'])) default: return baseParams }