diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Layouts/LoginLayout.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Layouts/LoginLayout.razor
index 0055775..0cfd389 100644
--- a/src/Elektrifikatsiya/Elektrifikatsiya/Layouts/LoginLayout.razor
+++ b/src/Elektrifikatsiya/Elektrifikatsiya/Layouts/LoginLayout.razor
@@ -6,37 +6,37 @@
@inherits LayoutComponentBase
-
-
-
-
-
+
+
+
+
+
-
+
@code {
- private string username = string.Empty;
+ private string username = string.Empty;
private string password = string.Empty;
private Color color = Color.Primary;
private bool disabled;
- private async Task Clicked()
- {
- color = Color.Primary;
- disabled = true;
-
- Result loginResult = await AuthenticationService.LoginUserAsync(username, password);
+ private async Task Clicked()
+ {
+ color = Color.Primary;
+ disabled = true;
- if (loginResult.IsSuccess)
- {
- NavigationManager.NavigateTo("/", true);
- }
- else
- {
- color = Color.Danger;
- disabled = false;
- }
- }
+ Result loginResult = await AuthenticationService.LoginUserAsync(username, password);
+
+ if (loginResult.IsSuccess)
+ {
+ NavigationManager.NavigateTo("/", true);
+ }
+ else
+ {
+ color = Color.Danger;
+ disabled = false;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor
index 001e646..9209005 100644
--- a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor
+++ b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Admin.razor
@@ -14,196 +14,203 @@
@inject IAuthenticationService AuthenthicationService;
@inject NavigationManager NavigationManager;
@inject MainDatabaseContext MainDatabaseContext;
-
-
-
-
-
-
-
- Users
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- @context.Item.Name
-
-
-
-
- Name: @context.Item.Name
-
- Rolle: @context.Item.Role
-
- E-Mail: @context.Item.Email
-
-
+
+
+
+
+
+
+
+
+
+
+ Users
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @context.Item.Name
+
+
+
+
+ Name: @context.Item.Name
+
+ Rolle: @context.Item.Role
+
+ E-Mail: @context.Item.Email
+
+
+
+
+
+ Delete(context.Item)" class="btn1" Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Outline>
+
+
+
+
+
+
+
+ Add User
+
+
+
+
+ User Name
+
+
+
+ User E-Mail
+
+
+
+ User Password
+
+
+
+
+ Close
+ Add
+
+
+
+
+
+
+
+
+ Toggle(context.Item)" Position="Position.Absolute.Top.Is50.Start.Is100.Translate.Middle" Color="Color.Dark" Outline>
+
+
+
+
+
+
+
+
+
+
+
+ @if (SelectedUser is not null)
+ {
+
+
+
+
+ User Settings
+
+
+
+
+
+
+
+ User Name
+
+
+ Here you can change the name of the User
+
+
+
+
+
-
-
- Toggle(context.Item)" Position="Position.Absolute.Top.Is50.Start.Is100.Translate.Middle" Color="Color.Dark" Outline>
-
-
-
-
-
-
-
-
-
-
-
- @if (SelectedUser is not null)
- {
-
-
-
-
- User Settings
-
-
-
-
-
-
-
- User Name
-
-
- Here you can change the name of the User
-
-
-
-
-
-
-
-
-
-
-
- E-Mail
-
-
- Here you can change the E-Mail of a User
-
-
-
-
-
-
-
-
-
-
-
- Password
-
-
- Here you can change the password of a User
-
-
-
-
-
-
-
-
-
-
- Select Role
-
-
- Here you select or change the role of to User or Admin
-
-
-
-
- Roles
-
- SetRoleAdmin()">Admin
-
- SetRoleUser()">User
-
-
-
-
- Save
-
-
- }
-
+
+
+
+
+ E-Mail
+
+
+ Here you can change the E-Mail of a User
+
+
+
+
+
+
+
+
+
+
+
+ Password
+
+
+ Here you can change the password of a User
+
+
+
+
+
+
+
+
+
+
+ Select Role
+
+
+ Here you select or change the role of to User or Admin
+
+
+
+
+ Roles
+
+ SetRoleAdmin()">Admin
+
+ SetRoleUser()">User
+
+
+
+
+ Save
+
+
+ }
+
+
+
-
-
-
+
+
+ Bro no! this page is only for admins! ðŸ˜
+
+
@code {
List users = new List();
@@ -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;
- }
- }
}