summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Zakharov <m.zakharov@IBS.RU>2022-10-14 13:40:40 +0300
committerMaksim Zakharov <m.zakharov@IBS.RU>2022-10-14 13:40:40 +0300
commitdf4d370a206d6418179d80b6e94da0f94d7aae2a (patch)
treeeae6e22ef1c664314f00f96e33ac054ba7dc2300
parent4fb16e0779596b2cea3b4d548cf2aef8e0efbb64 (diff)
downloadwebui-vue-df4d370a206d6418179d80b6e94da0f94d7aae2a.tar.xz
fix smtp send message
-rw-r--r--src/locales/ru-RU.json1
-rw-r--r--src/store/modules/Settings/SmtpStore.js5
-rw-r--r--src/views/_sila/Settings/TransferInfo/Smtp.vue8
3 files changed, 13 insertions, 1 deletions
diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json
index a562a8f5..6eae5789 100644
--- a/src/locales/ru-RU.json
+++ b/src/locales/ru-RU.json
@@ -1157,6 +1157,7 @@
"description": "Настройте SNMP V2, SMTP и SYSLOG",
"saveSmtpSuсcess": "Настройки SMTP успешно сохранены.",
"saveSmtpError": "Ошибка сохранения настроек SMTP.",
+ "sendSmtpError": "Ошибка отправки сообщения.",
"smtp": {
"smtpTitle": "Настройки SMTP",
"username": "Имя пользователя",
diff --git a/src/store/modules/Settings/SmtpStore.js b/src/store/modules/Settings/SmtpStore.js
index 6762fa27..4312ecd9 100644
--- a/src/store/modules/Settings/SmtpStore.js
+++ b/src/store/modules/Settings/SmtpStore.js
@@ -89,6 +89,11 @@ const SmtpStore = {
async sendTestMessage(_, payload) {
return await api
.post('/redfish/v1/Smtp/SendMail', payload)
+ .then((res) => {
+ if (res.data.result === false) {
+ return res.data;
+ }
+ })
.catch((error) => console.log(error));
},
},
diff --git a/src/views/_sila/Settings/TransferInfo/Smtp.vue b/src/views/_sila/Settings/TransferInfo/Smtp.vue
index 5934e9e5..37c576cf 100644
--- a/src/views/_sila/Settings/TransferInfo/Smtp.vue
+++ b/src/views/_sila/Settings/TransferInfo/Smtp.vue
@@ -373,7 +373,13 @@ export default {
subject: 'Test Message',
text: 'Test Message Text',
})
- .then((message) => this.successToast(message))
+ .then((message) => {
+ if (message.result === false) {
+ this.errorToast(this.$t('pageTransfer.sendSmtpError'));
+ } else {
+ this.successToast(message);
+ }
+ })
.catch(({ message }) => this.errorToast(message));
},
setForm() {