mirror of
https://github.com/Stefan-5422/-T5-Elektrifikatsiya.git
synced 2026-09-04 00:45:58 +02:00
Fix some stuff (❁´◡`❁)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
@inherits LayoutComponentBase
|
||||
<Image Source="logo.png" Width="Width.Is50" Height="Height.Is50"> </Image>
|
||||
<Card Width="Width.Is50" Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Padding="Padding.Is5">
|
||||
<Card Width="Width.Is50" Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Padding="Padding.Is2.OnX.Is4.OnMobile.OnY.OnMobile.Is5.OnDesktop">
|
||||
<Column ColumnSize="ColumnSize.Is6.OnDesktop.Is3.WithOffset.OnDesktop.Is12.OnMobile">
|
||||
<Field Position="Position.Relative.Top.Is50.Start.Is50.Translate.Middle" Width="Width.Auto">
|
||||
<TextEdit @bind-Text="username" Placeholder="Username" Size="Size.Small" />
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
@inject IAuthenticationService AuthenthicationService;
|
||||
@inject NavigationManager NavigationManager;
|
||||
@inject MainDatabaseContext MainDatabaseContext;
|
||||
|
||||
<Protected RequiredRole="Role.Admin">
|
||||
<Authorized>
|
||||
<Div>
|
||||
<Row Style="width: 100%; height: 100%" Margin="Margin.Is3.FromTop.OnMobile" Padding="Padding.Is4.FromStart.OnMobile">
|
||||
|
||||
@@ -160,7 +163,7 @@
|
||||
</Validation>
|
||||
<br />
|
||||
<br />
|
||||
<Validation @ref="updateValidation" Validator="ValidatePW">
|
||||
<Validation @ref="updateValidation" Validator="ValidationRule.IsNotEmpty">
|
||||
<Field>
|
||||
<FieldLabel>
|
||||
<h5>
|
||||
@@ -203,7 +206,11 @@
|
||||
</Div>
|
||||
</Row>
|
||||
</Div>
|
||||
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
Bro no! this page is only for admins! 😠
|
||||
</NotAuthorized>
|
||||
</Protected>
|
||||
@code {
|
||||
List<User> users = new List<User>();
|
||||
|
||||
@@ -334,49 +341,4 @@
|
||||
{
|
||||
admin = false;
|
||||
}
|
||||
public void ValidateName(ValidatorEventArgs e)
|
||||
{
|
||||
string? input = Convert.ToString(e.Value);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
e.Status = ValidationStatus.None;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Status = ValidationStatus.Success;
|
||||
return;
|
||||
}
|
||||
}
|
||||
public void ValidateEmail(ValidatorEventArgs e)
|
||||
{
|
||||
string? input = Convert.ToString(e.Value);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
e.Status = ValidationStatus.None;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Status = ValidationStatus.Success;
|
||||
return;
|
||||
}
|
||||
}
|
||||
public void ValidatePW(ValidatorEventArgs e)
|
||||
{
|
||||
string? input = Convert.ToString(e.Value);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
e.Status = ValidationStatus.None;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Status = ValidationStatus.Success;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user