From 7e2ba5432d067101e4c2931b388b4b6f07979dba Mon Sep 17 00:00:00 2001 From: Dixsie Wolmers Date: Thu, 3 Jun 2021 07:38:12 -0500 Subject: Add export all and delete all buttons to event logs - Uses new table action button style above table. - Adds ability to export all and delete all logs. - Disables toolbar table action buttons when table is empty. - Event logs file name is not translated to avoid potential translation issues in the future, users can rename the file - Adds toast messages for delete all - Updates resolve logs toast messages to use `tc` count Signed-off-by: Dixsie Wolmers Change-Id: Idda2ae309e4248db60f89f68669e6e3b9f2cb832 --- src/store/modules/Health/EventLogStore.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/store') diff --git a/src/store/modules/Health/EventLogStore.js b/src/store/modules/Health/EventLogStore.js index 5664e99f..c9bd82fd 100644 --- a/src/store/modules/Health/EventLogStore.js +++ b/src/store/modules/Health/EventLogStore.js @@ -80,10 +80,12 @@ const EventLogStore = { '/redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.ClearLog' ) .then(() => dispatch('getEventLogData')) - .then(() => i18n.tc('pageEventLogs.toast.successDelete', data)) + .then(() => i18n.tc('pageEventLogs.toast.successDelete', data.length)) .catch((error) => { console.log(error); - throw new Error(i18n.tc('pageEventLogs.toast.errorDelete', data)); + throw new Error( + i18n.tc('pageEventLogs.toast.errorDelete', data.length) + ); }); }, async deleteEventLogs({ dispatch }, uris = []) { @@ -194,6 +196,7 @@ const EventLogStore = { }) ); }, + // Single log entry async updateEventLogStatus({ dispatch }, log) { const updatedEventLogStatus = log.status; return await api @@ -203,9 +206,9 @@ const EventLogStore = { }) .then(() => { if (log.status) { - return i18n.t('pageEventLogs.toast.successResolveLog'); + return i18n.tc('pageEventLogs.toast.successResolveLogs', 1); } else { - return i18n.t('pageEventLogs.toast.successUnresolveLog'); + return i18n.tc('pageEventLogs.toast.successUnresolveLogs', 1); } }) .catch((error) => { -- cgit v1.2.3