From 2adb1ee9800c2b06f058bd0c871746c9912028d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 19 Aug 2022 10:53:40 +0800 Subject: [PATCH 01/18] =?UTF-8?q?fix:=20=E5=8D=87=E7=BA=A7lodash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b5d897a8..9e3fce145 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "krry-transfer": "^1.7.3", "less": "^3.10.3", "less-loader": "^5.0.0", - "lodash": "^4.17.15", + "lodash": "^4.17.21", "lodash.clonedeep": "^4.5.0", "lodash.frompairs": "^4.0.1", "lodash.get": "^4.4.2", From 04465a1da334ef694234fc77c350c6d404e019b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Thu, 18 Aug 2022 18:21:52 +0800 Subject: [PATCH 02/18] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DLDAP=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=AF=BC=E5=85=A5=E5=A4=B1=E8=B4=A5=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + src/views/settings/Ldap/ImportDialog.vue | 8 +++++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 727a1a54b..30a71570b 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -424,6 +424,7 @@ "downloadImportTemplateMsg": "Download import template", "downloadUpdateTemplateMsg": "Download update template", "onlyCSVFilesTips": "Only csv supported", + "ImportFail": "Import fail", "updateSuccessMsg": "Update success, total: {count}", "dragUploadFileInfo": "Drag file here or click here to upload", "uploadCsvLth10MHelpText": "csv/xlsx files with a size less than 10M", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index a417185cf..7a414ecb4 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -435,6 +435,7 @@ "downloadImportTemplateMsg": "作成テンプレートのダウンロード", "downloadUpdateTemplateMsg": "更新テンプレートのダウンロード", "onlyCSVFilesTips": "Csvファイルのインポートのみサポート", + "ImportFail": "インポートに失敗しました", "updateSuccessMsg": "更新のインポートに成功しました。合計:{count}", "uploadCsvLth10MHelpText": "Csv/xlsxのみアップロードでき、10m以下です", "dragUploadFileInfo": "ここにファイルをドラッグするか、ここをクリックしてアップロードしてください", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index d62e81a6c..08294106e 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -435,6 +435,7 @@ "downloadImportTemplateMsg": "下载创建模板", "downloadUpdateTemplateMsg": "下载更新模板", "onlyCSVFilesTips": "仅支持csv文件导入", + "ImportFail": "导入失败", "updateSuccessMsg": "导入更新成功,总共:{count}", "uploadCsvLth10MHelpText": "只能上传 csv/xlsx, 且不超过 10M", "dragUploadFileInfo": "将文件拖到此处,或点击此处上传", diff --git a/src/views/settings/Ldap/ImportDialog.vue b/src/views/settings/Ldap/ImportDialog.vue index 74df9eb15..70a2f6ef8 100644 --- a/src/views/settings/Ldap/ImportDialog.vue +++ b/src/views/settings/Ldap/ImportDialog.vue @@ -28,6 +28,7 @@ import ListTable from '@/components/ListTable' import Dialog from '@/components/Dialog' import { importLdapUser, refreshLdapUserCache, startLdapUserCache } from '@/api/settings' +import { getErrorResponseMsg } from '@/utils/common' export default { name: 'ImportDialog', @@ -103,7 +104,12 @@ export default { importLdapUser(data).then(res => { this.$message.success(res.msg) // eslint-disable-next-line no-return-assign - }).finally(() => this.dialogLdapUserImportLoginStatus = false) + }).catch(error => { + const errorMessage = getErrorResponseMsg(error) || this.$t('common.imExport.ImportFail') + this.$message.error(errorMessage) + }).finally(() => { + this.dialogLdapUserImportLoginStatus = false + }) } }, importAllUserClick() { From e2eac8361517ce4a5e4f87ec803aceb32477ee10 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Fri, 19 Aug 2022 11:36:34 +0800 Subject: [PATCH 03/18] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0json=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormFields/UploadKey.vue | 2 +- src/views/assets/Cloud/Account/AccountCreateUpdate.vue | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/FormFields/UploadKey.vue b/src/components/FormFields/UploadKey.vue index e45ba2fba..81697c686 100644 --- a/src/components/FormFields/UploadKey.vue +++ b/src/components/FormFields/UploadKey.vue @@ -50,7 +50,7 @@ export default { const reader = new FileReader() reader.onload = function() { let result = this.result - if (vm.toFormat === 'object') { + if (vm.toFormat === 'object' && vm.fileName.endsWith('.json')) { result = JSON.parse(result) } vm.$emit('input', result) diff --git a/src/views/assets/Cloud/Account/AccountCreateUpdate.vue b/src/views/assets/Cloud/Account/AccountCreateUpdate.vue index d76c96602..0bedc8a2e 100644 --- a/src/views/assets/Cloud/Account/AccountCreateUpdate.vue +++ b/src/views/assets/Cloud/Account/AccountCreateUpdate.vue @@ -91,13 +91,17 @@ export default { const attrs = values.attrs for (const item of encryptedFields) { const value = attrs[item] - if (value) { - attrs[item] = encryptPassword(value) + if (!value) { + continue } + attrs[item] = encryptPassword(value) } const toListFields = ['ip_group'] for (const item of toListFields) { let value = attrs[item] + if (!value) { + continue + } value = value?.split(',') || [] value = value.filter((value, index) => { if (value) return true }) attrs[item] = value From 42fab922371f3867c49f9d4042d969f03fdb75c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 19 Aug 2022 16:21:35 +0800 Subject: [PATCH 04/18] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/Tools.vue | 80 ++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/src/views/settings/Tools.vue b/src/views/settings/Tools.vue index 36142eaaf..dcbd9fb60 100644 --- a/src/views/settings/Tools.vue +++ b/src/views/settings/Tools.vue @@ -1,27 +1,38 @@ @@ -95,20 +106,19 @@ export default { } - From e16a7750374a116c6dfceeefdf0a27ea32b02d54 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Mon, 22 Aug 2022 17:57:15 +0800 Subject: [PATCH 05/18] =?UTF-8?q?feat:=20=E6=94=B9=E5=AF=86=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=94=AF=E6=8C=81MongoDB=E6=94=B9=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/applications/const.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/applications/const.js b/src/views/applications/const.js index 5441501ff..0467870d9 100644 --- a/src/views/applications/const.js +++ b/src/views/applications/const.js @@ -89,6 +89,14 @@ export const DATABASE = [ type: 'primary', category: DATABASE_CATEGORY, has: hasLicence + }, + { + name: MONGODB, + title: i18n.t(`applications.applicationsType.${MONGODB}`), + type: 'primary', + category: DATABASE_CATEGORY, + has: hasLicence, + group: i18n.t('applications.NoSQLProtocol') } ] From 5bfe2497fd45936b5978376f0e04a6fd1231c54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 22 Aug 2022 15:53:42 +0800 Subject: [PATCH 06/18] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E7=94=A8=E6=88=B7=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=90=8E=E8=B7=B3=E8=BD=AC=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=BF=98=E4=BC=9A=E8=BF=94=E5=9B=9E=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=A1=AE=E8=AE=A4=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/users.js | 6 ++++++ src/views/profile/ProfileImprovement.vue | 1 + 2 files changed, 7 insertions(+) diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 3069a71cd..ed34a2079 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -72,6 +72,9 @@ const mutations = { }, ADD_WORKBENCH_ORGS(state, org) { state.workbenchOrgs.push(org) + }, + SET_IS_FIRST_LOGIN(state, flag) { + state.profile.is_first_login = flag } } @@ -140,6 +143,9 @@ const actions = { const usingOrgs = mapper[viewName] || state.consoleOrgs Vue.$log.debug('Set using orgs: ', viewName, usingOrgs) commit('SET_USING_ORGS', usingOrgs) + }, + ifFirstLogin({ commit }, flag) { + commit('SET_IS_FIRST_LOGIN', flag) } } diff --git a/src/views/profile/ProfileImprovement.vue b/src/views/profile/ProfileImprovement.vue index 673eed7d7..3a9637ca2 100644 --- a/src/views/profile/ProfileImprovement.vue +++ b/src/views/profile/ProfileImprovement.vue @@ -78,6 +78,7 @@ export default { }, onPerformSuccess() { this.$message.success(this.$t('common.updateSuccessMsg')) + this.$store.dispatch('users/ifFirstLogin', false) setTimeout(() => this.$router.push({ name: 'ProfileInfo' }), 100) }, submitMethod() { From 34d9790a043a2ed360f34a9bc919c30c94500b98 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Thu, 18 Aug 2022 10:00:11 +0800 Subject: [PATCH 07/18] =?UTF-8?q?feat:=20MongoDB=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5SSL=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applications/DatabaseApp/DatabaseAppCreateUpdate.vue | 9 +++++++++ src/views/applications/DatabaseApp/const.js | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue b/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue index e23d79849..3be4af728 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppCreateUpdate.vue @@ -5,6 +5,7 @@ + + diff --git a/src/views/settings/SMS/index.vue b/src/views/settings/SMS/index.vue index 6e46d57c3..bc25436af 100644 --- a/src/views/settings/SMS/index.vue +++ b/src/views/settings/SMS/index.vue @@ -6,6 +6,7 @@ import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage' import SMSAlibaba from './SMSAlibaba' import SMSTencent from './SMSTencent' +import SMSHuawei from './SMSHuawei' import CMPP2 from './CMPP2' export default { @@ -24,7 +25,7 @@ export default { ], [ this.$t('setting.SMSProvider'), [ - 'ALIYUN', 'QCLOUD', 'CMPP2' + 'ALIYUN', 'QCLOUD', 'HUAWEICLOUD', 'CMPP2' ] ] ], @@ -43,6 +44,13 @@ export default { return form['SMS_BACKEND'] !== 'tencent' } }, + HUAWEICLOUD: { + label: this.$t('setting.HuaweiCloud'), + component: SMSHuawei, + hidden: (form) => { + return form['SMS_BACKEND'] !== 'huawei' + } + }, CMPP2: { label: this.$t('setting.CMPP2'), component: CMPP2, From 3b17235b6e367b419ab29684ec777507a755f1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 6 Sep 2022 18:43:23 +0800 Subject: [PATCH 14/18] =?UTF-8?q?fix:=20=E6=89=B9=E9=87=8F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=B8=8D=E8=AF=B7=E6=B1=82=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/GenericCreateUpdateForm/index.vue | 6 +++++- src/layout/components/GenericUpdateFormDialog/index.vue | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/layout/components/GenericCreateUpdateForm/index.vue b/src/layout/components/GenericCreateUpdateForm/index.vue index 9e1ebd4e3..30d1ff131 100644 --- a/src/layout/components/GenericCreateUpdateForm/index.vue +++ b/src/layout/components/GenericCreateUpdateForm/index.vue @@ -233,6 +233,10 @@ export default { encryptedFields: { type: Array, default: () => ['password', 'token', 'private_key'] + }, + needGetObjectDetail: { + type: Boolean, + default: true } }, data() { @@ -312,7 +316,7 @@ export default { }, async getFormValue() { const cloneFrom = this.$route.query['clone_from'] - if (!this.isUpdateMethod() && !cloneFrom) { + if ((!this.isUpdateMethod() && !cloneFrom) || !this.needGetObjectDetail) { return Object.assign(this.form, this.initial) } let object = this.object diff --git a/src/layout/components/GenericUpdateFormDialog/index.vue b/src/layout/components/GenericUpdateFormDialog/index.vue index afb48965e..6dfd20857 100644 --- a/src/layout/components/GenericUpdateFormDialog/index.vue +++ b/src/layout/components/GenericUpdateFormDialog/index.vue @@ -97,6 +97,7 @@ export default { getDefaultFormSetting() { const vm = this return { + needGetObjectDetail: false, submitMethod: () => 'patch', cleanFormValue: (value) => { const filterValue = {} From 1fce7561db4ea91db79d047906dc810725e7c033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 6 Sep 2022 19:20:03 +0800 Subject: [PATCH 15/18] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=A6=96=E6=AC=A1=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 025a87f43..940d6aa54 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -773,7 +773,7 @@ "OperateLog": "Operation Logs", "PasswordChangeLog": "Password Update Logs", "Perms": "Permissions", - "PersonalInformationImprovement": "PersonalInformationImprovement", + "PersonalInformationImprovement": "Personal information improvement", "PlatformCreate": "Platform create", "PlatformDetail": "Platform detail", "PlatformList": "Platforms", From 7ad86062b47d4d62f95245b9f0f6f1e038861e8c Mon Sep 17 00:00:00 2001 From: jiangweidong <80373698+Hi-JWD@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:09:07 +0800 Subject: [PATCH 16/18] =?UTF-8?q?perf:=20=E6=94=AF=E6=8C=81=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=BC=80=E5=90=AFssl=E4=B8=94=E8=87=AA=E7=AD=BE?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=9A=84Redis/MongoDB=20(#2039)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * perf: 支持连接开启ssl且自签证书的Redis/MongoDB * 修改字段文案 * 修改字段名称 * 修改变量名 --- src/i18n/langs/en.json | 5 +++++ src/i18n/langs/ja.json | 5 +++++ src/i18n/langs/zh.json | 5 +++++ .../DatabaseApp/DatabaseAppCreateUpdate.vue | 17 ++++++++++++++++- src/views/applications/DatabaseApp/const.js | 6 ++++-- 5 files changed, 35 insertions(+), 3 deletions(-) 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 } From e0fd33f37665d494e42dbc2ebcd9a6995e790188 Mon Sep 17 00:00:00 2001 From: jiangweidong <80373698+Hi-JWD@users.noreply.github.com> Date: Thu, 8 Sep 2022 15:16:54 +0800 Subject: [PATCH 17/18] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=88=9B=E5=BB=BA=E9=A1=B5=E9=9D=A2=E6=9C=89?= =?UTF-8?q?=E5=A4=9A=E4=B8=AAmongdob=E7=9A=84=E9=97=AE=E9=A2=98=20(#2041)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/applications/const.js | 41 +++++++++++++++------------------ 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/views/applications/const.js b/src/views/applications/const.js index 0467870d9..763c17823 100644 --- a/src/views/applications/const.js +++ b/src/views/applications/const.js @@ -89,35 +89,30 @@ export const DATABASE = [ type: 'primary', category: DATABASE_CATEGORY, has: hasLicence - }, - { - name: MONGODB, - title: i18n.t(`applications.applicationsType.${MONGODB}`), - type: 'primary', - category: DATABASE_CATEGORY, - has: hasLicence, - group: i18n.t('applications.NoSQLProtocol') } ] +const MONGODB_ITEM = { + name: MONGODB, + title: i18n.t(`applications.applicationsType.${MONGODB}`), + type: 'primary', + category: DATABASE_CATEGORY, + group: i18n.t('applications.NoSQLProtocol') +} + +const REDIS_ITEM = { + name: REDIS, + title: i18n.t(`applications.applicationsType.${REDIS}`), + type: 'primary', + category: DATABASE_CATEGORY, + has: true +} + export const KV_DATABASE = [ - { - name: REDIS, - title: i18n.t(`applications.applicationsType.${REDIS}`), - type: 'primary', - category: DATABASE_CATEGORY, - has: true, - group: i18n.t('applications.NoSQLProtocol') - }, - { - name: MONGODB, - title: i18n.t(`applications.applicationsType.${MONGODB}`), - type: 'primary', - category: DATABASE_CATEGORY - } + MONGODB_ITEM, REDIS_ITEM ] -export const AppPlanDatabase = DATABASE +export const AppPlanDatabase = [...DATABASE, MONGODB_ITEM] export const KUBERNETES = 'k8s' export const CLOUD_CATEGORY = 'cloud' From e0f6fb305dbd4e78e197cccd443ae14e8c33bd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Thu, 8 Sep 2022 12:01:21 +0800 Subject: [PATCH 18/18] =?UTF-8?q?perf:=20cas=E7=94=A8=E6=88=B7=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=98=A0=E5=B0=84=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=EF=BC=8C=E8=87=B3=E5=B0=91=E8=AE=BE=E7=BD=AEusername?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DataForm/rules/index.js | 17 +++++++++++++++++ src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + src/views/settings/Auth/CAS.vue | 21 ++++++++++++++------- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/components/DataForm/rules/index.js b/src/components/DataForm/rules/index.js index 5b3a91e18..d7baeda9b 100644 --- a/src/components/DataForm/rules/index.js +++ b/src/components/DataForm/rules/index.js @@ -45,3 +45,20 @@ export const JsonRequired = { } } } + +export const JsonRequiredUserNameMapped = { + required: true, + trigger: 'change', + validator: (rule, value, callback) => { + try { + JSON.parse(value) + const hasUserName = _.map(JSON.parse(value), (value) => value) + if (!hasUserName.includes('username')) { + callback(new Error(i18n.t('common.requiredHasUserNameMapped'))) + } + callback() + } catch (e) { + callback(new Error(i18n.t('common.InvalidJson'))) + } + } +} diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index e804cb02f..e029aa0b2 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -414,6 +414,7 @@ "disableSelected": "Disable selected", "disableSuccessMsg": "Disable success", "fieldRequiredError": "This field is required", + "requiredHasUserNameMapped": "The mapping of the username field must be included, such as {'uid': 'username'}", "getErrorMsg": "Get failed", "fileType": "File type", "Status": "Status", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 3be88e7ad..cb1a25815 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -423,6 +423,7 @@ "disableSelected": "選択した無効", "disableSuccessMsg": "成功を無効にする", "fieldRequiredError": "このフィールドは必須項目です", + "requiredHasUserNameMapped": "usernameフィールドのマッピングを含める必要があります, {'uid':'username'}など", "getErrorMsg": "の取得に失敗しました", "MFAErrorMsg": "MFAエラーです。チェックしてください", "Total": "合計", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 10633abae..ed385b041 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -423,6 +423,7 @@ "disableSelected": "禁用所选", "disableSuccessMsg": "禁用成功", "fieldRequiredError": "这个字段是必填项", + "requiredHasUserNameMapped": "必须包含 username 字段的映射,如 { 'uid': 'username' }", "getErrorMsg": "获取失败", "MFAErrorMsg": "MFA错误,请检查", "Total": "总共", diff --git a/src/views/settings/Auth/CAS.vue b/src/views/settings/Auth/CAS.vue index 719435938..bca250194 100644 --- a/src/views/settings/Auth/CAS.vue +++ b/src/views/settings/Auth/CAS.vue @@ -8,7 +8,7 @@