diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-25 23:33:07 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-25 23:33:07 -0500 |
commit | c984d5ad51c80a9ede1613c2bbbf51279966dd8b (patch) | |
tree | f5f4cf6391192aee1f50d841631dac329117f200 | |
parent | 212e85489a456acca6889faff5da835cbb707080 (diff) | |
download | SMAPI-c984d5ad51c80a9ede1613c2bbbf51279966dd8b.tar.gz SMAPI-c984d5ad51c80a9ede1613c2bbbf51279966dd8b.tar.bz2 SMAPI-c984d5ad51c80a9ede1613c2bbbf51279966dd8b.zip |
fix log filtering some mods incorrectly
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI.Web/Views/LogParser/Index.cshtml | 12 | ||||
-rw-r--r-- | src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 6 |
3 files changed, 13 insertions, 6 deletions
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; } } }); |