| | 1 | | @using Syki.Front.Features.Adm.GetFeatureFlags |
| | 2 | |
|
| | 3 | | @namespace Syki.Front.Pages.Adm |
| | 4 | |
|
| | 5 | | @page "/adm/feature-flags" |
| | 6 | | @attribute [Authorize(Roles = "Adm")] |
| | 7 | |
|
| | 8 | | <SykiPageTitle Title="Features" /> |
| | 9 | |
|
| | 10 | | <MudContainer Class="my-4 px-4"> |
| | 11 | | <SykiPageHeader Icon="@Icons.Material.Filled.Flag" Title="Features" /> |
| | 12 | | <MudContainer Class="px-0 my-4"> |
| | 13 | | <MudGrid Spacing="4"> |
| 0 | 14 | | <FeatureFlagCard Loading="@_loading" Text="Logar sem cadastro" Value="@_skipUserRegister" ValueChanged="asyn |
| 0 | 15 | | <FeatureFlagCard Loading="@_loading" Text="Login cruzado" Value="@_crossLogin" ValueChanged="async x => { _c |
| | 16 | | </MudGrid> |
| | 17 | | </MudContainer> |
| | 18 | | </MudContainer> |
| | 19 | |
|
| | 20 | | @inject ISnackbar Snackbar |
| | 21 | | @inject GetFeatureFlagsClient GetFeatureFlagsClient |
| | 22 | | @inject SetupFeatureFlagsClient SetupFeatureFlagsClient |
| | 23 | |
|
| | 24 | | @code |
| | 25 | | { |
| | 26 | | private bool _loading; |
| | 27 | | private bool _skipUserRegister; |
| | 28 | | private bool _crossLogin; |
| | 29 | |
|
| | 30 | | protected override async Task OnInitializedAsync() |
| | 31 | | { |
| 0 | 32 | | _loading = true; |
| 0 | 33 | | var features = await GetFeatureFlagsClient.Get(); |
| 0 | 34 | | _skipUserRegister = features.SkipUserRegister; |
| 0 | 35 | | _crossLogin = features.CrossLogin; |
| 0 | 36 | | _loading = false; |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | private async Task Setup() |
| | 40 | | { |
| 0 | 41 | | _loading = true; |
| 0 | 42 | | await SetupFeatureFlagsClient.Setup(_skipUserRegister, _crossLogin); |
| 0 | 43 | | Snackbar.Add("Feature alterada com sucesso!", Severity.Success); |
| 0 | 44 | | _loading = false; |
| 0 | 45 | | } |
| | 46 | | } |