|
|
|
@ -5,38 +5,41 @@ |
|
|
|
@using ErsatzTV.Application.Troubleshooting |
|
|
|
@using ErsatzTV.Application.Troubleshooting |
|
|
|
@implements IDisposable |
|
|
|
@implements IDisposable |
|
|
|
@inject IMediator Mediator |
|
|
|
@inject IMediator Mediator |
|
|
|
|
|
|
|
@inject IJSRuntime JsRuntime |
|
|
|
|
|
|
|
|
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8"> |
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8"> |
|
|
|
<MudCard Class="mb-6"> |
|
|
|
<MudExpansionPanels> |
|
|
|
<MudCardHeader> |
|
|
|
<MudExpansionPanel Text="General" Class="mb-6"> |
|
|
|
<CardHeaderContent> |
|
|
|
<div class="overflow-y-scroll" style="max-height: 500px"> |
|
|
|
<MudText Typo="Typo.h5">General</MudText> |
|
|
|
<pre> |
|
|
|
</CardHeaderContent> |
|
|
|
<code @ref="_troubleshootingView">@_troubleshootingInfo</code> |
|
|
|
</MudCardHeader> |
|
|
|
</pre> |
|
|
|
<MudCardContent> |
|
|
|
</div> |
|
|
|
<MarkdownView Content="@_troubleshootingInfo"/> |
|
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="(() => CopyToClipboard(_troubleshootingView))"> |
|
|
|
</MudCardContent> |
|
|
|
Copy |
|
|
|
</MudCard> |
|
|
|
</MudButton> |
|
|
|
<MudCard Class="mb-6"> |
|
|
|
</MudExpansionPanel> |
|
|
|
<MudCardHeader> |
|
|
|
<MudExpansionPanel Text="NVIDIA Capabilities" Class="mb-6"> |
|
|
|
<CardHeaderContent> |
|
|
|
<div class="overflow-y-scroll" style="max-height: 500px"> |
|
|
|
<MudText Typo="Typo.h5">Nvidia Capabilities</MudText> |
|
|
|
<pre> |
|
|
|
</CardHeaderContent> |
|
|
|
<code @ref="_nvidiaView">@_nvidiaCapabilities</code> |
|
|
|
</MudCardHeader> |
|
|
|
</pre> |
|
|
|
<MudCardContent> |
|
|
|
</div> |
|
|
|
<MarkdownView Content="@_nvidiaCapabilities"/> |
|
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="(() => CopyToClipboard(_nvidiaView))"> |
|
|
|
</MudCardContent> |
|
|
|
Copy |
|
|
|
</MudCard> |
|
|
|
</MudButton> |
|
|
|
<MudCard> |
|
|
|
</MudExpansionPanel> |
|
|
|
<MudCardHeader> |
|
|
|
<MudExpansionPanel Text="VAAPI Capabilities"> |
|
|
|
<CardHeaderContent> |
|
|
|
<div class="overflow-y-scroll" style="max-height: 500px"> |
|
|
|
<MudText Typo="Typo.h5">Vaapi Capabilities</MudText> |
|
|
|
<pre> |
|
|
|
</CardHeaderContent> |
|
|
|
<code @ref="_vaapiView">@_vaapiCapabilities</code> |
|
|
|
</MudCardHeader> |
|
|
|
</pre> |
|
|
|
<MudCardContent> |
|
|
|
</div> |
|
|
|
<MarkdownView Content="@_vaapiCapabilities"/> |
|
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="(() => CopyToClipboard(_vaapiView))"> |
|
|
|
</MudCardContent> |
|
|
|
Copy |
|
|
|
</MudCard> |
|
|
|
</MudButton> |
|
|
|
|
|
|
|
</MudExpansionPanel> |
|
|
|
|
|
|
|
</MudExpansionPanels> |
|
|
|
</MudContainer> |
|
|
|
</MudContainer> |
|
|
|
|
|
|
|
|
|
|
|
@code { |
|
|
|
@code { |
|
|
|
@ -44,6 +47,9 @@ |
|
|
|
private string _troubleshootingInfo; |
|
|
|
private string _troubleshootingInfo; |
|
|
|
private string _nvidiaCapabilities; |
|
|
|
private string _nvidiaCapabilities; |
|
|
|
private string _vaapiCapabilities; |
|
|
|
private string _vaapiCapabilities; |
|
|
|
|
|
|
|
private ElementReference _troubleshootingView; |
|
|
|
|
|
|
|
private ElementReference _nvidiaView; |
|
|
|
|
|
|
|
private ElementReference _vaapiView; |
|
|
|
|
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -57,7 +63,7 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
TroubleshootingInfo info = await Mediator.Send(new GetTroubleshootingInfo(), _cts.Token); |
|
|
|
TroubleshootingInfo info = await Mediator.Send(new GetTroubleshootingInfo(), _cts.Token); |
|
|
|
|
|
|
|
|
|
|
|
string json = JsonSerializer.Serialize( |
|
|
|
_troubleshootingInfo = JsonSerializer.Serialize( |
|
|
|
new { info.Version, info.Health, info.FFmpegSettings, info.Channels, info.FFmpegProfiles }, |
|
|
|
new { info.Version, info.Health, info.FFmpegSettings, info.Channels, info.FFmpegProfiles }, |
|
|
|
new JsonSerializerOptions |
|
|
|
new JsonSerializerOptions |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -65,23 +71,18 @@ |
|
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, |
|
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, |
|
|
|
WriteIndented = true |
|
|
|
WriteIndented = true |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
_troubleshootingInfo = $@"```json |
|
|
|
|
|
|
|
{json} |
|
|
|
|
|
|
|
```"; |
|
|
|
|
|
|
|
string formattedCapabilities = info.NvidiaCapabilities.Replace("\n", $" {Environment.NewLine}"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_nvidiaCapabilities = $@"```shell |
|
|
|
|
|
|
|
{formattedCapabilities} |
|
|
|
|
|
|
|
```"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_nvidiaCapabilities = info.NvidiaCapabilities; |
|
|
|
_vaapiCapabilities = info.VaapiCapabilities; |
|
|
|
_vaapiCapabilities = info.VaapiCapabilities; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_troubleshootingInfo = $@"``` |
|
|
|
_troubleshootingInfo = ex.ToString(); |
|
|
|
{ex} |
|
|
|
|
|
|
|
```"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private async Task CopyToClipboard(ElementReference view) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await JsRuntime.InvokeVoidAsync("clipboardCopy.copyText", view); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |