From a463a05607c89922af7e908b39aa897b8d23bfbf Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 3 Jun 2018 13:54:26 -0400 Subject: redesign log parser upload page This makes the instructions much more clear and prominent, so it should be more intuitive for players. The previous design often confused users because they saw the big textbox and ignored the little instructions above it. --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 153 +++++++++++++++++------------ 1 file changed, 89 insertions(+), 64 deletions(-) (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index d051026f..79cd7a2b 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -1,23 +1,14 @@ -@{ - ViewData["Title"] = "SMAPI log parser"; - - IDictionary contentPacks = Model.ParsedLog?.Mods - ?.GroupBy(mod => mod.ContentPackFor) - .Where(group => group.Key != null) - .ToDictionary(group => group.Key, group => group.ToArray()); - - Regex slugInvalidCharPattern = new Regex("[^a-z0-9]", RegexOptions.Compiled | RegexOptions.IgnoreCase); - string GetSlug(string modName) - { - return slugInvalidCharPattern.Replace(modName, ""); - } -} -@using System.Text.RegularExpressions @using Newtonsoft.Json @using StardewModdingAPI.Web.Framework.LogParsing.Models @model StardewModdingAPI.Web.ViewModels.LogParserModel + +@{ + ViewData["Title"] = "SMAPI log parser"; + IDictionary contentPacks = Model.GetContentPacksByMod(); +} + @section Head { - + @@ -26,51 +17,104 @@ smapi.logParser({ logStarted: new Date(@Json.Serialize(Model.ParsedLog?.Timestamp)), showPopup: @Json.Serialize(Model.ParsedLog == null), - showMods: @Json.Serialize(Model.ParsedLog?.Mods?.Select(p => GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, slug => true), new JsonSerializerSettings { Formatting = Formatting.None }), + showMods: @Json.Serialize(Model.ParsedLog?.Mods?.Select(p => Model.GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, slug => true), new JsonSerializerSettings { Formatting = Formatting.None }), showLevels: { - trace: false, - debug: false, - info: true, - alert: true, - warn: true, - error: true + @LogLevel.Trace.ToString().ToLower(): false, + @LogLevel.Debug.ToString().ToLower(): false, + @LogLevel.Info.ToString().ToLower(): true, + @LogLevel.Alert.ToString().ToLower(): true, + @LogLevel.Warn.ToString().ToLower(): true, + @LogLevel.Error.ToString().ToLower(): true } }, '@Model.SectionUrl'); }); } -@********* -** Intro -*********@ +@* intro and upload result banner *@

This page lets you upload, view, and share a SMAPI log to help troubleshoot mod issues.

- -@if (Model.ParsedLog?.IsValid == true) +@if (Model.UploadError != null) { -