diff --git a/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs b/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs index 056bbff..8101d70 100644 --- a/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs +++ b/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs @@ -272,6 +272,19 @@ ClientOperations clientOps } } + // Ensure that the log entries are in descending order. + if (null != logEntries?.Entries) + logEntries.Entries.Sort + ( + (a, b) => + { + if (a.DateTime == null && b.DateTime == null) return 0; + if (a.DateTime == null) return 1; // null goes after non-null + if (b.DateTime == null) return -1; // null goes after non-null + return b.DateTime.Value.CompareTo(a.DateTime.Value); // reverse order + } + ); + // Create the directive. clientOps.Directives.Add(new VAF.Configuration.Domain.ClientDirective.UpdateDashboardContent() { diff --git a/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html b/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html index ce577c2..95d6e5b 100644 --- a/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html +++ b/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html @@ -493,6 +493,13 @@