diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-27 21:10:36 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-27 21:10:36 -0400 |
commit | 3f43ebcc0e31db523fa82a163374cebf2f577cde (patch) | |
tree | 8b41f6cdd9f2894638e7be94e7268220184a9c76 /src/SMAPI.Web/Controllers/LogParserController.cs | |
parent | ad5bb5b49af49c4668fd30fb2a0e606dcefe4ec0 (diff) | |
download | SMAPI-3f43ebcc0e31db523fa82a163374cebf2f577cde.tar.gz SMAPI-3f43ebcc0e31db523fa82a163374cebf2f577cde.tar.bz2 SMAPI-3f43ebcc0e31db523fa82a163374cebf2f577cde.zip |
fix issues with subdomain routing in log UI (#358)
Diffstat (limited to 'src/SMAPI.Web/Controllers/LogParserController.cs')
-rw-r--r-- | src/SMAPI.Web/Controllers/LogParserController.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/SMAPI.Web/Controllers/LogParserController.cs b/src/SMAPI.Web/Controllers/LogParserController.cs index 893d9a52..ee1d51cd 100644 --- a/src/SMAPI.Web/Controllers/LogParserController.cs +++ b/src/SMAPI.Web/Controllers/LogParserController.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Options; using StardewModdingAPI.Web.Framework; using StardewModdingAPI.Web.Framework.ConfigModels; using StardewModdingAPI.Web.Framework.LogParser; +using StardewModdingAPI.Web.ViewModels; namespace StardewModdingAPI.Web.Controllers { @@ -13,6 +14,9 @@ namespace StardewModdingAPI.Web.Controllers /********* ** Properties *********/ + /// <summary>The log parser config settings.</summary> + private readonly LogParserConfig Config; + /// <summary>The underlying Pastebin client.</summary> private readonly PastebinClient PastebinClient; @@ -28,10 +32,10 @@ namespace StardewModdingAPI.Web.Controllers public LogParserController(IOptions<LogParserConfig> configProvider) { // init Pastebin client - LogParserConfig config = configProvider.Value; + this.Config = configProvider.Value; string version = this.GetType().Assembly.GetName().Version.ToString(3); - string userAgent = string.Format(config.PastebinUserAgent, version); - this.PastebinClient = new PastebinClient(config.PastebinBaseUrl, userAgent, config.PastebinDevKey); + string userAgent = string.Format(this.Config.PastebinUserAgent, version); + this.PastebinClient = new PastebinClient(this.Config.PastebinBaseUrl, userAgent, this.Config.PastebinDevKey); } /*** @@ -42,7 +46,7 @@ namespace StardewModdingAPI.Web.Controllers [Route("log")] public ViewResult Index() { - return this.View("Index"); + return this.View("Index", new LogParserModel(this.Config.SectionUrl)); } /*** |