diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-02-21 20:13:05 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-02-24 18:41:56 -0500 |
commit | fa3fa400fff0b97cbdca267295f8fbebbab17b61 (patch) | |
tree | 5c7a77404c13694d0b797531e3320925f9de547f /src/SMAPI.Web | |
parent | 781074473a0f56488732b5dcb4c19f319f4da003 (diff) | |
download | SMAPI-fa3fa400fff0b97cbdca267295f8fbebbab17b61.tar.gz SMAPI-fa3fa400fff0b97cbdca267295f8fbebbab17b61.tar.bz2 SMAPI-fa3fa400fff0b97cbdca267295f8fbebbab17b61.zip |
minor tweaks to new log parser UI (#619)
Diffstat (limited to 'src/SMAPI.Web')
-rw-r--r-- | src/SMAPI.Web/Framework/LogParsing/LogParser.cs | 8 | ||||
-rw-r--r-- | src/SMAPI.Web/Views/LogParser/Index.cshtml | 89 | ||||
-rw-r--r-- | src/SMAPI.Web/wwwroot/Content/css/log-parser.css | 8 |
3 files changed, 52 insertions, 53 deletions
diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs index 5cdc501f..fdc19404 100644 --- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs +++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs @@ -78,7 +78,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing }; // parse log messages - LogModInfo smapiMod = new LogModInfo { Name = "SMAPI", Author = "Pathoschild", Description = "", Loaded = true}; + LogModInfo smapiMod = new LogModInfo { Name = "SMAPI", Author = "Pathoschild", Description = "", Loaded = true }; LogModInfo gameMod = new LogModInfo { Name = "game", Author = "", Description = "", Loaded = true }; IDictionary<string, LogModInfo> mods = new Dictionary<string, LogModInfo>(); bool inModList = false; @@ -100,11 +100,9 @@ namespace StardewModdingAPI.Web.Framework.LogParsing break; default: - { if (mods.ContainsKey(message.Mod)) mods[message.Mod].Errors++; break; - } } } @@ -162,11 +160,11 @@ namespace StardewModdingAPI.Web.Framework.LogParsing } else { - mods[name] = new LogModInfo {Name = name, UpdateVersion = version, UpdateLink = link, Loaded = false}; + mods[name] = new LogModInfo { Name = name, UpdateVersion = version, UpdateLink = link, Loaded = false }; } } - else if(message.Level == LogLevel.Alert && this.SMAPIUpdatePattern.IsMatch(message.Text)) + else if (message.Level == LogLevel.Alert && this.SMAPIUpdatePattern.IsMatch(message.Text)) { Match match = this.SMAPIUpdatePattern.Match(message.Text); string version = match.Groups["version"].Value; diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index bf70f2d7..21adf35b 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -17,10 +17,10 @@ { <meta name="robots" content="noindex" /> } - <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20180627" /> + <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190221" /> <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" crossorigin="anonymous"></script> - <script src="~/Content/js/log-parser.js?r=20180627"></script> + <script src="~/Content/js/log-parser.js?r=20190221"></script> <script> $(function() { smapi.logParser({ @@ -121,52 +121,53 @@ else if (Model.ParsedLog?.IsValid == true) @if (Model.ParsedLog.Mods.Any(mod => mod.HasUpdate)) { <h2>Suggested fixes</h2> + <ul id="fix-list"> + <li> + Consider updating these mods to fix problems: - <p>You have some mods that aren't fully up to date. Updating them can fix problems.</p> - <table id="updates" class="table"> - <caption> - Updates available: - </caption> - @foreach (LogModInfo mod in Model.ParsedLog.Mods.Where(mod => (mod.HasUpdate && mod.ContentPackFor == null) || (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList) && contentPackList.Any(pack => pack.HasUpdate)))) - { - <tr class="mod-entry"> - <td> - <strong class=@(!mod.HasUpdate ? "hidden": "")>@mod.Name</strong> - @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList)) - { - <div class="content-packs"> - @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) - { - <text>+ @contentPack.Name</text><br /> - } - </div> - } - </td> - <td> - @if (mod.HasUpdate) - { - <a href="@mod.UpdateLink" target="_blank"> - @(mod.Version == null ? @mod.UpdateVersion : $"{mod.Version} → {mod.UpdateVersion}") - </a> - } - else + <table id="updates" class="table"> + @foreach (LogModInfo mod in Model.ParsedLog.Mods.Where(mod => (mod.HasUpdate && mod.ContentPackFor == null) || (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList) && contentPackList.Any(pack => pack.HasUpdate)))) { - <span class="invisible">Okay</span> - } + <tr class="mod-entry"> + <td> + <strong class=@(!mod.HasUpdate ? "hidden" : "")>@mod.Name</strong> + @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList)) + { + <div class="content-packs"> + @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) + { + <text>+ @contentPack.Name</text><br/> + } + </div> + } + </td> + <td> + @if (mod.HasUpdate) + { + <a href="@mod.UpdateLink" target="_blank"> + @(mod.Version == null ? @mod.UpdateVersion : $"{mod.Version} → {mod.UpdateVersion}") + </a> + } + else + { + <text> </text> + } - @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out contentPackList)) - { - <div> - @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) - { - <a href="@contentPack.UpdateLink" target="_blank">@contentPack.Version → @contentPack.UpdateVersion</a><br /> - } - </div> + @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out contentPackList)) + { + <div> + @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) + { + <a href="@contentPack.UpdateLink" target="_blank">@contentPack.Version → @contentPack.UpdateVersion</a><br/> + } + </div> + } + </td> + </tr> } - </td> - </tr> - } - </table> + </table> + </li> + </ul> } <h2>Log info</h2> diff --git a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css index 5e7ccb79..ea28cd7d 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css +++ b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css @@ -78,12 +78,12 @@ table caption { min-height: 1.3em; } -#updates { - min-width: 10em; +#fix-list { + margin-bottom: 2em; } -.invisible { - visibility: hidden; +#updates { + min-width: 10em; } #mods { |