From e6fff36d6c12558d452c833c7d53b616587a29f7 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Sun, 15 Oct 2023 16:21:08 +0300 Subject: [PATCH] Client fix --- .../Components/Spinner.razor | 2 +- .../Models/DemoUser.cs | 11 +++++----- .../Pages/Basic/Settings.razor | 4 ++-- .../Pages/Steam/OpenIdCallback.razor | 4 ++-- .../Pages/Tools/RecreateStacktrace.razor | 6 ++++-- .../Tools/RecreateStacktracePrerendered.razor | 6 ++++-- .../Pages/User/CrashReportsViewer.razor | 20 +++++++++---------- src/BUTR.Site.NexusMods.Client/Program.cs | 2 +- .../Services/CrashReportsClientWithDemo.cs | 15 +++++++++----- .../Shared/Header.razor | 4 ++-- .../Clients.cs | 16 ++++++--------- 11 files changed, 47 insertions(+), 43 deletions(-) diff --git a/src/BUTR.Site.NexusMods.Client/Components/Spinner.razor b/src/BUTR.Site.NexusMods.Client/Components/Spinner.razor index 39e5c03a..0ebd84b5 100644 --- a/src/BUTR.Site.NexusMods.Client/Components/Spinner.razor +++ b/src/BUTR.Site.NexusMods.Client/Components/Spinner.razor @@ -1,4 +1,4 @@ - +@* Leave raw *@
\ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.Client/Models/DemoUser.cs b/src/BUTR.Site.NexusMods.Client/Models/DemoUser.cs index 28dc4f1f..8586a4e4 100644 --- a/src/BUTR.Site.NexusMods.Client/Models/DemoUser.cs +++ b/src/BUTR.Site.NexusMods.Client/Models/DemoUser.cs @@ -1,5 +1,4 @@ using BUTR.CrashReport.Bannerlord.Parser; -using BUTR.CrashReport.Models; using BUTR.Site.NexusMods.ServerClient; using BUTR.Site.NexusMods.Shared.Helpers; @@ -10,7 +9,7 @@ using System.Net.Http; using System.Threading.Tasks; -using CrashReportModel = BUTR.Site.NexusMods.ServerClient.CrashReportModel; +using ExceptionModel = BUTR.CrashReport.Models.ExceptionModel; namespace BUTR.Site.NexusMods.Client.Models; @@ -25,11 +24,11 @@ public static class DemoUser new(3, "Demo Mod 3", ImmutableArray.Empty, ImmutableArray.Empty, ImmutableArray.Empty, ImmutableArray.Empty), new(4, "Demo Mod 4", ImmutableArray.Empty, ImmutableArray.Empty, ImmutableArray.Empty, ImmutableArray.Empty), }; - private static List? _crashReports; + private static List? _crashReports; public static Task GetProfile() => Task.FromResult(_profile); public static IAsyncEnumerable GetMods() => _mods.ToAsyncEnumerable(); - public static async IAsyncEnumerable GetCrashReports(IHttpClientFactory factory) + public static async IAsyncEnumerable GetCrashReports(IHttpClientFactory factory) { static string GetException(ExceptionModel? exception, bool inner = false) => exception is null ? string.Empty : $""" @@ -53,14 +52,14 @@ static string GetException(ExceptionModel? exception, bool inner = false) => exc if (_crashReports is null) { - var crm = new List(); + var crm = new List(); const string baseUrl = "https://report.butr.link/"; var client = factory.CreateClient("InternalReports"); var reports = new[] { "4DDA8D", "6FB0EF", "2AE0EA", "F966E3" }; var contents = await Task.WhenAll(reports.Select(r => DownloadReport(client, r))); foreach (var (id, cr) in contents) { - var report = new CrashReportModel(cr.Id, cr.Version, cr.GameVersion, cr.Exception.Type, GetException(cr.Exception), DateTime.UtcNow, $"{baseUrl}{id}.html", cr.Modules.Select(x => x.Id).ToArray(), CrashReportStatus.New, string.Empty); + var report = new CrashReportModel2(cr.Id, cr.Version, cr.GameVersion, cr.Exception.Type, GetException(cr.Exception), DateTime.UtcNow, $"{baseUrl}{id}.html", cr.Modules.Select(x => x.Id).ToArray(), CrashReportStatus.New, string.Empty); crm.Add(report); yield return report; diff --git a/src/BUTR.Site.NexusMods.Client/Pages/Basic/Settings.razor b/src/BUTR.Site.NexusMods.Client/Pages/Basic/Settings.razor index ea4c1d3c..32bb8012 100644 --- a/src/BUTR.Site.NexusMods.Client/Pages/Basic/Settings.razor +++ b/src/BUTR.Site.NexusMods.Client/Pages/Basic/Settings.razor @@ -10,7 +10,7 @@ Settings - + *@ diff --git a/src/BUTR.Site.NexusMods.Client/Pages/Steam/OpenIdCallback.razor b/src/BUTR.Site.NexusMods.Client/Pages/Steam/OpenIdCallback.razor index 0424f93b..259bdbe9 100644 --- a/src/BUTR.Site.NexusMods.Client/Pages/Steam/OpenIdCallback.razor +++ b/src/BUTR.Site.NexusMods.Client/Pages/Steam/OpenIdCallback.razor @@ -38,11 +38,11 @@ } - + *@