restyle troubleshooting page (#1208)
This commit is contained in:
@@ -105,11 +105,9 @@ public class GetTroubleshootingInfoHandler : IRequestHandler<GetTroubleshootingI
|
|||||||
Optional(GetDriverName(activeDriver)),
|
Optional(GetDriverName(activeDriver)),
|
||||||
vaapiDevice))
|
vaapiDevice))
|
||||||
{
|
{
|
||||||
vaapiCapabilities += $"Checking driver {activeDriver} device {vaapiDevice} {Environment.NewLine} {Environment.NewLine}";
|
vaapiCapabilities += $"Checking driver {activeDriver} device {vaapiDevice}{Environment.NewLine}{Environment.NewLine}";
|
||||||
vaapiCapabilities += $@"```shell
|
vaapiCapabilities += output;
|
||||||
{output}
|
vaapiCapabilities += Environment.NewLine + Environment.NewLine;
|
||||||
```";
|
|
||||||
vaapiCapabilities += " " + Environment.NewLine + " " + Environment.NewLine;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -77,6 +77,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.clipboardCopy = {
|
||||||
|
copyText: function (codeElement) {
|
||||||
|
navigator.clipboard.writeText(codeElement.textContent)
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user