Add redirection to login

This commit is contained in:
2025-10-07 09:48:24 +09:00
parent c29f7ef7dd
commit 695fea54b4
3 changed files with 45 additions and 31 deletions

View File

@ -18,37 +18,39 @@
<PageTitle>Тестирование экспорта</PageTitle> <PageTitle>Тестирование экспорта</PageTitle>
<RadzenSplitter Orientation="Orientation.Vertical" Style="height: 100%; border: 1px solid rgba(0,0,0,.08);"> <AuthorizeView>
<RadzenSplitterPane Size="200px"> <RadzenSplitter Orientation="Orientation.Vertical" Style="height: 100%; border: 1px solid rgba(0,0,0,.08);">
<div style="height: 100%;overflow: auto;"> <RadzenSplitterPane Size="200px">
<RadzenCardGroup Responsive="true"> <div style="height: 100%;overflow: auto;">
<RadzenCard Variant="Variant.Filled"> <RadzenCardGroup Responsive="true">
<RadzenStack JustifyContent="JustifyContent.SpaceBetween" Gap="1rem"> <RadzenCard Variant="Variant.Filled">
<RadzenStack Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Normal"> <RadzenStack JustifyContent="JustifyContent.SpaceBetween" Gap="1rem">
<RadzenText TextStyle="TextStyle.H6">Сервис nsi</RadzenText> <RadzenStack Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Normal">
<RadzenButton Click=@(() => OnNsiExportItem1Click()) Disabled=@inputDisabled Text="Экспорт НСИ 1" ButtonStyle="ButtonStyle.Primary" /> <RadzenText TextStyle="TextStyle.H6">Сервис nsi</RadzenText>
<RadzenButton Click=@(() => OnNsiExportItem1Click()) Disabled=@inputDisabled Text="Экспорт НСИ 1" ButtonStyle="ButtonStyle.Primary" />
</RadzenStack>
</RadzenStack> </RadzenStack>
</RadzenStack> </RadzenCard>
</RadzenCard> </RadzenCardGroup>
</RadzenCardGroup> </div>
</div> </RadzenSplitterPane>
</RadzenSplitterPane> <RadzenSplitterPane>
<RadzenSplitterPane> <RadzenTabs RenderMode="TabRenderMode.Client" Style="height: 100%;">
<RadzenTabs RenderMode="TabRenderMode.Client" Style="height: 100%;"> <Tabs>
<Tabs> <RadzenTabsItem Text="Запрос">
<RadzenTabsItem Text="Запрос"> <RadzenTextArea @ref=@messageTextArea Value=@messageBody Disabled="true" ReadOnly="true" Style="resize: none; white-space: pre; overflow-wrap: normal; overflow-x: auto;" class="rz-w-stretch" />
<RadzenTextArea @ref=@messageTextArea Value=@messageBody Disabled="true" ReadOnly="true" Style="resize: none; white-space: pre; overflow-wrap: normal; overflow-x: auto;" class="rz-w-stretch" /> </RadzenTabsItem>
</RadzenTabsItem> <RadzenTabsItem Text="Результат">
<RadzenTabsItem Text="Результат"> <RadzenTextArea @ref=@responseTextArea Value=@responseBody Disabled="true" ReadOnly="true" Style="resize: none; white-space: pre; overflow-wrap: normal; overflow-x: auto;" class="rz-w-stretch" />
<RadzenTextArea @ref=@responseTextArea Value=@responseBody Disabled="true" ReadOnly="true" Style="resize: none; white-space: pre; overflow-wrap: normal; overflow-x: auto;" class="rz-w-stretch" /> </RadzenTabsItem>
</RadzenTabsItem> </Tabs>
</Tabs> </RadzenTabs>
</RadzenTabs> </RadzenSplitterPane>
</RadzenSplitterPane> <RadzenSplitterPane Size="auto" Resizable="false">
<RadzenSplitterPane Size="auto" Resizable="false"> <EventConsole @ref=@console />
<EventConsole @ref=@console /> </RadzenSplitterPane>
</RadzenSplitterPane> </RadzenSplitter>
</RadzenSplitter> </AuthorizeView>
@code { @code {
EventConsole console = default!; EventConsole console = default!;

View File

@ -1,5 +1,9 @@
<Router AppAssembly="typeof(Program).Assembly"> <Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData"> <Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" /> <AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
</Found> </Found>
</Router> </Router>

View File

@ -0,0 +1,8 @@
@inject NavigationManager NavigationManager
@code {
protected override void OnInitialized()
{
NavigationManager.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true);
}
}