From a9e3458a3b93649f62919566c3ffacf27f16332c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 29 Mar 2018 00:39:25 -0400 Subject: add success/error banner to log parser page --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 36 ++++++++++++++++++------ src/SMAPI.Web/wwwroot/Content/css/log-parser.css | 20 +++++++++++-- src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 4 ++- 3 files changed, 48 insertions(+), 12 deletions(-) (limited to 'src/SMAPI.Web') diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 7213e286..c909b203 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -44,11 +44,36 @@ ** Intro *********@

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

- @if (Model.ParsedLog?.IsValid == true) { -

Parsed log

+ +} +else if (Model.ParsedLog?.IsValid == false) +{ + +} +else +{ + +} + +@********* +** Parsed log +*********@ +@if (Model.ParsedLog?.IsValid == true) +{ +

Log info

@@ -148,12 +173,6 @@ } else if (Model.ParsedLog?.IsValid == false) { -

Parsed log

-
-

We couldn't parse that file, but you can still share the link.

-

Error details: @Model.ParsedLog.Error

-
-

Raw log

@Model.ParsedLog.RawText
} @@ -166,7 +185,6 @@ else if (Model.ParsedLog?.IsValid == false)
  • Find your SMAPI log file (not the console text).
  • Drag the file onto the textbox below (or paste the text in).
  • Click Parse.
  • -
  • Share the URL of the new page.
  • diff --git a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css index cbf09ffe..9d604072 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css +++ b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css @@ -20,18 +20,34 @@ caption { font-family: monospace; } -#upload-button { +input#upload-button { background: #ccf; border: 1px solid #000088; } -#upload-button { +input#upload-button { background: #eef; } /********* ** Log metadata & filters *********/ +.banner { + border: 2px solid gray; + border-radius: 5px; + padding: 1em; +} + +.banner.success { + border-color: green; + background: #CFC; +} + +.banner.error { + border-color: red; + background: #FCC; +} + #metadata, #mods, #filters { font-weight: bold; border-bottom: 1px dashed #888888; diff --git a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js index 38a75a80..c4a35e96 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js +++ b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js @@ -92,7 +92,9 @@ smapi.logParser = function (data, sectionUrl) { *********/ var error = $("#error"); - $("#upload-button").on("click", function() { + $("#upload-button").on("click", function(e) { + e.preventDefault(); + $("#input").val(""); $("#popup-upload").fadeIn(); }); -- cgit
    Game info: