73 lines
2.7 KiB
Plaintext
73 lines
2.7 KiB
Plaintext
@inherits LayoutComponentBase
|
||
|
||
@implements IDisposable
|
||
|
||
@inject NavigationManager NavigationManager
|
||
@inject NotificationService NotificationService
|
||
|
||
<RadzenLayout>
|
||
<RadzenHeader>
|
||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0">
|
||
<RadzenSidebarToggle Click="@(() => sidebarExpanded = !sidebarExpanded)" />
|
||
<RadzenLabel Text="Система автоматической интеграции с ГИС ЖКХ" />
|
||
</RadzenStack>
|
||
</RadzenHeader>
|
||
<RadzenSidebar FullHeight="true" @bind-Expanded="@sidebarExpanded">
|
||
<RadzenStack Style="height: 100%" JustifyContent="JustifyContent.SpaceBetween">
|
||
<RadzenPanelMenu>
|
||
<RadzenPanelMenuItem Path="/" Text="Главная" Icon="home" />
|
||
<RadzenPanelMenuItem Text="Тестирование" Icon="simulation">
|
||
<RadzenPanelMenuItem Path="/test/export" Text="Экспорт" Icon="arrow_outward" />
|
||
</RadzenPanelMenuItem>
|
||
</RadzenPanelMenu>
|
||
<RadzenPanelMenu>
|
||
<AuthorizeView>
|
||
<Authorized>
|
||
<RadzenPanelMenuItem Path="/account/manage" Text="@context.User.Identity?.Name" />
|
||
<RadzenPanelMenuItem Path="/identity/logout" Text="Выйти" Icon="logout" />
|
||
</Authorized>
|
||
<NotAuthorized>
|
||
<RadzenPanelMenuItem Path="/account/register" Text="Регистрация" Icon="person_add" />
|
||
<RadzenPanelMenuItem Path="/account/login" Text="Вход" Icon="login" />
|
||
</NotAuthorized>
|
||
</AuthorizeView>
|
||
</RadzenPanelMenu>
|
||
</RadzenStack>
|
||
</RadzenSidebar>
|
||
<RadzenBody>
|
||
<RadzenNotification Style="position: absolute;top: 0; right: 0;" />
|
||
@Body
|
||
<div id="blazor-error-ui">
|
||
Произошла непредвиденная ошибка
|
||
<a href="" class="reload">Перезагрузить</a>
|
||
<a class="dismiss">🗙</a>
|
||
</div>
|
||
</RadzenBody>
|
||
</RadzenLayout>
|
||
|
||
@code {
|
||
bool sidebarExpanded = true;
|
||
string? currentUrl;
|
||
|
||
protected override void OnInitialized()
|
||
{
|
||
currentUrl = NavigationManager.ToBaseRelativePath(NavigationManager.Uri);
|
||
|
||
NavigationManager.LocationChanged += OnLocationChanged;
|
||
}
|
||
|
||
public void Dispose()
|
||
{
|
||
NavigationManager.LocationChanged -= OnLocationChanged;
|
||
}
|
||
|
||
private void OnLocationChanged(object? sender, LocationChangedEventArgs e)
|
||
{
|
||
currentUrl = NavigationManager.ToBaseRelativePath(e.Location);
|
||
|
||
NotificationService.Messages.Clear();
|
||
|
||
StateHasChanged();
|
||
}
|
||
}
|