61 lines
1.6 KiB
Plaintext
61 lines
1.6 KiB
Plaintext
@using GWMS.UI.Components
|
|
@using System.Security.Claims
|
|
@using Microsoft.AspNetCore.Components.Authorization
|
|
@using GWMS.UI.Data
|
|
|
|
@inject MessageService AppMessages
|
|
|
|
<div class="form-row pt-3">
|
|
<div class="col-7 col-md-6 col-lg-4 col-xl-3">
|
|
<LoginDisplay></LoginDisplay>
|
|
</div>
|
|
<div class="col-12 col-lg-4 col-xl-6 d-none d-lg-block text-center h4 text-truncate">
|
|
<span><i class="@PageIcon" aria-hidden="true"></i> @PageName</span>
|
|
</div>
|
|
<div class="col-5 col-md-6 col-lg-4 col-xl-3 text-right">
|
|
@if (ShowSearch)
|
|
{
|
|
<SearchMod></SearchMod>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
|
|
[CascadingParameter(Name = "ShowSearch")]
|
|
private bool ShowSearch { get; set; }
|
|
|
|
|
|
private string PageName { get; set; }
|
|
private string PageIcon { get; set; }
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await Task.Delay(0);
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
AppMessages.EA_PageUpdated += OnPageUpdate;
|
|
}
|
|
public void OnPageUpdate()
|
|
{
|
|
PageName = AppMessages.PageName;
|
|
PageIcon = AppMessages.PageIcon;
|
|
InvokeAsync(() =>
|
|
{
|
|
StateHasChanged();
|
|
});
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
AppMessages.EA_PageUpdated -= OnPageUpdate;
|
|
}
|
|
|
|
}
|
|
|
|
@* // Vedere anche:
|
|
// https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-5.0#:~:text=Blazor%20uses%20the%20existing%20ASP.NET%20Core%20authentication%20mechanisms,all%20client-side%20code%20can%20be%20modified%20by%20users
|
|
// https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-5.0*@ |