summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-01-05 20:18:16 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-01-05 20:18:16 -0500
commitf976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da (patch)
tree260fa7579e1c361283bda09c2616783c3fdb5b9a /src/SMAPI.Web/Views
parentd34f369d35290bca96cc7225d9765d1a8a66fa8b (diff)
parent48959375b9ef52abf7c7a9404d43aac6ba780047 (diff)
downloadSMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.tar.gz
SMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.tar.bz2
SMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/Views')
-rw-r--r--src/SMAPI.Web/Views/Index/Index.cshtml24
-rw-r--r--src/SMAPI.Web/Views/Index/Privacy.cshtml8
-rw-r--r--src/SMAPI.Web/Views/JsonValidator/Index.cshtml71
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml27
4 files changed, 73 insertions, 57 deletions
diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml
index ec9cfafe..5d91dc84 100644
--- a/src/SMAPI.Web/Views/Index/Index.cshtml
+++ b/src/SMAPI.Web/Views/Index/Index.cshtml
@@ -1,3 +1,4 @@
+@using Markdig
@using Microsoft.Extensions.Options
@using StardewModdingAPI.Web.Framework
@using StardewModdingAPI.Web.Framework.ConfigModels
@@ -94,29 +95,22 @@ else
</li>
<li>
<a href="https://ko-fi.com/pathoschild" class="donate-button">
- <img src="Content/images/ko-fi.png"/> Buy me a coffee
+ <img src="Content/images/ko-fi.png" /> Buy me a coffee
</a>
</li>
<li>
<a href="https://www.paypal.me/pathoschild" class="donate-button">
- <img src="Content/images/paypal.png"/> Donate via PayPal
+ <img src="Content/images/paypal.png" /> Donate via PayPal
</a>
</li>
</ul>
-<p>
- Special thanks to
- <a href="https://www.nexusmods.com/users/65566526?tab=user+files">bwdy</a>,
- hawkfalcon,
- <a href="https://twitter.com/iKeychain">iKeychain</a>,
- jwdred,
- <a href="https://www.nexusmods.com/users/12252523">Karmylla</a>,
- <a href="https://www.nexusmods.com/stardewvalley/users/51777556">minervamaga</a>,
- Pucklynn,
- Renorien,
- Robby LaFarge,
- and a few anonymous users for their ongoing support on Patreon; you're awesome!
-</p>
+@if (!string.IsNullOrWhiteSpace(Model.SupporterList))
+{
+ @Html.Raw(Markdig.Markdown.ToHtml(
+ $"Special thanks to {Model.SupporterList}, and a few anonymous users for their ongoing support on Patreon; you're awesome!"
+ ))
+}
<h2 id="modcreators">For mod creators</h2>
<ul>
diff --git a/src/SMAPI.Web/Views/Index/Privacy.cshtml b/src/SMAPI.Web/Views/Index/Privacy.cshtml
index 7327de3d..fd78f908 100644
--- a/src/SMAPI.Web/Views/Index/Privacy.cshtml
+++ b/src/SMAPI.Web/Views/Index/Privacy.cshtml
@@ -22,10 +22,10 @@
<h2>Data collected and transmitted</h2>
<h3 id="web-logging">Web logging</h3>
-<p>This website and SMAPI's web API are hosted by Amazon Web Services. Their servers may automatically collect diagnostics like your IP address, but this information is not visible to SMAPI's web application or developers. For more information, see the <a href="https://aws.amazon.com/privacy/">Amazon Privacy Notice</a>.</p>
+<p>This website and SMAPI's web API are hosted on Microsoft Azure. Their servers may automatically collect diagnostics like your IP address, but this information is not visible to SMAPI's web apps or its developers. For more information, see the <a href="https://azure.microsoft.com/en-ca/support/legal/">Microsoft Azure legal resources</a>.</p>
<h3>Update checks</h3>
-<p>SMAPI notifies you when there's a new version of SMAPI or your mods available. To do so, it sends your game/SMAPI/mod versions and platform type to its web API. No personal information is stored by the web application, but see <em><a href="#web-logging">web logging</a></em>.</p>
+<p>SMAPI notifies you when there's a new version of SMAPI or your mods available. To do so, it sends basic metadata like your game/SMAPI/mod versions and platform type to its web API. No personal information is stored by the web app.</p>
<p>You can disable update checks, and no information will be transmitted to the web API. To do so:</p>
<ol>
@@ -34,8 +34,8 @@
<li>change <code>"CheckForUpdates": true</code> to <code>"CheckForUpdates": false</code>.</li>
</ol>
-<h3>Log parser</h3>
-<p>The <a href="https://smapi.io/log">log parser page</a> lets you store a log file for analysis and sharing. The log data is stored indefinitely in an obfuscated form as unlisted pastes in <a href="https://pastebin.com/">Pastebin</a>. No personal information is stored by the log parser beyond what you choose to upload, but see <em><a href="#web-logging">web logging</a></em> and the <a href="https://pastebin.com/doc_privacy_statement">Pastebin Privacy Statement</a>.</p>
+<h3>Log parser and JSON validator</h3>
+<p>The <a href="https://smapi.io/log">log parser</a> and <a href="https://smapi.io/json">JSON validator</a> let you upload files to analyze and share with other users. The log data is stored for 30 days in an obfuscated form in a private Microsoft Azure Blob storage account. No personal information is stored by the log parser beyond what you choose to upload as part of those files.</p>
<h3>Multiplayer sync</h3>
<p>As part of its multiplayer API, SMAPI transmits basic context to players you connect to (mainly your OS, SMAPI version, game version, and installed mods). This is used to enable multiplayer features like inter-mod messages, compatibility checks, etc. Although this information is normally hidden from players, it may be visible due to mods or configuration changes.</p>
diff --git a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
index de6b06a2..a00c8387 100644
--- a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
+++ b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
@@ -1,13 +1,15 @@
+@using Humanizer
@using StardewModdingAPI.Web.Framework
@using StardewModdingAPI.Web.ViewModels.JsonValidator
@model JsonValidatorModel
@{
// get view data
- string curPageUrl = this.Url.PlainAction("Index", "JsonValidator", new { schemaName = Model.SchemaName, id = Model.PasteID });
+ string curPageUrl = this.Url.PlainAction("Index", "JsonValidator", new { schemaName = Model.SchemaName, id = Model.PasteID }, absoluteUrl: true);
string newUploadUrl = this.Url.PlainAction("Index", "JsonValidator", new { schemaName = Model.SchemaName });
string schemaDisplayName = null;
- bool isValidSchema = Model.SchemaName != null && Model.SchemaFormats.TryGetValue(Model.SchemaName, out schemaDisplayName) && schemaDisplayName != "None";
+ bool isValidSchema = Model.SchemaName != null && Model.SchemaFormats.TryGetValue(Model.SchemaName, out schemaDisplayName) && schemaDisplayName?.ToLower() != "none";
+ bool isEditView = Model.Content == null || Model.SchemaName?.ToLower() == "edit";
// build title
ViewData["Title"] = "JSON validator";
@@ -26,17 +28,17 @@
{
<meta name="robots" content="noindex" />
}
- <link rel="stylesheet" href="~/Content/css/json-validator.css" />
+ <link rel="stylesheet" href="~/Content/css/json-validator.css?r=20191204" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/themes/sunlight.default.min.css" />
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/sunlight.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/plugins/sunlight-plugin.linenumbers.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/lang/sunlight.javascript.min.js" crossorigin="anonymous"></script>
- <script src="~/Content/js/json-validator.js"></script>
+ <script src="~/Content/js/json-validator.js?r=20191204"></script>
<script>
$(function() {
- smapi.jsonValidator(@Json.Serialize(this.Url.PlainAction("Index", "JsonValidator", values: null)), @Json.Serialize(Model.PasteID));
+ smapi.jsonValidator(@Json.Serialize(this.Url.PlainAction("Index", "JsonValidator", new { schemaName = "$schemaName", id = "$id" })), @Json.Serialize(Model.PasteID));
});
</script>
}
@@ -59,7 +61,7 @@ else if (Model.ParseError != null)
<small v-pre>Error details: @Model.ParseError</small>
</div>
}
-else if (Model.PasteID != null)
+else if (!isEditView && Model.PasteID != null)
{
<div class="banner success">
<strong>Share this link to let someone else see this page:</strong> <code>@curPageUrl</code><br />
@@ -67,8 +69,20 @@ else if (Model.PasteID != null)
</div>
}
+@* save warnings *@
+@if (Model.UploadWarning != null || Model.Expiry != null)
+{
+ <div class="save-metadata" v-pre>
+ @if (Model.Expiry != null)
+ {
+ <text>This JSON file will expire in @((DateTime.UtcNow - Model.Expiry.Value).Humanize()). </text>
+ }
+ <!--@Model.UploadWarning-->
+ </div>
+}
+
@* upload new file *@
-@if (Model.Content == null)
+@if (isEditView)
{
<h2>Upload a JSON file</h2>
<form action="@this.Url.PlainAction("PostAsync", "JsonValidator")" method="post">
@@ -84,7 +98,7 @@ else if (Model.PasteID != null)
</li>
<li>
Drag the file onto this textbox (or paste the text in):<br />
- <textarea id="input" name="Content" placeholder="paste file here"></textarea>
+ <textarea id="input" name="Content" placeholder="paste file here">@Model.Content</textarea>
</li>
<li>
Click this button:<br />
@@ -95,26 +109,23 @@ else if (Model.PasteID != null)
}
@* validation results *@
-@if (Model.Content != null)
+@if (!isEditView)
{
<div id="output">
@if (Model.UploadError == null)
{
- <div>
- Change JSON format:
- <select id="format" name="format">
- @foreach (var pair in Model.SchemaFormats)
- {
- <option value="@pair.Key" selected="@(Model.SchemaName == pair.Key)">@pair.Value</option>
- }
- </select>
- </div>
-
- <h2>Validation errors</h2>
- @if (Model.FormatUrl != null)
- {
- <p>See <a href="@Model.FormatUrl">format documentation</a>.</p>
- }
+ <h2>Validation</h2>
+ <p>
+ @(Model.Errors.Any() ? "Oops, found some issues with your JSON." : "No errors found!")
+ @if (!isValidSchema)
+ {
+ <text>(You have no schema selected, so only the basic JSON syntax was checked.)</text>
+ }
+ else if (Model.FormatUrl != null)
+ {
+ <text>See <a href="@Model.FormatUrl">format documentation</a> for more info.</text>
+ }
+ </p>
@if (Model.Errors.Any())
{
@@ -135,13 +146,17 @@ else if (Model.PasteID != null)
}
</table>
}
- else
- {
- <p>No errors found.</p>
- }
}
<h2>Content</h2>
+ <div>
+ You can change JSON format (<select id="format" name="format">
+ @foreach (var pair in Model.SchemaFormats)
+ {
+ <option value="@pair.Key" selected="@(Model.SchemaName == pair.Key)">@pair.Value</option>
+ }
+ </select>) or <a href="@(this.Url.PlainAction("Index", "JsonValidator", new { id = this.Model.PasteID, schemaName = "edit" }))">edit this file</a>.
+ </div>
<pre id="raw-content" class="sunlight-highlight-javascript">@Model.Content</pre>
@if (isValidSchema)
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
index 439167bc..87c7f918 100644
--- a/src/SMAPI.Web/Views/LogParser/Index.cshtml
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -13,6 +13,8 @@
.Cast<LogLevel>()
.ToDictionary(level => level.ToString().ToLower(), level => level != LogLevel.Trace);
JsonSerializerSettings noFormatting = new JsonSerializerSettings { Formatting = Formatting.None };
+
+ string curPageUrl = this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID }, absoluteUrl: true);
}
@section Head {
@@ -50,7 +52,7 @@ else if (Model.ParseError != null)
{
<div class="banner error" v-pre>
<strong>Oops, couldn't parse that log. (Make sure you upload the log file, not the console text.)</strong><br />
- Share this URL when asking for help: <code>https://@this.Context.Request.Host.ToUriComponent()@this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID }))</code><br />
+ Share this URL when asking for help: <code>@curPageUrl</code><br />
(Or <a href="@this.Url.PlainAction("Index", "LogParser", values: null)">upload a new log</a>.)<br />
<br />
<small v-pre>Error details: @Model.ParseError</small>
@@ -59,7 +61,7 @@ else if (Model.ParseError != null)
else if (Model.ParsedLog?.IsValid == true)
{
<div class="banner success" v-pre>
- <strong>Share this link to let someone else see the log:</strong> <code>https://@this.Context.Request.Host.ToUriComponent()@this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID })</code><br />
+ <strong>Share this link to let someone else see the log:</strong> <code>@curPageUrl</code><br />
(Or <a href="@this.Url.PlainAction("Index", "LogParser", values: null)">upload a new log</a>.)
</div>
}
@@ -67,12 +69,16 @@ else if (Model.ParsedLog?.IsValid == true)
@* save warnings *@
@if (Model.UploadWarning != null || Model.Expiry != null)
{
+ @if (Model.UploadWarning != null)
+ {
+ <text>⚠️ @Model.UploadWarning<br /></text>
+ }
+
<div class="save-metadata" v-pre>
@if (Model.Expiry != null)
{
- <text>This log will expire in @((DateTime.UtcNow - Model.Expiry.Value).Humanize()). </text>
+ <text>This log will expire in @((DateTime.UtcNow - Model.Expiry.Value).Humanize()).</text>
}
- <!--@Model.UploadWarning-->
</div>
}
@@ -294,10 +300,7 @@ else if (Model.ParsedLog?.IsValid == true)
string sectionFilter = message.Section != null && !message.IsStartOfSection ? $"&& sectionsAllow('{message.Section}')" : null; // filter the message by section if applicable
<tr class="mod @levelStr @sectionStartClass"
- @if (message.IsStartOfSection)
- {
- <text>v-on:click="toggleSection('@message.Section')"</text>
- }
+ @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>
@@ -307,8 +310,12 @@ else if (Model.ParsedLog?.IsValid == true)
@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>
+ <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>