Files
mapo-core/MP.MON/Components/Layout/MainLayout.razor
T

52 lines
1.5 KiB
Plaintext

@inherits LayoutComponentBase
<PageTitle>MP.Mon</PageTitle>
<div class="page">
<main>
<div class="top-row px-4 justify-content-between">
<CmpHeader @rendermode="InteractiveAuto"></CmpHeader>
</div>
<article class="content px-4">
@Body
</article>
<div class="fixed-bottom bottom-row px-2">
<CmpFooter @rendermode="InteractiveAuto" version="@version"></CmpFooter>
</div>
</main>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
@code{
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
[Inject]
protected IConfiguration config { get; set; } = null!;
protected override void OnInitialized()
{
// controllo URL x riscrivere se non fosse /MP/MON finale...
string baseUrl = config.GetValue<string>("ServerConf:BaseAppPath") ?? "/MP/MON/";
string wrongEnd = baseUrl.Substring(0, baseUrl.Length - 1);
string currUrl = NavMan.Uri;
if(currUrl.EndsWith(wrongEnd))
{
NavMan.NavigateTo(baseUrl, true);
}
// base.OnInitialized();
var currAssembly = typeof(Program).Assembly.GetName();
version = currAssembly.Version != null ? currAssembly.Version : new Version();
}
/// <summary>
/// Versione applicativo ada passare al controllo footer
/// </summary>
private Version version = null!;
}