diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-11-20 13:46:27 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-20 13:46:27 -0600 |
| commit | 716b607bf7079878b2237060ad7643a1b5ad311a (patch) | |
| tree | 56d0b8b087dd00c7b3bdb3d110a1a6a9f000d347 /src/slskd/Core/API/Controllers/ConfigurationController.cs | |
| parent | 6b83eb2d94d91b36cd6f674bd3d12e2250e694b3 (diff) | |
| parent | 6bcda33725a092a5416c7d4538c26fac1eb69c45 (diff) | |
| download | slskd-716b607bf7079878b2237060ad7643a1b5ad311a.tar.gz | |
Merge pull request #271 from slskd/remote-config
Add the ability to update the configuration file via the UI
Diffstat (limited to 'src/slskd/Core/API/Controllers/ConfigurationController.cs')
| -rw-r--r-- | src/slskd/Core/API/Controllers/ConfigurationController.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/slskd/Core/API/Controllers/ConfigurationController.cs b/src/slskd/Core/API/Controllers/ConfigurationController.cs index 63b30a64..a7925174 100644 --- a/src/slskd/Core/API/Controllers/ConfigurationController.cs +++ b/src/slskd/Core/API/Controllers/ConfigurationController.cs @@ -19,8 +19,11 @@ using Microsoft.Extensions.Options; namespace slskd.Core.API { + using System; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; + using Serilog; + using IOFile = System.IO.File; /// <summary> /// Configuration. @@ -38,20 +41,21 @@ namespace slskd.Core.API IStateMonitor<State> applicationStateMonitor) { Application = application; - OptionsShapshot = optionsShapshot; + OptionsSnapshot = optionsShapshot; ApplicationStateMonitor = applicationStateMonitor; } private IApplication Application { get; } - private IOptionsSnapshot<Options> OptionsShapshot { get; } + private IOptionsSnapshot<Options> OptionsSnapshot { get; } private IStateMonitor<State> ApplicationStateMonitor { get; } + private ILogger Logger { get; set; } = Log.ForContext(typeof(Program)); [HttpGet] [Route("")] [Authorize] public IActionResult GetOptions() { - return Ok(OptionsShapshot.Value); + return Ok(OptionsSnapshot.Value); } [HttpPut] |
