diff --git a/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs b/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs index 67da5d86..2db50fec 100644 --- a/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs +++ b/Moonlight/Core/Models/Forms/Users/UpdateUserForm.cs @@ -1,5 +1,6 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; +using MoonCoreUI.Attributes; namespace Moonlight.Core.Models.Forms.Users; @@ -16,5 +17,7 @@ public class UpdateUserForm public string Email { get; set; } [Description("This toggles the use of the two factor authentication")] + [RadioButtonBool("Enabled", "Disabled", TrueIcon = "bx-lock-alt", FalseIcon = "bx-lock-open-alt")] + [DisplayName("Two factor authentication")] public bool Totp { get; set; } = false; } \ No newline at end of file diff --git a/Moonlight/Core/UI/Views/Admin/Users/Index.razor b/Moonlight/Core/UI/Views/Admin/Users/Index.razor index 0568ffed..106923bd 100644 --- a/Moonlight/Core/UI/Views/Admin/Users/Index.razor +++ b/Moonlight/Core/UI/Views/Admin/Users/Index.razor @@ -17,30 +17,30 @@ + TCreateForm="CreateUserForm" + TUpdateForm="UpdateUserForm" + Loader="Load" + CustomAdd="Add" + ValidateUpdate="ValidateUpdate"> - + - + + Change password @code { - private User[] Load(Repository repository) + private IEnumerable Load(Repository repository) { - return repository.Get().ToArray(); + return repository.Get(); } private async Task ChangePassword(User user) diff --git a/Moonlight/Core/UI/Views/Admin/Users/Sessions.razor b/Moonlight/Core/UI/Views/Admin/Users/Sessions.razor index 641eef1c..9d626380 100644 --- a/Moonlight/Core/UI/Views/Admin/Users/Sessions.razor +++ b/Moonlight/Core/UI/Views/Admin/Users/Sessions.razor @@ -22,11 +22,11 @@
-
+