From 5dfaa1a7ad0110720327f3946902b57bc249760a Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Thu, 10 Jul 2025 14:38:17 +0000 Subject: [PATCH] improve mobile layout for some pages with tables (#2130) --- ErsatzTV/Pages/Channels.razor | 211 +++++++++++++++++--------------- ErsatzTV/Pages/FFmpeg.razor | 125 ++++++++++--------- ErsatzTV/Pages/Watermarks.razor | 135 ++++++++++---------- ErsatzTV/wwwroot/css/site.css | 4 + 4 files changed, 250 insertions(+), 225 deletions(-) diff --git a/ErsatzTV/Pages/Channels.razor b/ErsatzTV/Pages/Channels.razor index 9a6add59..444164ee 100644 --- a/ErsatzTV/Pages/Channels.razor +++ b/ErsatzTV/Pages/Channels.razor @@ -10,107 +10,114 @@ @inject NavigationManager NavigationManager @inject IFFmpegSegmenterService SegmenterService - - - - Channels - - - - - - - - - - - - - Number - - Logo - - Name - - Language - Mode - FFmpeg Profile - - - - @context.Number - - @if (!string.IsNullOrWhiteSpace(context.Logo?.Path)) - { - - } - else - { - - } - - @context.Name - @context.PreferredAudioLanguageCode - @GetStreamingMode(context.StreamingMode) - - @if (context.StreamingMode != StreamingMode.HttpLiveStreamingDirect) - { - @_ffmpegProfiles.Find(p => p.Id == context.FFmpegProfileId)?.Name - } - - - - @if (CanPreviewChannel(context)) - { - - - - - } - else - { - - - - - } - @if (SegmenterService.IsActive(context.Number)) - { - - - - - } - else - { - - } - - - - - - - - - - - - - - - - - Add Channel - - + + + + Add Channel + + + + + Channels + + + + + + + + + + + + + + + + Number + + Logo + + Name + + Language + Mode + FFmpeg Profile + + + + @context.Number + + @if (!string.IsNullOrWhiteSpace(context.Logo?.Path)) + { + + } + else + { + + } + + @context.Name + @context.PreferredAudioLanguageCode + @GetStreamingMode(context.StreamingMode) + + @if (context.StreamingMode != StreamingMode.HttpLiveStreamingDirect) + { + @_ffmpegProfiles.Find(p => p.Id == context.FFmpegProfileId)?.Name + } + + + + @if (CanPreviewChannel(context)) + { + + + + + } + else + { + + + + + } + @if (SegmenterService.IsActive(context.Number)) + { + + + + + } + else + { + + } + + + + + + + + + + + + + + + + + + @code { private readonly CancellationTokenSource _cts = new(); @@ -209,7 +216,7 @@ IDialogReference dialog = await Dialog.ShowAsync("Delete Channel", parameters, options); DialogResult result = await dialog.Result; - if (!result.Canceled) + if (result is { Canceled: false }) { await Mediator.Send(new DeleteChannel(channel.Id), _cts.Token); if (_table != null) diff --git a/ErsatzTV/Pages/FFmpeg.razor b/ErsatzTV/Pages/FFmpeg.razor index c9e92926..d48981f8 100644 --- a/ErsatzTV/Pages/FFmpeg.razor +++ b/ErsatzTV/Pages/FFmpeg.razor @@ -5,64 +5,71 @@ @inject IMediator Mediator @inject NavigationManager NavigationManager - - - - FFmpeg Profiles - - - - - - - - - - Name - Resolution - Video Format - Audio Format - - - - @context.Name - @context.Resolution.Name - - @if (context.HardwareAcceleration != HardwareAccelerationKind.None) - { - @($"{context.VideoFormat.ToString().ToLowerInvariant()} / {context.HardwareAcceleration.ToString().ToLowerInvariant()}") - } - else - { - @context.VideoFormat.ToString().ToLowerInvariant() - } - - @context.AudioFormat.ToString().ToLowerInvariant() - - - - - - - - - - - - - - - - - - - - Add Profile - - + + + + Add Profile + + + + + FFmpeg Profiles + + + + + + + + + + + + + Name + Resolution + Video Format + Audio Format + + + + @context.Name + @context.Resolution.Name + + @if (context.HardwareAcceleration != HardwareAccelerationKind.None) + { + @($"{context.VideoFormat.ToString().ToLowerInvariant()} / {context.HardwareAcceleration.ToString().ToLowerInvariant()}") + } + else + { + @context.VideoFormat.ToString().ToLowerInvariant() + } + + @context.AudioFormat.ToString().ToLowerInvariant() + + + + + + + + + + + + + + + + + + + + + @code { private readonly CancellationTokenSource _cts = new(); @@ -87,7 +94,7 @@ IDialogReference dialog = await Dialog.ShowAsync("Delete FFmpeg Profile", parameters, options); DialogResult result = await dialog.Result; - if (!result.Canceled) + if (result is { Canceled: false }) { await Mediator.Send(new DeleteFFmpegProfile(ffmpegProfile.Id), _cts.Token); await LoadFFmpegProfilesAsync(_cts.Token); diff --git a/ErsatzTV/Pages/Watermarks.razor b/ErsatzTV/Pages/Watermarks.razor index 038b49cb..e1c930f2 100644 --- a/ErsatzTV/Pages/Watermarks.razor +++ b/ErsatzTV/Pages/Watermarks.razor @@ -5,68 +5,75 @@ @inject IMediator Mediator @inject NavigationManager NavigationManager - - - - Watermarks - - - - - - - - - - Name - Image - Mode - Location - - - - @context.Name - - @if (!string.IsNullOrWhiteSpace(context.Image?.Path)) - { - - } - else if (context.ImageSource == ChannelWatermarkImageSource.ChannelLogo) - { - [channel logo] - } - - - @context.Mode - - - @context.Location - - - - - - - - - - - - - - - - - - - - - Add Watermark - - + + + + Add Watermark + + + + + Watermarks + + + + + + + + + + + + + Name + Image + Mode + Location + + + + @context.Name + + @if (!string.IsNullOrWhiteSpace(context.Image?.Path)) + { + + } + else if (context.ImageSource == ChannelWatermarkImageSource.ChannelLogo) + { + [channel logo] + } + + + @context.Mode + + + @context.Location + + + + + + + + + + + + + + + + + + + + + + @code { private readonly CancellationTokenSource _cts = new(); @@ -91,7 +98,7 @@ IDialogReference dialog = await Dialog.ShowAsync("Delete Watermark", parameters, options); DialogResult result = await dialog.Result; - if (!result.Canceled) + if (result is { Canceled: false }) { await Mediator.Send(new DeleteWatermark(watermark.Id), _cts.Token); await LoadWatermarksAsync(); @@ -105,7 +112,7 @@ IDialogReference dialog = await Dialog.ShowAsync("Copy Watermark", parameters, options); DialogResult dialogResult = await dialog.Result; - if (!dialogResult.Canceled && dialogResult.Data is WatermarkViewModel data) + if (dialogResult is { Canceled: false, Data: WatermarkViewModel data }) { NavigationManager.NavigateTo($"/watermarks/{data.Id}"); } diff --git a/ErsatzTV/wwwroot/css/site.css b/ErsatzTV/wwwroot/css/site.css index 65f29f00..da74cef5 100644 --- a/ErsatzTV/wwwroot/css/site.css +++ b/ErsatzTV/wwwroot/css/site.css @@ -158,4 +158,8 @@ .form-field-stack div.mud-input-control { max-width: 500px; +} + +.mud-table-smalldevices-sortselect { + display: none !important; } \ No newline at end of file