From a23261106ea454ab2e264007f27ca11ddbb7e44b Mon Sep 17 00:00:00 2001 From: danvolchek Date: Sun, 17 Feb 2019 20:39:36 -0600 Subject: add update info in suggested fixes section --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 61 +++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 5 deletions(-) (limited to 'src/SMAPI.Web/Views/LogParser') diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 58830d64..07b413b1 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -117,9 +117,60 @@ else if (Model.ParsedLog?.IsValid == true) @* parsed log *@ @if (Model.ParsedLog?.IsValid == true) { -

Log info

- + @if (Model.ParsedLog.Mods.Any(mod => mod.HasUpdate)) + { +

Suggested fixes

+ +

You have some mods that aren't fully up to date. Updating them can fix problems.

+
+ + @foreach (LogModInfo mod in Model.ParsedLog.Mods.Where(mod => (mod.HasUpdate && mod.ContentPackFor == null) || (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList) && contentPackList.Any(pack => pack.HasUpdate)))) + { + + + + + } +
+ Updates Available: +
+ @mod.Name + @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList)) + { +
+ @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) + { + + @contentPack.Name
+ } +
+ } +
+ @if (mod.HasUpdate) + { + + @(mod.Version == null ? @mod.UpdateVersion : $"{mod.Version} → {mod.UpdateVersion}") + + } + else + { + + } + + @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out contentPackList)) + { +
+ @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) + { + @contentPack.Version → @contentPack.UpdateVersion
+ } +
+ } +
+ } + +

Log info

+ @@ -138,8 +189,8 @@ else if (Model.ParsedLog?.IsValid == true)
Game info:
Stardew Valley:@Model.ParsedLog.Timestamp.UtcDateTime.ToString("yyyy-MM-dd HH:mm") UTC ({{localTimeStarted}} your time)
-
- +
+
- @foreach (var mod in Model.ParsedLog.Mods.Where(p => p.ContentPackFor == null)) + @foreach (var mod in Model.ParsedLog.Mods.Where(p => p.Loaded && p.ContentPackFor == null)) { -- cgit
Installed mods: @if (!Model.ShowRaw) @@ -149,7 +200,7 @@ else if (Model.ParsedLog?.IsValid == true) hide all }