|
|
@ -5,17 +5,25 @@ |
|
|
|
@inject IMediator Mediator |
|
|
|
@inject IMediator Mediator |
|
|
|
@inject NavigationManager NavigationManager |
|
|
|
@inject NavigationManager NavigationManager |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<MudForm Style="max-height: 100%"> |
|
|
|
|
|
|
|
<MudPaper Square="true" Style="display: flex; height: 64px; min-height: 64px; width: 100%; z-index: 100; align-items: center"> |
|
|
|
|
|
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="ml-8" StartIcon="@Icons.Material.Filled.Add" Href="watermarks/add"> |
|
|
|
|
|
|
|
Add Watermark |
|
|
|
|
|
|
|
</MudButton> |
|
|
|
|
|
|
|
</MudPaper> |
|
|
|
|
|
|
|
<div class="d-flex flex-column" style="height: 100vh; overflow-x: auto"> |
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8"> |
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8"> |
|
|
|
|
|
|
|
<MudText Typo="Typo.h5" Class="mb-2">Watermarks</MudText> |
|
|
|
|
|
|
|
<MudDivider Class="mb-6"/> |
|
|
|
<MudTable Hover="true" Items="_watermarks"> |
|
|
|
<MudTable Hover="true" Items="_watermarks"> |
|
|
|
<ToolBarContent> |
|
|
|
|
|
|
|
<MudText Typo="Typo.h6">Watermarks</MudText> |
|
|
|
|
|
|
|
</ToolBarContent> |
|
|
|
|
|
|
|
<ColGroup> |
|
|
|
<ColGroup> |
|
|
|
|
|
|
|
<MudHidden Breakpoint="Breakpoint.Xs"> |
|
|
|
<col/> |
|
|
|
<col/> |
|
|
|
<col/> |
|
|
|
<col/> |
|
|
|
<col/> |
|
|
|
<col/> |
|
|
|
<col/> |
|
|
|
<col/> |
|
|
|
<col style="width: 180px;"/> |
|
|
|
<col style="width: 180px;"/> |
|
|
|
|
|
|
|
</MudHidden> |
|
|
|
</ColGroup> |
|
|
|
</ColGroup> |
|
|
|
<HeaderContent> |
|
|
|
<HeaderContent> |
|
|
|
<MudTh>Name</MudTh> |
|
|
|
<MudTh>Name</MudTh> |
|
|
@ -63,10 +71,9 @@ |
|
|
|
</MudTd> |
|
|
|
</MudTd> |
|
|
|
</RowTemplate> |
|
|
|
</RowTemplate> |
|
|
|
</MudTable> |
|
|
|
</MudTable> |
|
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" Href="watermarks/add" Class="mt-4"> |
|
|
|
|
|
|
|
Add Watermark |
|
|
|
|
|
|
|
</MudButton> |
|
|
|
|
|
|
|
</MudContainer> |
|
|
|
</MudContainer> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</MudForm> |
|
|
|
|
|
|
|
|
|
|
|
@code { |
|
|
|
@code { |
|
|
|
private readonly CancellationTokenSource _cts = new(); |
|
|
|
private readonly CancellationTokenSource _cts = new(); |
|
|
@ -91,7 +98,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
IDialogReference dialog = await Dialog.ShowAsync<DeleteDialog>("Delete Watermark", parameters, options); |
|
|
|
IDialogReference dialog = await Dialog.ShowAsync<DeleteDialog>("Delete Watermark", parameters, options); |
|
|
|
DialogResult result = await dialog.Result; |
|
|
|
DialogResult result = await dialog.Result; |
|
|
|
if (!result.Canceled) |
|
|
|
if (result is { Canceled: false }) |
|
|
|
{ |
|
|
|
{ |
|
|
|
await Mediator.Send(new DeleteWatermark(watermark.Id), _cts.Token); |
|
|
|
await Mediator.Send(new DeleteWatermark(watermark.Id), _cts.Token); |
|
|
|
await LoadWatermarksAsync(); |
|
|
|
await LoadWatermarksAsync(); |
|
|
@ -105,7 +112,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
IDialogReference dialog = await Dialog.ShowAsync<CopyWatermarkDialog>("Copy Watermark", parameters, options); |
|
|
|
IDialogReference dialog = await Dialog.ShowAsync<CopyWatermarkDialog>("Copy Watermark", parameters, options); |
|
|
|
DialogResult dialogResult = await dialog.Result; |
|
|
|
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}"); |
|
|
|
NavigationManager.NavigateTo($"/watermarks/{data.Id}"); |
|
|
|
} |
|
|
|
} |
|
|
|