From 0f8d183ec71ca42fdbfef08f7e1edc7f822ef040 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard <github@jplamondonw.com> Date: Sun, 25 Feb 2018 14:24:25 -0500 Subject: bypass cache on log parser page --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 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 be9f74a0..d9125954 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -17,10 +17,10 @@ @using StardewModdingAPI.Web.Framework.LogParsing.Models @model StardewModdingAPI.Web.ViewModels.LogParserModel @section Head { - <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20180101" /> + <link rel="stylesheet" href="~/Content/css/log-parser.css?r=201802" /> <script src="https://cdn.jsdelivr.net/npm/vue"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" crossorigin="anonymous"></script> - <script src="~/Content/js/log-parser.js?r=20180101"></script> + <script src="~/Content/js/log-parser.js?r=201802"></script> <script> $(function() { smapi.logParser({ -- cgit From c984d5ad51c80a9ede1613c2bbbf51279966dd8b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard <github@jplamondonw.com> Date: Sun, 25 Feb 2018 23:33:07 -0500 Subject: fix log filtering some mods incorrectly --- docs/release-notes.md | 1 + src/SMAPI.Web/Views/LogParser/Index.cshtml | 12 ++++++------ src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 6 ++++++ 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src/SMAPI.Web/Views/LogParser') diff --git a/docs/release-notes.md b/docs/release-notes.md index 16284211..74db0256 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,6 +2,7 @@ ## 2.6 (upcoming) * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. + * Fixed some log entries being incorrectly filtered. ## 2.5.2 * For modders: diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index d9125954..39557d50 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -78,13 +78,13 @@ <caption> Installed mods: <span class="notice txt"><i>click any mod to filter</i></span> - <span class="notice btn txt" v-on:click="showAllMods" v-if="stats.modsHidden > 0">show all</span> - <span class="notice btn txt" v-on:click="hideAllMods" v-if="stats.modsShown > 0 && stats.modsHidden > 0">hide all</span> + <span class="notice btn txt" v-on:click="showAllMods" v-show="stats.modsHidden > 0">show all</span> + <span class="notice btn txt" v-on:click="hideAllMods" v-show="stats.modsShown > 0 && stats.modsHidden > 0">hide all</span> </caption> @foreach (var mod in Model.ParsedLog.Mods.Where(p => p.ContentPackFor == null)) { <tr v-on:click="toggleMod('@GetSlug(mod.Name)')" class="mod-entry" v-bind:class="{ hidden: !showMods['@GetSlug(mod.Name)'] }"> - <td><input type="checkbox" v-bind:checked="showMods['@GetSlug(mod.Name)']" v-if="anyModsHidden" /></td> + <td><input type="checkbox" v-bind:checked="showMods['@GetSlug(mod.Name)']" v-show="anyModsHidden" /></td> <td> @mod.Name @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList)) @@ -127,9 +127,9 @@ <table id="log"> @foreach (var message in Model.ParsedLog.Messages) { - string levelStr = @message.Level.ToString().ToLower(); + string levelStr = message.Level.ToString().ToLower(); - <tr class="@levelStr mod" v-if="showMods['@message.Mod'] && showLevels['@levelStr']"> + <tr class="@levelStr mod" v-show="filtersAllow('@GetSlug(message.Mod)', '@levelStr')"> <td>@message.Time</td> <td>@message.Level.ToString().ToUpper()</td> <td data-title="@message.Mod">@message.Mod</td> @@ -137,7 +137,7 @@ </tr> if (message.Repeated > 0) { - <tr class="@levelStr mod mod-repeat" v-if="showMods['@message.Mod'] && showLevels['@levelStr']"> + <tr class="@levelStr mod mod-repeat" v-show="filtersAllow('@GetSlug(message.Mod)', '@levelStr')"> <td colspan="3"></td> <td><i>repeats [@message.Repeated] times.</i></td> </tr> diff --git a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js index 87a70391..38a75a80 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js +++ b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js @@ -62,6 +62,7 @@ smapi.logParser = function (data, sectionUrl) { updateModFilters(); }, + showAllMods: function () { for (var key in this.showMods) { if (this.showMods.hasOwnProperty(key)) { @@ -70,6 +71,7 @@ smapi.logParser = function (data, sectionUrl) { } updateModFilters(); }, + hideAllMods: function () { for (var key in this.showMods) { if (this.showMods.hasOwnProperty(key)) { @@ -77,6 +79,10 @@ smapi.logParser = function (data, sectionUrl) { } } updateModFilters(); + }, + + filtersAllow: function(modId, level) { + return this.showMods[modId] !== false && this.showLevels[level] !== false; } } }); -- cgit From 5c1318431b716e13feb214abe8116cb1498047a5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard <github@jplamondonw.com> Date: Sun, 25 Feb 2018 23:35:14 -0500 Subject: always include raw taxt in model --- src/SMAPI.Web/Framework/LogParsing/LogParser.cs | 8 +++++--- src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs | 4 ++-- src/SMAPI.Web/Views/LogParser/Index.cshtml | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/SMAPI.Web/Views/LogParser') diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs index 385accf0..9e44f163 100644 --- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs +++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs @@ -55,6 +55,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing return new ParsedLog { IsValid = false, + RawText = logText, Error = "The log is empty." }; } @@ -63,7 +64,8 @@ namespace StardewModdingAPI.Web.Framework.LogParsing ParsedLog log = new ParsedLog { IsValid = true, - Messages = this.CollapseRepeats(this.GetMessages(logText)).ToArray(), + RawText = logText, + Messages = this.CollapseRepeats(this.GetMessages(logText)).ToArray() }; // parse log messages @@ -154,7 +156,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing { IsValid = false, Error = ex.Message, - RawTextIfError = logText + RawText = logText }; } catch (Exception ex) @@ -163,7 +165,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing { IsValid = false, Error = $"Parsing the log file failed. Technical details:\n{ex}", - RawTextIfError = logText + RawText = logText }; } } diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs index 31ef2fe1..a82b6a1b 100644 --- a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs +++ b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs @@ -17,8 +17,8 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models /// <summary>An error message indicating why the log file is invalid.</summary> public string Error { get; set; } - /// <summary>The raw text if <see cref="IsValid"/> is false.</summary> - public string RawTextIfError { get; set; } + /// <summary>The raw log text.</summary> + public string RawText { get; set; } /**** ** Log data diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 39557d50..310277eb 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -155,7 +155,7 @@ else if (Model.ParsedLog?.IsValid == false) </div> <h3>Raw log</h3> - <pre>@Model.ParsedLog.RawTextIfError</pre> + <pre>@Model.ParsedLog.RawText</pre> } <div id="upload-area"> -- cgit From a82e0bb275f9088ba28f6b87daf1d13d1a5747a3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard <github@jplamondonw.com> Date: Mon, 26 Feb 2018 00:28:32 -0500 Subject: bypass cache on log parser page --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 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 310277eb..35340aa5 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -17,10 +17,10 @@ @using StardewModdingAPI.Web.Framework.LogParsing.Models @model StardewModdingAPI.Web.ViewModels.LogParserModel @section Head { - <link rel="stylesheet" href="~/Content/css/log-parser.css?r=201802" /> + <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20180225" /> <script src="https://cdn.jsdelivr.net/npm/vue"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" crossorigin="anonymous"></script> - <script src="~/Content/js/log-parser.js?r=201802"></script> + <script src="~/Content/js/log-parser.js?r=20180225"></script> <script> $(function() { smapi.logParser({ -- cgit From c7f2e53f209bce7fb06fd316c380bf6161689abd Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard <github@jplamondonw.com> Date: Tue, 27 Feb 2018 21:50:49 -0500 Subject: fix content pack list formatting --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 35340aa5..f622ccc4 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -92,7 +92,7 @@ <div class="content-packs"> @foreach (var contentPack in contentPackList) { - <text>+@contentPack.Name @contentPack.Version</text> + <text>+ @contentPack.Name @contentPack.Version</text><br /> } </div> } -- cgit From ac6127c63e2978a5cf63ff4753991e5ab33db8c3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard <github@jplamondonw.com> Date: Sun, 4 Mar 2018 13:37:42 -0500 Subject: fix log parser error when mod names are duplicated --- docs/release-notes.md | 1 + src/SMAPI.Web/Views/LogParser/Index.cshtml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/SMAPI.Web/Views/LogParser') diff --git a/docs/release-notes.md b/docs/release-notes.md index fb056e79..e1c262be 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,7 @@ * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. * Fixed some log entries being incorrectly filtered. + * Fixed error when mods have duplicate names. * For SMAPI developers: * Internal changes to support the upcoming Stardew Valley 1.3 update. diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index f622ccc4..d2d8004e 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -26,7 +26,7 @@ smapi.logParser({ logStarted: new Date(@Json.Serialize(Model.ParsedLog?.Timestamp)), showPopup: @Json.Serialize(Model.ParsedLog == null), - showMods: @Json.Serialize(Model.ParsedLog?.Mods?.ToDictionary(p => GetSlug(p.Name), p => true), new JsonSerializerSettings { Formatting = Formatting.None }), + showMods: @Json.Serialize(Model.ParsedLog?.Mods?.Select(p => GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, slug => true), new JsonSerializerSettings { Formatting = Formatting.None }), showLevels: { trace: false, debug: false, -- cgit