summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Views')
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml119
-rw-r--r--src/SMAPI.Web/Views/Shared/_Layout.cshtml30
-rw-r--r--src/SMAPI.Web/Views/_ViewStart.cshtml3
3 files changed, 152 insertions, 0 deletions
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
new file mode 100644
index 00000000..49688d78
--- /dev/null
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -0,0 +1,119 @@
+@{
+ ViewData["Title"] = "SMAPI log parser";
+}
+@model StardewModdingAPI.Web.ViewModels.LogParserModel
+@section Head {
+ <link rel="stylesheet" href="~/Content/css/log-parser.css" />
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" crossorigin="anonymous"></script>
+ <script src="~/Content/js/log-parser.js"></script>
+ <style type="text/css" id="modflags"></style>
+ <script>
+ $(function() {
+ smapi.logParser('@Model.SectionUrl', '@Model.PasteID');
+ });
+ </script>
+}
+
+@*********
+** Intro
+*********@
+<p id="blurb">This page lets you upload, view, and share a SMAPI log to help troubleshoot mod issues.</p>
+<input type="button" id="upload-button" value="Share a new log" />
+
+@if (Model.PasteID != null)
+{
+ <h2>Parsed log</h2>
+ <ul id="tabs">
+ <li>TRACE</li>
+ <li>DEBUG</li>
+ <li class="active">INFO</li>
+ <li class="active">ALERT</li>
+ <li class="active">WARN</li>
+ <li class="active">ERROR</li>
+ <li class="notice">Click tabs to toggle message visibility</li>
+ </ul>
+}
+<div id="output" class="trace debug"></div>
+<script class="template" id="template-body" type="text/html">
+ <div class="always">
+ <table id="gameinfo">
+ <caption>Game info:</caption>
+ <tr>
+ <td>SMAPI Version</td>
+ <td>{0}</td>
+ </tr>
+ <tr>
+ <td>Game Version</td>
+ <td>{1}</td>
+ </tr>
+ <tr>
+ <td>Platform</td>
+ <td>{2}</td>
+ </tr>
+ <tr>
+ <td>Mods path</td>
+ <td>{4}</td>
+ </tr>
+ <tr>
+ <td>Log started</td>
+ <td>{3}</td>
+ </tr>
+ </table>
+ <br />
+ <table id="modslist">
+ <caption>Installed Mods: <span id="modlink-r" class="notice btn">Remove all mod filters</span><span class="notice txt"><i>Click any mod to filter</i></span> <span id="modlink-a" class="notice btn txt">Select all</span></caption>
+ </table>
+ </div>
+ <table id="log"></table>
+</script>
+<script class="template" id="template-css" type="text/html">
+ #output.modfilter:not(.mod-{0}) .mod-{0} { display:none; } #output.modfilter.mod-{0} #modslist tr { background:#ffeeee; } #output.modfilter.mod-{0} #modslist tr#modlink-{0} { background:#eeffee; }
+</script>
+<script class="template" id="template-modentry" type="text/html">
+ <tr id="modlink-{0}">
+ <td>{1}</td>
+ <td>{2}</td>
+ <td>{3}</td>
+ <td class={4}>{5}</td>
+ </tr>
+</script>
+<script class="template" id="template-logentry" type="text/html">
+ <tr class="{0} mod mod-{1}">
+ <td>{2}</td>
+ <td>{3}</td>
+ <td data-title="{4}">{4}</td>
+ <td>{5}</td>
+ </tr>
+</script>
+<script class="template" id="template-lognotice" type="text/html">
+ <tr class="{0} mod-repeat mod mod-{1}">
+ <td colspan="3"></td>
+ <td><i>repeats [{2}] times.</i></td>
+ </tr>
+</script>
+<div id="popup-upload" class="popup">
+ <h1>Upload log file</h1>
+ <div class="frame">
+ <ol>
+ <li><a href="https://stardewvalleywiki.com/Modding:Player_FAQs#SMAPI_log" target="_blank">Find your SMAPI log</a>.</li>
+ <li>Drag the file onto the textbox below (or paste the text in).</li>
+ <li>Click <em>Parse</em>.</li>
+ <li>Share the URL of the new page.</li>
+ </ol>
+ <textarea id="input" placeholder="Paste or drag the log here"></textarea>
+ <div class="buttons">
+ <input type="button" id="submit" value="Parse"/>
+ <input type="button" id="cancel" value="Cancel"/>
+ </div>
+ </div>
+</div>
+<div id="popup-raw" class="popup">
+ <h1>Raw log file</h1>
+ <div class="frame">
+ <textarea id="dataraw"></textarea>
+ <div class="buttons">
+ <input type="button" id="closeraw" value="Close" />
+ </div>
+ </div>
+</div>
+<div id="uploader"></div>
diff --git a/src/SMAPI.Web/Views/Shared/_Layout.cshtml b/src/SMAPI.Web/Views/Shared/_Layout.cshtml
new file mode 100644
index 00000000..547a8178
--- /dev/null
+++ b/src/SMAPI.Web/Views/Shared/_Layout.cshtml
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8" />
+ <title>@ViewData["Title"] - SMAPI.io</title>
+ <link rel="stylesheet" href="~/Content/css/main.css" />
+ @RenderSection("Head", required: false)
+</head>
+<body>
+ <div id="sidebar">
+ <h4>SMAPI</h4>
+ <ul>
+ <li><a href="https://stardewvalleywiki.com/Modding:Index">FAQs & guides</a></li>
+ <li><a href="https://github.com/pathoschild/SMAPI/releases">Download SMAPI</a></li>
+ <li><a href="https://discord.gg/stardewvalley">Get help on Discord</a></li>
+ </ul>
+ </div>
+ <div id="content-column">
+ <div id="content">
+ <h1>@ViewData["Title"]</h1>
+ @RenderBody()
+ </div>
+ <div id="footer">
+ <div id="license">
+ Hi! You can <a href="https://github.com/pathoschild/SMAPI" title="view source">view the source code</a> or <a href="https://github.com/pathoschild/SMAPI/issues" title="report issue">report a bug or suggestion</a>.
+ </div>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/src/SMAPI.Web/Views/_ViewStart.cshtml b/src/SMAPI.Web/Views/_ViewStart.cshtml
new file mode 100644
index 00000000..a5f10045
--- /dev/null
+++ b/src/SMAPI.Web/Views/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}