diff options
author | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-10-18 10:01:32 +0300 |
---|---|---|
committer | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-10-18 10:01:32 +0300 |
commit | dbcdb2075fecc350c6c9f97735b2cdd9105ada6a (patch) | |
tree | 720b329082555d6f2a643a2c98e22242a8a6043c | |
parent | f1c2c5f0d9bc5e800b402f9ca3f6d344a2f5b299 (diff) | |
download | webui-vue-dbcdb2075fecc350c6c9f97735b2cdd9105ada6a.tar.xz |
fix smtp message
-rw-r--r-- | src/locales/en-US.json | 4 | ||||
-rw-r--r-- | src/locales/ru-RU.json | 1 | ||||
-rw-r--r-- | src/store/modules/Settings/SmtpStore.js | 4 | ||||
-rw-r--r-- | src/views/_sila/Settings/TransferInfo/Smtp.vue | 6 |
4 files changed, 9 insertions, 6 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 00c16e6e..2edff302 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -1156,7 +1156,9 @@ "title": "Setting up information transfer", "description": "Set up SNMP V2, SMTP and SYSLOG", "saveSmtpSuсcess": "Save SMTP successfully.", - "saveSmtpError": "Save SMTP error.", + "saveSmtpError": "Save SMTP error.", + "sendSmtpError": "Send mail error.", + "sendSmtpSuсcess": "Send mail successfully.", "smtp": { "smtpTitle": "SMTP settings", "username": "Username", diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json index 6eae5789..b5272cc4 100644 --- a/src/locales/ru-RU.json +++ b/src/locales/ru-RU.json @@ -1158,6 +1158,7 @@ "saveSmtpSuсcess": "Настройки SMTP успешно сохранены.", "saveSmtpError": "Ошибка сохранения настроек SMTP.", "sendSmtpError": "Ошибка отправки сообщения.", + "sendSmtpSuсcess": "Сообщение успешно отправлено.", "smtp": { "smtpTitle": "Настройки SMTP", "username": "Имя пользователя", diff --git a/src/store/modules/Settings/SmtpStore.js b/src/store/modules/Settings/SmtpStore.js index a0240462..cf508029 100644 --- a/src/store/modules/Settings/SmtpStore.js +++ b/src/store/modules/Settings/SmtpStore.js @@ -90,8 +90,8 @@ const SmtpStore = { return await api .post('/redfish/v1/Smtp/SendMail', payload) .then((res) => { - if (res?.data?.result === false) { - return res.data; + if (res.data) { + return res; } }) .catch((error) => console.log(error)); diff --git a/src/views/_sila/Settings/TransferInfo/Smtp.vue b/src/views/_sila/Settings/TransferInfo/Smtp.vue index 37c576cf..9d6e50b5 100644 --- a/src/views/_sila/Settings/TransferInfo/Smtp.vue +++ b/src/views/_sila/Settings/TransferInfo/Smtp.vue @@ -374,10 +374,10 @@ export default { text: 'Test Message Text', }) .then((message) => { - if (message.result === false) { + if (message?.data?.result === false) { this.errorToast(this.$t('pageTransfer.sendSmtpError')); - } else { - this.successToast(message); + } else if (message?.data?.result === true) { + this.successToast(this.$t('pageTransfer.sendSmtpSuсcess')); } }) .catch(({ message }) => this.errorToast(message)); |