diff --git a/dashboard-ui/dashboard/autoorganizelog.js b/dashboard-ui/dashboard/autoorganizelog.js index e0f237444f..0b65f9b96e 100644 --- a/dashboard-ui/dashboard/autoorganizelog.js +++ b/dashboard-ui/dashboard/autoorganizelog.js @@ -325,7 +325,12 @@ function onServerEvent(e, apiClient, data) { - if (data) { + if (e.type == 'ScheduledTaskEnded') { + + if (data && data.Key == 'AutoOrganize') { + reloadItems(page, false); + } + } else if (e.type == 'AutoOrganize_ItemUpdated' && data) { updateItemStatus(page, data); } else { @@ -380,7 +385,11 @@ reloadItems(view, true); - events.on(serverNotifications, 'AutoOrganizeUpdate', onServerEvent); + events.on(serverNotifications, 'AutoOrganize_LogReset', onServerEvent); + events.on(serverNotifications, 'AutoOrganize_ItemUpdated', onServerEvent); + events.on(serverNotifications, 'AutoOrganize_ItemRemoved', onServerEvent); + events.on(serverNotifications, 'AutoOrganize_ItemAdded', onServerEvent); + events.on(serverNotifications, 'ScheduledTaskEnded', onServerEvent); // on here taskButton({ @@ -396,7 +405,11 @@ currentResult = null; - events.off(serverNotifications, 'AutoOrganizeUpdate', onServerEvent); + events.off(serverNotifications, 'AutoOrganize_LogReset', onServerEvent); + events.off(serverNotifications, 'AutoOrganize_ItemUpdated', onServerEvent); + events.off(serverNotifications, 'AutoOrganize_ItemRemoved', onServerEvent); + events.off(serverNotifications, 'AutoOrganize_ItemAdded', onServerEvent); + events.off(serverNotifications, 'ScheduledTaskEnded', onServerEvent); // off here taskButton({