Update layout using Radzen

This commit is contained in:
2025-09-24 18:44:30 +09:00
parent e2f404fdef
commit 46634b52bc
8 changed files with 46 additions and 62 deletions

View File

@ -5,14 +5,13 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link rel="stylesheet" href="app.css" />
<link rel="stylesheet" href="Hcs.WebApp.styles.css" />
<RadzenTheme Theme="material" @rendermode="InteractiveServer" />
<HeadOutlet />
<RadzenTheme Theme="standard" @rendermode="InteractiveServer" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>
<body>
<Routes />
<Routes @rendermode="InteractiveServer" />
<script src="_framework/blazor.web.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
</body>

View File

@ -2,10 +2,31 @@
<RadzenComponents @rendermode="InteractiveServer" />
@Body
<RadzenLayout Style="grid-template-areas: 'rz-sidebar rz-header' 'rz-sidebar rz-body'">
<RadzenHeader>
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0">
<RadzenSidebarToggle Click="@(() => sidebarExpanded = !sidebarExpanded)" />
<RadzenLabel Text="Система автоматической интеграции с ГИС ЖКХ" />
</RadzenStack>
</RadzenHeader>
<RadzenSidebar @bind-Expanded="@sidebarExpanded">
<RadzenPanelMenu>
<RadzenPanelMenuItem Text="Главная" Icon="home" />
</RadzenPanelMenu>
</RadzenSidebar>
<RadzenBody>
<div class="rz-p-4">
@Body
</div>
<div id="blazor-error-ui">
An unhandled error has occurred
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<div id="blazor-error-ui">
Произошла непредвиденная ошибка
<a href="" class="reload">Перезагрузить</a>
<a class="dismiss">🗙</a>
</div>
</RadzenBody>
</RadzenLayout>
@code {
bool sidebarExpanded = true;
}

View File

@ -1,29 +1,19 @@
@page "/Error"
@page "/error"
@using System.Diagnostics
<PageTitle>Error</PageTitle>
<PageTitle>Ошибка</PageTitle>
<h1 class="text-danger">Error</h1>
<h2 class="text-danger">An error occurred while processing your request</h2>
<h1 class="text-danger">Ошибка</h1>
<h2 class="text-danger">При выполнении запроса возникла ошибка</h2>
@if (ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@RequestId</code>
<strong>ID запроса:</strong> <code>@RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
@code{
[CascadingParameter]
private HttpContext? HttpContext { get; set; }

View File

@ -2,11 +2,11 @@
<PageTitle>Главная</PageTitle>
<h1>Привет, мир!</h1>
Добро пожаловать!
<RadzenButton Click="@ButtonClicked" Text="Нажми меня"></RadzenButton>
@code {
void ButtonClicked() { }
void ButtonClicked()
{
Console.WriteLine("Кнопка нажата");
}
}

View File

@ -1,6 +1,5 @@
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>