Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/daas/src/i18n/langs/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,10 @@ export default {
'When the incremental synchronization task sharing mode is turned on and a sharable log cannot be found, the task will be stopped',
setting_test_email_success:
'The test email has been sent, please log in to the receiving mailbox to check it',
setting_test_email_partial_error:
'Some recipients are unavailable: the email was delivered to {0}; these addresses were rejected by the mail server, please check and remove them: {1}',
setting_test_email_error:
'The test email could not be delivered, please check the mail settings',
setting_test_ldap_success: 'Connected to Ldap service successfully',
setting_test_email_countdown:
'The operation is too frequent, please try again later',
Expand Down
3 changes: 3 additions & 0 deletions apps/daas/src/i18n/langs/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,9 @@ export default {
setting_job_cdc_share_only_doc:
'当增量同步任务共享模式开启,并且无法找到一个可共享的日志,将会停止任务',
setting_test_email_success: '测试邮件已发送,请登录接收邮箱查收',
setting_test_email_partial_error:
'部分收件地址不可用:邮件已发送给 {0};以下地址被邮件服务器拒绝,请检查并移除:{1}',
setting_test_email_error: '测试邮件发送失败,请检查邮件设置',
setting_test_ldap_success: '成功连接Ldap服务',
setting_test_email_countdown: '操作太频繁了,请稍后重试',
setting_email_template_from: '发件人',
Expand Down
3 changes: 3 additions & 0 deletions apps/daas/src/i18n/langs/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,9 @@ export default {
setting_job_cdc_share_only_doc:
'當增量同步任務共享模式開啟,並且無法找到一個可共享的日誌,將會停止任務',
setting_test_email_success: '測試郵件已發送,請登錄接收郵箱查收',
setting_test_email_partial_error:
'部分收件地址不可用:郵件已發送給 {0};以下地址被郵件伺服器拒絕,請檢查並移除:{1}',
setting_test_email_error: '測試郵件發送失敗,請檢查郵件設定',
setting_test_ldap_success: '成功連接Ldap服務',
setting_test_email_countdown: '操作太頻繁了,請稍後重試',
setting_email_template_from: '發件人',
Expand Down
57 changes: 55 additions & 2 deletions apps/daas/src/views/setting/Setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {
testEmail,
} from '@tap/api/src/core/settings'
import { testLdapLogin } from '@tap/api/src/core/users'
import { showErrorMessage } from '@tap/business/src/components/error-message'
import {
ErrorMessage,
showErrorMessage,
} from '@tap/business/src/components/error-message'
import PageContainer from '@tap/business/src/components/PageContainer.vue'

import EmailTemplateDialog from '@tap/business/src/views/setting/EmailTemplateDialog.vue'
Expand All @@ -16,6 +19,7 @@ import { getCurrentLanguage } from '@tap/i18n/src/shared/util'
import Cookie from '@tap/shared/src/cookie'
import Time from '@tap/shared/src/time'
import { find, uniq } from 'lodash-es'
import { h } from 'vue'
import i18n from '@/i18n'

export default {
Expand Down Expand Up @@ -336,9 +340,58 @@ export default {
localStorage.setItem('Tapdata_settings_email_countdown', now)

if (data?.result) {
// 群发时可能仅部分地址送达:正常收件人已收到,但需提示哪些地址被拒绝
const failedAddresses = Array.isArray(data?.failedAddresses)
? data.failedAddresses.filter(Boolean)
: []
const validSentAddresses = Array.isArray(data?.validSentAddresses)
? data.validSentAddresses.filter(Boolean)
: []
if (failedAddresses.length) {
const partialMessage = this.$t('setting_test_email_partial_error', [
validSentAddresses.join(', '),
failedAddresses.join(', '),
])
// 被拒绝的具体原因在接口 stack 中,收起为可查看的详情,避免主提示被堆栈淹没
const stack = data?.stack
if (!stack) {
ElMessage.warning({
message: partialMessage,
duration: 6000,
showClose: true,
})
return
}
const notify = ElMessage({
type: 'warning',
duration: 6000,
showClose: true,
grouping: true,
message: h('span', { class: 'align-middle' }, [
h('span', partialMessage),
h(
ElButton,
{
text: true,
type: 'primary',
class: 'ml-1 align-middle',
onClick: () => {
ErrorMessage(stack, partialMessage)
notify.close()
},
},
() => this.$t('public_view_details'),
),
]),
})
return
}
this.$message.success(this.$t('setting_test_email_success'))
} else {
showErrorMessage(data)
showErrorMessage({
...data,
msg: data?.msg || this.$t('setting_test_email_error'),
})
}
})
},
Expand Down
Loading