summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views/LogParser
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-03-17 21:55:38 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-03-17 21:55:38 -0400
commit013255d89e1a802e05f9fd61a16701ca73fa4411 (patch)
tree684714b18faba6d4413a106f885bcba18a2e5edb /src/SMAPI.Web/Views/LogParser
parent10c7192bb9f06ff96b9b98a812d9f72a8d77ac76 (diff)
parent4a494c67bdfe2c07ef5c49c55541a0f6e29627cf (diff)
downloadSMAPI-013255d89e1a802e05f9fd61a16701ca73fa4411.tar.gz
SMAPI-013255d89e1a802e05f9fd61a16701ca73fa4411.tar.bz2
SMAPI-013255d89e1a802e05f9fd61a16701ca73fa4411.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/Views/LogParser')
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
index 21adf35b..babd0bd3 100644
--- a/src/SMAPI.Web/Views/LogParser/Index.cshtml
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -17,16 +17,17 @@
{
<meta name="robots" content="noindex" />
}
- <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190221" />
+ <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190314" />
<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=20190221"></script>
+ <script src="~/Content/js/log-parser.js?r=20190310"></script>
<script>
$(function() {
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), noFormatting),
+ showSections: @Json.Serialize(Enum.GetNames(typeof(LogSection)).ToDictionary(section => section, section => false), noFormatting),
showLevels: @Json.Serialize(defaultFilters, noFormatting),
enableFilters: @Json.Serialize(!Model.ShowRaw)
}, '@Model.SectionUrl');
@@ -261,16 +262,32 @@ else if (Model.ParsedLog?.IsValid == true)
@foreach (var message in Model.ParsedLog.Messages)
{
string levelStr = message.Level.ToString().ToLower();
+ string sectionStartClass = message.IsStartOfSection ? "section-start" : null;
+ string sectionFilter = message.Section != null && !message.IsStartOfSection ? $"&& sectionsAllow('{message.Section}')" : null; // filter the message by section if applicable
- <tr class="@levelStr mod" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr')">
+ <tr class="mod @levelStr @sectionStartClass"
+ @if (message.IsStartOfSection)
+ {
+ <text>v-on:click="toggleSection('@message.Section')"</text>
+ }
+ v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionFilter">
<td v-pre>@message.Time</td>
<td v-pre>@message.Level.ToString().ToUpper()</td>
<td v-pre data-title="@message.Mod">@message.Mod</td>
- <td v-pre>@message.Text</td>
+ <td>
+ <span v-pre class="log-message-text">@message.Text</span>
+ @if (message.IsStartOfSection)
+ {
+ <span class="section-toggle-message">
+ <template v-if="sectionsAllow('@message.Section')">This section is shown. Click here to hide it.</template>
+ <template v-else>This section is hidden. Click here to show it.</template>
+ </span>
+ }
+ </td>
</tr>
if (message.Repeated > 0)
{
- <tr class="@levelStr mod mod-repeat" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr')">
+ <tr class="@levelStr mod mod-repeat" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionFilter">
<td colspan="3"></td>
<td v-pre><i>repeats [@message.Repeated] times.</i></td>
</tr>