diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Web/Views/LogParser/Index.cshtml | 12 | ||||
-rw-r--r-- | src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 6 |
2 files changed, 12 insertions, 6 deletions
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; } } }); |