summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
index 4d95901e..8151c502 100644
--- a/src/SMAPI.Web/Views/LogParser/Index.cshtml
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -5,6 +5,11 @@
@{
ViewData["Title"] = "SMAPI log parser";
IDictionary<string, LogModInfo[]> contentPacks = Model.GetContentPacksByMod();
+ IDictionary<string, bool> defaultFilters = Enum
+ .GetValues(typeof(LogLevel))
+ .Cast<LogLevel>()
+ .ToDictionary(level => level.ToString().ToLower(), level => level != LogLevel.Trace);
+ JsonSerializerSettings noFormatting = new JsonSerializerSettings { Formatting = Formatting.None };
}
@section Head {
@@ -21,15 +26,8 @@
smapi.logParser({
logStarted: new Date(@Json.Serialize(Model.ParsedLog?.Timestamp)),
showPopup: @Json.Serialize(Model.ParsedLog == null),
- showMods: @Json.Serialize(Model.ParsedLog?.Mods?.Select(p => Model.GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, slug => true), new JsonSerializerSettings { Formatting = Formatting.None }),
- showLevels: {
- @LogLevel.Trace.ToString().ToLower(): false,
- @LogLevel.Debug.ToString().ToLower(): true,
- @LogLevel.Info.ToString().ToLower(): true,
- @LogLevel.Alert.ToString().ToLower(): true,
- @LogLevel.Warn.ToString().ToLower(): true,
- @LogLevel.Error.ToString().ToLower(): true
- }
+ showMods: @Json.Serialize(Model.ParsedLog?.Mods?.Select(p => Model.GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, slug => true), noFormatting),
+ showLevels: @Json.Serialize(defaultFilters, noFormatting)
}, '@Model.SectionUrl');
});
</script>