| | | 1 | | @page "/admin/utilities" |
| | | 2 | | @attribute [Authorize] |
| | | 3 | | @inject IAdminAuthService AdminAuth |
| | | 4 | | @inject NavigationManager Navigation |
| | | 5 | | |
| | | 6 | | <PageTitle>Utilities - Chronicis</PageTitle> |
| | | 7 | | |
| | 0 | 8 | | @if (_authorized == null) |
| | | 9 | | { |
| | | 10 | | <MudProgressLinear Indeterminate="true" Color="Color.Primary" /> |
| | | 11 | | } |
| | 0 | 12 | | else if (_authorized == false) |
| | | 13 | | { |
| | | 14 | | <MudAlert Severity="Severity.Error" Class="ma-4"> |
| | | 15 | | You do not have permission to access this page. |
| | | 16 | | </MudAlert> |
| | | 17 | | } |
| | | 18 | | else |
| | | 19 | | { |
| | | 20 | | <MudPaper Elevation="2" Class="admin-container pa-6"> |
| | | 21 | | <div class="admin-header mb-6"> |
| | | 22 | | <MudText Typo="Typo.h4" Class="admin-title">Admin Utilities</MudText> |
| | | 23 | | <MudText Typo="Typo.body2" Class="mud-text-secondary"> |
| | | 24 | | System administration tools. Handle with care. |
| | | 25 | | </MudText> |
| | | 26 | | </div> |
| | | 27 | | |
| | | 28 | | <!-- Admin Navigation --> |
| | | 29 | | <div class="mb-4"> |
| | | 30 | | <MudButtonGroup Variant="Variant.Outlined" Color="Color.Primary"> |
| | | 31 | | <MudButton StartIcon="@Icons.Material.Filled.Build" |
| | | 32 | | Href="/admin/utilities" |
| | | 33 | | Variant="@(Navigation.Uri.Contains("/utilities") ? Variant.Filled : Variant.Outlined)"> |
| | | 34 | | Utilities |
| | | 35 | | </MudButton> |
| | | 36 | | <MudButton StartIcon="@Icons.Material.Filled.HealthAndSafety" |
| | | 37 | | Href="/admin/status" |
| | | 38 | | Variant="@(Navigation.Uri.Contains("/status") ? Variant.Filled : Variant.Outlined)"> |
| | | 39 | | System Status |
| | | 40 | | </MudButton> |
| | | 41 | | </MudButtonGroup> |
| | | 42 | | </div> |
| | | 43 | | |
| | | 44 | | <MudTabs Elevation="0" |
| | | 45 | | Rounded="true" |
| | | 46 | | ApplyEffectsToContainer="true" |
| | | 47 | | PanelClass="pt-6" |
| | | 48 | | Color="Color.Primary" |
| | | 49 | | SliderColor="Color.Primary" |
| | | 50 | | Class="admin-tabs"> |
| | | 51 | | <MudTabPanel Text="External Resources" Icon="@Icons.Material.Filled.Extension"> |
| | | 52 | | <RenderDefinitionGenerator /> |
| | | 53 | | </MudTabPanel> |
| | | 54 | | </MudTabs> |
| | | 55 | | </MudPaper> |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | @code { |
| | | 59 | | private bool? _authorized; |
| | | 60 | | |
| | | 61 | | protected override async Task OnInitializedAsync() |
| | | 62 | | { |
| | 0 | 63 | | _authorized = await AdminAuth.IsSysAdminAsync(); |
| | 0 | 64 | | } |
| | | 65 | | } |