From b1400bcb684c43790dd38628b6c131e9e7c4d400 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 27 Nov 2019 21:49:36 -0500 Subject: fallback to Amazon S3 if saving a log to Pastebin fails --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index f98ffdf9..df2ac115 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -1,3 +1,4 @@ +@using Humanizer @using Newtonsoft.Json @using StardewModdingAPI.Toolkit.Utilities @using StardewModdingAPI.Web.Framework.LogParsing.Models @@ -18,7 +19,7 @@ { } - + @@ -62,6 +63,18 @@ else if (Model.ParsedLog?.IsValid == true) } +@* save warnings *@ +@if (Model.UploadWarning != null || Model.Expiry != null) +{ +
+ @if (Model.Expiry != null) + { + This log will expire in @((DateTime.UtcNow - Model.Expiry.Value).Humanize()). + } + +
+} + @* upload new log *@ @if (Model.ParsedLog == null) { @@ -71,7 +84,7 @@ else if (Model.ParsedLog?.IsValid == true) @foreach (Platform platform in new[] { Platform.Android, Platform.Linux, Platform.Mac, Platform.Windows }) {
  • - +
  • } @@ -151,7 +164,7 @@ else if (Model.ParsedLog?.IsValid == true)
    @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) { - + @contentPack.Name
    + + @contentPack.Name
    }
    } @@ -173,7 +186,7 @@ else if (Model.ParsedLog?.IsValid == true)
    @foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate)) { - @contentPack.Version → @contentPack.UpdateVersion
    + @contentPack.Version → @contentPack.UpdateVersion
    }
    } -- cgit From 5f532c259d5d3050bd6a053659067617db136d57 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 1 Dec 2019 21:55:20 -0500 Subject: migrate from AWS to Azure This commit migrates from subdomains to paths (due to the cost of a wildcard HTTPS certificate on Azure), adds a web project to redirect the old subdomains from AWS to Azure, and removes AWS-specific hacks. --- src/SMAPI.Web/Views/Index/Index.cshtml | 10 +++++----- src/SMAPI.Web/Views/Index/Privacy.cshtml | 4 ++-- src/SMAPI.Web/Views/JsonValidator/Index.cshtml | 10 +++++----- src/SMAPI.Web/Views/LogParser/Index.cshtml | 16 ++++++++-------- src/SMAPI.Web/Views/Shared/_Layout.cshtml | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index f42dde3b..a79a08f5 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -44,14 +44,14 @@ }
    Player guide

    Get help

    @@ -61,7 +61,7 @@
    @Html.Raw(Markdig.Markdown.ToHtml(Model.StableVersion.Description))
    -

    See the release notes and mod compatibility list for more info.

    +

    See the release notes and mod compatibility list for more info.

    } else { @@ -70,13 +70,13 @@ else
    @Html.Raw(Markdig.Markdown.ToHtml(Model.StableVersion.Description))
    -

    See the release notes and mod compatibility list for more info.

    +

    See the release notes and mod compatibility list for more info.

    SMAPI @Model.BetaVersion.Version?

    @Html.Raw(Markdig.Markdown.ToHtml(Model.BetaVersion.Description))
    -

    See the release notes and mod compatibility list for more info.

    +

    See the release notes and mod compatibility list for more info.

    } diff --git a/src/SMAPI.Web/Views/Index/Privacy.cshtml b/src/SMAPI.Web/Views/Index/Privacy.cshtml index 914384a8..fe4d773a 100644 --- a/src/SMAPI.Web/Views/Index/Privacy.cshtml +++ b/src/SMAPI.Web/Views/Index/Privacy.cshtml @@ -8,7 +8,7 @@ } -← back to SMAPI page +← back to SMAPI page

    SMAPI is an open-source and non-profit project. Your privacy is important, so this page explains what information SMAPI uses and transmits. This page is informational only, it's not a legal document.

    @@ -34,7 +34,7 @@

    Log parser

    -

    The log parser page lets you store a log file for analysis and sharing. The log data is stored indefinitely in an obfuscated form as unlisted pastes in Pastebin. No personal information is stored by the log parser beyond what you choose to upload, but see web logging and the Pastebin Privacy Statement.

    +

    The log parser page lets you store a log file for analysis and sharing. The log data is stored indefinitely in an obfuscated form as unlisted pastes in Pastebin. No personal information is stored by the log parser beyond what you choose to upload, but see web logging and the Pastebin Privacy Statement.

    Multiplayer sync

    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.

    diff --git a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml index 3143fad9..41dec929 100644 --- a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml +++ b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml @@ -3,8 +3,8 @@ @{ // get view data - string curPageUrl = new Uri(new Uri(Model.SectionUrl), $"{Model.SchemaName}/{Model.PasteID}").ToString(); - string newUploadUrl = Model.SchemaName != null ? new Uri(new Uri(Model.SectionUrl), Model.SchemaName).ToString() : Model.SectionUrl; + string curPageUrl = this.Url.Action("Index", "JsonValidator", new { schemaName = Model.SchemaName, id = Model.PasteID }); + string newUploadUrl = this.Url.Action("Index", "JsonValidator", new { schemaName = Model.SchemaName }); string schemaDisplayName = null; bool isValidSchema = Model.SchemaName != null && Model.SchemaFormats.TryGetValue(Model.SchemaName, out schemaDisplayName) && schemaDisplayName != "None"; @@ -34,8 +34,8 @@ } @@ -70,7 +70,7 @@ else if (Model.PasteID != null) @if (Model.Content == null) {

    Upload a JSON file

    -
    +
    1. Choose the JSON format:
      diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index df2ac115..07e18421 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -32,7 +32,7 @@ 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'); + }, '@this.Url.Action("Index", "LogParser")'); }); } @@ -49,8 +49,8 @@ else if (Model.ParseError != null) { @@ -58,8 +58,8 @@ else if (Model.ParseError != null) else if (Model.ParsedLog?.IsValid == true) { } @@ -127,7 +127,7 @@ else if (Model.ParsedLog?.IsValid == true)

      How do I share my log?

      - +
      1. Drag the file onto this textbox (or paste the text in):
        @@ -322,12 +322,12 @@ else if (Model.ParsedLog?.IsValid == true) } - view raw log + view raw log } else {
        @Model.ParsedLog.RawText
        - view parsed log + view parsed log } } diff --git a/src/SMAPI.Web/Views/Shared/_Layout.cshtml b/src/SMAPI.Web/Views/Shared/_Layout.cshtml index 87a22f06..e4b6ca94 100644 --- a/src/SMAPI.Web/Views/Shared/_Layout.cshtml +++ b/src/SMAPI.Web/Views/Shared/_Layout.cshtml @@ -15,15 +15,15 @@
        -- cgit From 8a11d5c0d918264e95ddcdebd7dfa0554bccb216 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 1 Dec 2019 22:24:01 -0500 Subject: fix incorrect link URLs in some cases --- src/SMAPI.Web/Views/Index/Index.cshtml | 11 ++++++----- src/SMAPI.Web/Views/Index/Privacy.cshtml | 3 ++- src/SMAPI.Web/Views/JsonValidator/Index.cshtml | 9 +++++---- src/SMAPI.Web/Views/LogParser/Index.cshtml | 17 +++++++++-------- src/SMAPI.Web/Views/Shared/_Layout.cshtml | 9 +++++---- 5 files changed, 27 insertions(+), 22 deletions(-) (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index a79a08f5..eeba1705 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -1,4 +1,5 @@ @using Microsoft.Extensions.Options +@using StardewModdingAPI.Web.Framework @using StardewModdingAPI.Web.Framework.ConfigModels @inject IOptions SiteConfig @model StardewModdingAPI.Web.ViewModels.IndexModel @@ -44,14 +45,14 @@ }

        Get help

        @@ -61,7 +62,7 @@
        @Html.Raw(Markdig.Markdown.ToHtml(Model.StableVersion.Description))
        -

        See the release notes and mod compatibility list for more info.

        +

        See the release notes and mod compatibility list for more info.

        } else { @@ -70,13 +71,13 @@ else
        @Html.Raw(Markdig.Markdown.ToHtml(Model.StableVersion.Description))
        -

        See the release notes and mod compatibility list for more info.

        +

        See the release notes and mod compatibility list for more info.

        SMAPI @Model.BetaVersion.Version?

        @Html.Raw(Markdig.Markdown.ToHtml(Model.BetaVersion.Description))
        -

        See the release notes and mod compatibility list for more info.

        +

        See the release notes and mod compatibility list for more info.

        } diff --git a/src/SMAPI.Web/Views/Index/Privacy.cshtml b/src/SMAPI.Web/Views/Index/Privacy.cshtml index fe4d773a..7327de3d 100644 --- a/src/SMAPI.Web/Views/Index/Privacy.cshtml +++ b/src/SMAPI.Web/Views/Index/Privacy.cshtml @@ -1,4 +1,5 @@ @using Microsoft.Extensions.Options +@using StardewModdingAPI.Web.Framework @using StardewModdingAPI.Web.Framework.ConfigModels @inject IOptions SiteConfig @{ @@ -8,7 +9,7 @@ } -← back to SMAPI page +← back to SMAPI page

        SMAPI is an open-source and non-profit project. Your privacy is important, so this page explains what information SMAPI uses and transmits. This page is informational only, it's not a legal document.

        diff --git a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml index 41dec929..de6b06a2 100644 --- a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml +++ b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml @@ -1,10 +1,11 @@ +@using StardewModdingAPI.Web.Framework @using StardewModdingAPI.Web.ViewModels.JsonValidator @model JsonValidatorModel @{ // get view data - string curPageUrl = this.Url.Action("Index", "JsonValidator", new { schemaName = Model.SchemaName, id = Model.PasteID }); - string newUploadUrl = this.Url.Action("Index", "JsonValidator", new { schemaName = Model.SchemaName }); + string curPageUrl = this.Url.PlainAction("Index", "JsonValidator", new { schemaName = Model.SchemaName, id = Model.PasteID }); + 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"; @@ -35,7 +36,7 @@ } @@ -70,7 +71,7 @@ else if (Model.PasteID != null) @if (Model.Content == null) {

        Upload a JSON file

        - +
        1. Choose the JSON format:
          diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 07e18421..439167bc 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -1,6 +1,7 @@ @using Humanizer @using Newtonsoft.Json @using StardewModdingAPI.Toolkit.Utilities +@using StardewModdingAPI.Web.Framework @using StardewModdingAPI.Web.Framework.LogParsing.Models @model StardewModdingAPI.Web.ViewModels.LogParserModel @@ -32,7 +33,7 @@ showSections: @Json.Serialize(Enum.GetNames(typeof(LogSection)).ToDictionary(section => section, section => false), noFormatting), showLevels: @Json.Serialize(defaultFilters, noFormatting), enableFilters: @Json.Serialize(!Model.ShowRaw) - }, '@this.Url.Action("Index", "LogParser")'); + }, '@this.Url.PlainAction("Index", "LogParser", values: null)'); }); } @@ -49,8 +50,8 @@ else if (Model.ParseError != null) { @@ -58,8 +59,8 @@ else if (Model.ParseError != null) else if (Model.ParsedLog?.IsValid == true) { } @@ -127,7 +128,7 @@ else if (Model.ParsedLog?.IsValid == true)

          How do I share my log?

          - +
          1. Drag the file onto this textbox (or paste the text in):
            @@ -322,12 +323,12 @@ else if (Model.ParsedLog?.IsValid == true) } - view raw log + view raw log } else {
            @Model.ParsedLog.RawText
            - view parsed log + view parsed log } } diff --git a/src/SMAPI.Web/Views/Shared/_Layout.cshtml b/src/SMAPI.Web/Views/Shared/_Layout.cshtml index e4b6ca94..17f1f673 100644 --- a/src/SMAPI.Web/Views/Shared/_Layout.cshtml +++ b/src/SMAPI.Web/Views/Shared/_Layout.cshtml @@ -1,4 +1,5 @@ @using Microsoft.Extensions.Options +@using StardewModdingAPI.Web.Framework @using StardewModdingAPI.Web.Framework.ConfigModels @inject IOptions SiteConfig @@ -15,15 +16,15 @@
            -- cgit From 71048825bd460fb89e1ea4a8262ad78575719d47 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 2 Dec 2019 21:08:05 -0500 Subject: update supporter list --- src/SMAPI.Web/Views/Index/Index.cshtml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index eeba1705..ec9cfafe 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -106,10 +106,12 @@ else

            Special thanks to + bwdy, hawkfalcon, iKeychain, jwdred, Karmylla, + minervamaga, Pucklynn, Renorien, Robby LaFarge, -- cgit