add scheduling context to playout details table (#2817)
* add scheduling context to playout details table * fix missing context copies
This commit is contained in:
@@ -243,12 +243,25 @@
|
||||
<MudTh>Finish</MudTh>
|
||||
<MudTh>Media Item</MudTh>
|
||||
<MudTh>Duration</MudTh>
|
||||
<MudTh />
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Start">@context.Start.ToString("G", _dtf)</MudTd>
|
||||
<MudTd DataLabel="Finish">@context.Finish.ToString("G", _dtf)</MudTd>
|
||||
<MudTd DataLabel="Media Item">@context.Title</MudTd>
|
||||
<MudTd DataLabel="Duration">@context.Duration</MudTd>
|
||||
<MudTd>
|
||||
@if (!string.IsNullOrWhiteSpace(context.SchedulingContext))
|
||||
{
|
||||
<div style="align-items: center; display: flex;">
|
||||
<MudTooltip Text="Troubleshoot">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Info"
|
||||
OnClick="@(_ => ShowSchedulingContext(context))">
|
||||
</MudIconButton>
|
||||
</MudTooltip>
|
||||
</div>
|
||||
}
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
<PagerContent>
|
||||
<MudTablePager/>
|
||||
@@ -506,4 +519,12 @@
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private async Task ShowSchedulingContext(PlayoutItemViewModel item)
|
||||
{
|
||||
var parameters = new DialogParameters { { "PlayoutItem", item } };
|
||||
var options = new DialogOptions { CloseButton = true, CloseOnEscapeKey = true, MaxWidth = MaxWidth.Medium, FullWidth = true };
|
||||
IDialogReference dialog = await Dialog.ShowAsync<SchedulingContextDialog>(item.Title, parameters, options);
|
||||
DialogResult _ = await dialog.Result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
@using ErsatzTV.Application.Playouts
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<div>
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
<code @ref="_infoView">@_info</code>
|
||||
</pre>
|
||||
</div>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(() => CopyToClipboard(_infoView))">
|
||||
Copy
|
||||
</MudButton>
|
||||
<MudButton Color="Color.Primary" OnClick="@Close">Close</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
[CascadingParameter]
|
||||
IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public PlayoutItemViewModel PlayoutItem { get; set; }
|
||||
|
||||
private string _info;
|
||||
private ElementReference _infoView;
|
||||
|
||||
protected override Task OnParametersSetAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_info = PlayoutItem.SchedulingContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_info = ex.ToString();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task CopyToClipboard(ElementReference view) => await JsRuntime.InvokeVoidAsync("clipboardCopy.copyText", view);
|
||||
|
||||
private void Close() => MudDialog.Close(DialogResult.Ok(true));
|
||||
}
|
||||
Reference in New Issue
Block a user