Use a better method to share common page layout
This commit is contained in:
@ -11,8 +11,6 @@
|
|||||||
|
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
|
|
||||||
@layout AuthorizedLayout
|
|
||||||
|
|
||||||
@implements IDisposable
|
@implements IDisposable
|
||||||
|
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@ -21,37 +19,41 @@
|
|||||||
|
|
||||||
<PageTitle>Тестирование экспорта</PageTitle>
|
<PageTitle>Тестирование экспорта</PageTitle>
|
||||||
|
|
||||||
<RadzenSplitter Orientation="Orientation.Vertical" Style="height: 100%; border: 1px solid rgba(0,0,0,.08);">
|
<AuthorizedContent Roles="@AppRole.OPERATOR_TYPE">
|
||||||
<RadzenSplitterPane Size="200px">
|
<Content>
|
||||||
<div style="height: 100%;overflow: auto;">
|
<RadzenSplitter Orientation="Orientation.Vertical" Style="height: 100%; border: 1px solid rgba(0,0,0,.08);">
|
||||||
<RadzenCardGroup Responsive="true">
|
<RadzenSplitterPane Size="200px">
|
||||||
<RadzenCard Variant="Variant.Filled">
|
<div style="height: 100%;overflow: auto;">
|
||||||
<RadzenStack JustifyContent="JustifyContent.SpaceBetween" Gap="1rem">
|
<RadzenCardGroup Responsive="true">
|
||||||
<RadzenStack Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Normal">
|
<RadzenCard Variant="Variant.Filled">
|
||||||
<RadzenText TextStyle="TextStyle.H6">Сервис nsi</RadzenText>
|
<RadzenStack JustifyContent="JustifyContent.SpaceBetween" Gap="1rem">
|
||||||
<RadzenButton Click=@(() => OnNsiExportItem1Click()) Disabled=@inputDisabled Text="Экспорт НСИ 1" ButtonStyle="ButtonStyle.Primary" />
|
<RadzenStack Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" JustifyContent="JustifyContent.Normal">
|
||||||
</RadzenStack>
|
<RadzenText TextStyle="TextStyle.H6">Сервис nsi</RadzenText>
|
||||||
</RadzenStack>
|
<RadzenButton Click=@(() => OnNsiExportItem1Click()) Disabled=@inputDisabled Text="Экспорт НСИ 1" ButtonStyle="ButtonStyle.Primary" />
|
||||||
</RadzenCard>
|
</RadzenStack>
|
||||||
</RadzenCardGroup>
|
</RadzenStack>
|
||||||
</div>
|
</RadzenCard>
|
||||||
</RadzenSplitterPane>
|
</RadzenCardGroup>
|
||||||
<RadzenSplitterPane>
|
</div>
|
||||||
<RadzenTabs RenderMode="TabRenderMode.Client" Style="height: 100%;">
|
</RadzenSplitterPane>
|
||||||
<Tabs>
|
<RadzenSplitterPane>
|
||||||
<RadzenTabsItem Text="Запрос">
|
<RadzenTabs RenderMode="TabRenderMode.Client" Style="height: 100%;">
|
||||||
<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" />
|
<Tabs>
|
||||||
</RadzenTabsItem>
|
<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=@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>
|
<RadzenTabsItem Text="Результат">
|
||||||
</Tabs>
|
<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" />
|
||||||
</RadzenTabs>
|
</RadzenTabsItem>
|
||||||
</RadzenSplitterPane>
|
</Tabs>
|
||||||
<RadzenSplitterPane Size="auto" Resizable="false">
|
</RadzenTabs>
|
||||||
<EventConsole @ref=@console />
|
</RadzenSplitterPane>
|
||||||
</RadzenSplitterPane>
|
<RadzenSplitterPane Size="auto" Resizable="false">
|
||||||
</RadzenSplitter>
|
<EventConsole @ref=@console />
|
||||||
|
</RadzenSplitterPane>
|
||||||
|
</RadzenSplitter>
|
||||||
|
</Content>
|
||||||
|
</AuthorizedContent>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
EventConsole console = default!;
|
EventConsole console = default!;
|
||||||
@ -66,16 +68,6 @@
|
|||||||
FileMessageCapturer messageCapturer;
|
FileMessageCapturer messageCapturer;
|
||||||
bool catchMessageBody;
|
bool catchMessageBody;
|
||||||
|
|
||||||
[CascadingParameter]
|
|
||||||
public AuthorizedLayout Layout { get; set; }
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
|
||||||
base.OnInitialized();
|
|
||||||
|
|
||||||
Layout.Roles = AppRole.ADMINISTRATOR_TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (messageCapturer != null)
|
if (messageCapturer != null)
|
||||||
|
|||||||
@ -1,13 +1,9 @@
|
|||||||
@inherits LayoutComponentBase
|
@using Microsoft.AspNetCore.Authorization
|
||||||
|
|
||||||
@using Microsoft.AspNetCore.Authorization
|
|
||||||
|
|
||||||
@layout MainLayout
|
|
||||||
|
|
||||||
<AuthorizeView Roles="@Roles">
|
<AuthorizeView Roles="@Roles">
|
||||||
<Authorized>
|
<Authorized>
|
||||||
<CascadingValue Value="this">
|
<CascadingValue Value="this">
|
||||||
@Body
|
@Content
|
||||||
</CascadingValue>
|
</CascadingValue>
|
||||||
</Authorized>
|
</Authorized>
|
||||||
<NotAuthorized>
|
<NotAuthorized>
|
||||||
@ -18,5 +14,9 @@
|
|||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
public string Roles { get; set; }
|
[Parameter]
|
||||||
|
public required string Roles { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public required RenderFragment Content { get; set; }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user