Browse Source

add etv env vars to troubleshooting > general info (#2064)

pull/2065/head
Jason Dove 21 hours ago committed by GitHub
parent
commit
76f7c88375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 11
      ErsatzTV.Application/Troubleshooting/Queries/GetTroubleshootingInfoHandler.cs
  3. 1
      ErsatzTV.Application/Troubleshooting/TroubleshootingInfo.cs
  4. 10
      ErsatzTV/Pages/Troubleshooting.razor

1
CHANGELOG.md

@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Quotes are *always* required when using this feature - Quotes are *always* required when using this feature
- e.g. `smart_collection:"one" NOT smart_collection:"two"` - e.g. `smart_collection:"one" NOT smart_collection:"two"`
- Cycles will be detected and logged, and searches with cycles will not work as expected - Cycles will be detected and logged, and searches with cycles will not work as expected
- Add all `ETV_*` environment variables to Troubleshooting > General info
### Changed ### Changed
- Start to make UI minimally responsive (functional on smaller screens) - Start to make UI minimally responsive (functional on smaller screens)

11
ErsatzTV.Application/Troubleshooting/Queries/GetTroubleshootingInfoHandler.cs

@ -1,3 +1,4 @@
using System.Collections;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@ -133,8 +134,18 @@ public class GetTroubleshootingInfoHandler : IRequestHandler<GetTroubleshootingI
} }
} }
var environment = new Dictionary<string, string>();
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables())
{
if (de is { Key: string key, Value: string value } && key.StartsWith("ETV_", StringComparison.OrdinalIgnoreCase))
{
environment[key] = value;
}
}
return new TroubleshootingInfo( return new TroubleshootingInfo(
version, version,
environment,
healthCheckSummaries, healthCheckSummaries,
ffmpegSettings, ffmpegSettings,
activeFFmpegProfiles, activeFFmpegProfiles,

1
ErsatzTV.Application/Troubleshooting/TroubleshootingInfo.cs

@ -5,6 +5,7 @@ namespace ErsatzTV.Application.Troubleshooting;
public record TroubleshootingInfo( public record TroubleshootingInfo(
string Version, string Version,
Dictionary<string, string> Environment,
IEnumerable<HealthCheckResultSummary> Health, IEnumerable<HealthCheckResultSummary> Health,
FFmpegSettingsViewModel FFmpegSettings, FFmpegSettingsViewModel FFmpegSettings,
IEnumerable<FFmpegProfile> FFmpegProfiles, IEnumerable<FFmpegProfile> FFmpegProfiles,

10
ErsatzTV/Pages/Troubleshooting.razor

@ -76,7 +76,15 @@
TroubleshootingInfo info = await Mediator.Send(new GetTroubleshootingInfo(), _cts.Token); TroubleshootingInfo info = await Mediator.Send(new GetTroubleshootingInfo(), _cts.Token);
_troubleshootingInfo = JsonSerializer.Serialize( _troubleshootingInfo = JsonSerializer.Serialize(
new { info.Version, info.Health, info.FFmpegSettings, info.Channels, info.FFmpegProfiles }, new
{
info.Version,
Environment = info.Environment.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value),
info.Health,
info.FFmpegSettings,
info.Channels,
info.FFmpegProfiles
},
new JsonSerializerOptions new JsonSerializerOptions
{ {
Converters = { new JsonStringEnumConverter() }, Converters = { new JsonStringEnumConverter() },

Loading…
Cancel
Save