Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update admin UI to be more consistent (#2143)

Leendert de Borst0c4023938541
diff --git a/apps/server/AliasVault.Admin/Main/Components/Buttons/ButtonStyles.cs b/apps/server/AliasVault.Admin/Main/Components/Buttons/ButtonStyles.cs
index cc1b997ed..6923e7dd6 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Buttons/ButtonStyles.cs
+++ b/apps/server/AliasVault.Admin/Main/Components/Buttons/ButtonStyles.cs
@@ -15,7 +15,7 @@ public static class ButtonStyles
/// <summary>
/// Gets the base CSS classes for buttons.
/// </summary>
- public static string BaseClasses => "center items-center px-3 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-4";
+ public static string BaseClasses => "center items-center px-3 py-2 text-sm font-medium rounded-lg focus:outline-none focus:ring-4";
/// <summary>
/// Gets the CSS classes for a disabled button.
@@ -25,14 +25,15 @@ public static class ButtonStyles
/// <summary>
/// Gets the color-specific CSS classes for a button based on the provided color.
/// </summary>
- /// <param name="color">The color name for the button (e.g., "primary", "danger", "success", "secondary").</param>
+ /// <param name="color">The color name for the button (e.g., "primary", "danger", "success", "secondary", "light").</param>
/// <returns>A string containing the appropriate CSS classes for the specified color.</returns>
public static string GetColorClasses(string color) => color switch
{
- "primary" => "bg-primary-700 hover:bg-primary-800 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",
- "secondary" => "bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",
- "danger" => "bg-red-700 hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800",
- "success" => "bg-green-700 hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800",
- _ => "bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",
+ "primary" => "text-white bg-primary-700 hover:bg-primary-800 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",
+ "secondary" => "text-white bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",
+ "danger" => "text-white bg-red-700 hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800",
+ "success" => "text-white bg-green-700 hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800",
+ "light" => "text-gray-800 bg-gray-100 hover:bg-gray-200 focus:ring-gray-200 dark:text-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-600",
+ _ => "text-white bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",
};
}
diff --git a/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor b/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor
index 9e40bad64..09b4d72aa 100644
--- a/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/Buttons/RefreshButton.razor
@@ -2,7 +2,6 @@
@using System.Timers
<Button OnClick="HandleClick"
- IsDisabled="@IsRefreshing"
Display="flex"
Color="@Color"
AdditionalClasses="@AdditionalClasses">
@@ -29,7 +28,7 @@
/// The color theme of the button.
/// </summary>
[Parameter]
- public string Color { get; set; } = "primary";
+ public string Color { get; set; } = "light";
/// <summary>
/// Additional CSS classes to apply to the button.
diff --git a/apps/server/AliasVault.Admin/Main/Components/ConfirmModal.razor b/apps/server/AliasVault.Admin/Main/Components/ConfirmModal.razor
index 57562be04..ed07ba168 100644
--- a/apps/server/AliasVault.Admin/Main/Components/ConfirmModal.razor
+++ b/apps/server/AliasVault.Admin/Main/Components/ConfirmModal.razor
@@ -4,22 +4,27 @@
@if (ModalService.IsVisible)
{
- <div id="confirm-modal" class="fixed inset-0 z-[1000] bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full flex items-center justify-center">
- <div class="relative p-5 border w-96 shadow-lg rounded-md bg-white">
- <div class="mt-3 text-center">
- <h3 class="text-lg leading-6 font-medium text-gray-900">@ModalService.Title</h3>
- <div class="mt-2 px-7 py-3">
- <p class="text-sm text-gray-500">
- @ConvertNewlinesToHtml(ModalService.Message)
- </p>
- </div>
- <div class="items-center px-4 py-3">
- <button id="confirmButton" class="px-4 py-2 bg-primary-500 text-white text-base font-medium rounded-md w-full shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-300" @onclick="() => ModalService.CloseModal(true)">
- @ModalService.ConfirmButtonText
- </button>
- <button id="cancelButton" class="mt-3 px-4 py-2 bg-gray-300 text-gray-800 text-base font-medium rounded-md w-full shadow-sm hover:bg-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-300" @onclick="() => ModalService.CloseModal(false)">
- @ModalService.CancelButtonText
- </button>
+ <div id="confirm-modal" class="fixed inset-0 z-[1000]">
+ <div class="fixed inset-0 bg-gray-600/50 backdrop-blur-sm dark:bg-black/70"></div>
+ <div class="fixed inset-0 overflow-y-auto">
+ <div class="flex min-h-full items-center justify-center p-4" @onclick="() => ModalService.CloseModal(false)">
+ <div class="relative p-5 w-96 max-w-full rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-600 dark:bg-gray-800 dark:shadow-2xl" @onclick:stopPropagation="true">
+ <div class="mt-3 text-center">
+ <h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white">@ModalService.Title</h3>
+ <div class="mt-2 px-7 py-3">
+ <p class="text-sm text-gray-500 dark:text-gray-300">
+ @ConvertNewlinesToHtml(ModalService.Message)
+ </p>
+ </div>
+ <div class="items-center px-4 py-3">
+ <button id="confirmButton" class="px-4 py-2 bg-primary-500 text-white text-base font-medium rounded-md w-full shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" @onclick="() => ModalService.CloseModal(true)">
+ @ModalService.ConfirmButtonText
+ </button>
+ <button id="cancelButton" class="mt-3 px-4 py-2 bg-gray-300 text-gray-800 text-base font-medium rounded-md w-full shadow-sm hover:bg-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-300 dark:bg-gray-500 dark:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-400" @onclick="() => ModalService.CloseModal(false)">
+ @ModalService.CancelButtonText
+ </button>
+ </div>
+ </div>
</div>
</div>
</div>
diff --git a/apps/server/AliasVault.Admin/Main/Components/CopyField.razor b/apps/server/AliasVault.Admin/Main/Components/CopyField.razor
new file mode 100644
index 000000000..95448a73e
--- /dev/null
+++ b/apps/server/AliasVault.Admin/Main/Components/CopyField.razor
@@ -0,0 +1,65 @@
+@inherits ComponentBase
+@inject IJSRuntime JsRuntime
+@implements IDisposable
+
+<div class="flex w-full">
+ <input type="text" readonly value="@Value" onfocus="this.select()" class="min-w-0 flex-1 rounded-l-lg border border-r-0 border-gray-300 bg-gray-50 p-2.5 font-mono text-sm text-gray-900 focus:border-primary-600 focus:ring-primary-600 dark:border-gray-600 dark:bg-gray-700 dark:text-white">
+ <button type="button" @onclick="CopyAsync" class="inline-flex shrink-0 items-center gap-2 rounded-r-lg border border-primary-600 bg-primary-600 px-4 text-sm font-medium text-white hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-300 dark:hover:bg-primary-700 dark:focus:ring-primary-800">
+ @if (_copied)
+ {
+ <svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
+ </svg>
+ <span>Copied</span>
+ }
+ else
+ {
+ <svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
+ </svg>
+ <span>Copy</span>
+ }
+ </button>
+</div>
+
+@code {
+ private bool _copied;
+ private CancellationTokenSource? _resetCts;
+
+ /// <summary>
+ /// Gets or sets the text that is shown and copied.
+ /// </summary>
+ [Parameter]
+ public string Value { get; set; } = string.Empty;
+
+ /// <inheritdoc/>
+ public void Dispose()
+ {
+ _resetCts?.Cancel();
+ _resetCts?.Dispose();
+ }
+
+ private async Task CopyAsync()
+ {
+ await JsRuntime.InvokeVoidAsync("clipboardCopy.copyText", Value);
+
+ _resetCts?.Cancel();
+ _resetCts?.Dispose();
+ _resetCts = new CancellationTokenSource();
+ var token = _resetCts.Token;
+
+ _copied = true;
+ StateHasChanged();
+
+ try
+ {
+ await Task.Delay(2000, token);
+ _copied = false;
+ StateHasChanged();
+ }
+ catch (TaskCanceledException)
+ {
+ // A newer copy or disposal took over the reset.
+ }
+ }
+}
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor
index 29949dc86..dc9d12b31 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Dashboard/Index.razor
@@ -9,13 +9,13 @@
Title="AliasVault Admin"
Description="Welcome to the AliasVault admin dashboard. Below you can find the most recent activity, status and statistics for this server.">
<CustomActions>
- <a href="all-time-stats" class="inline-flex items-center px-3 py-2 text-sm font-medium text-gray-600 bg-gray-100 border border-gray-300 rounded-md hover:bg-gray-200 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:text-gray-200">
- <svg class="w-4 h-4 sm:mr-2" fill="currentColor" viewBox="0 0 20 20">
+ <RefreshButton OnClick="RefreshData" ButtonText="Refresh" />
+ <a href="all-time-stats" class="@($"inline-flex {ButtonStyles.BaseClasses} {ButtonStyles.GetColorClasses("light")}")">
+ <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
<path d="M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"/>
</svg>
<span class="inline ml-2">All-Time Stats</span>
</a>
- <RefreshButton OnClick="RefreshData" ButtonText="Refresh" />
</CustomActions>
</PageHeader>
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Logging/Auth.razor b/apps/server/AliasVault.Admin/Main/Pages/Logging/Auth.razor
index 217cd935c..5692bece7 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Logging/Auth.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Logging/Auth.razor
@@ -13,8 +13,8 @@
Title="@GetTitle()"
Description="This page shows an overview of recent auth attempts.">
<CustomActions>
- <DeleteButton OnClick="DeleteLogsWithConfirmation" ButtonText="Delete all logs" />
<RefreshButton OnClick="() => RefreshData(CancellationToken.None)" ButtonText="Refresh" />
+ <DeleteButton OnClick="DeleteLogsWithConfirmation" ButtonText="Delete all logs" />
</CustomActions>
</PageHeader>
diff --git a/apps/server/AliasVault.Admin/Main/Pages/Logging/General.razor b/apps/server/AliasVault.Admin/Main/Pages/Logging/General.razor
index 1d8288c09..125a58e2e 100644
--- a/apps/server/AliasVault.Admin/Main/Pages/Logging/General.razor
+++ b/apps/server/AliasVault.Admin/Main/Pages/Logging/General.razor
@@ -9,8 +9,8 @@
Title="@(TotalRecords > 0 ? $"General logs ({TotalRecords:N0})" : "General logs")"
Description="This page shows an overview of recent system logs.">
<CustomActions>
- <DeleteButton OnClick="DeleteLogsWithConfirmation" ButtonText="Delete all logs" />
<RefreshButton OnClick="() => RefreshData(CancellationToken.None)" ButtonText="Refresh" />
+ <DeleteButton OnClick="DeleteLogsWithConfirmation" ButtonText="Delete all logs" />
</CustomActions>
</PageHeader>
diff --git a/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css b/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css
index 43e6e67a7..ac30ef66d 100644
--- a/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css
+++ b/apps/server/AliasVault.Admin/wwwroot/css/tailwind.css
@@ -872,6 +872,10 @@ video {
height: 100%;
}
+.min-h-full {
+ min-height: 100%;
+}
+
.w-1\/2 {
width: 50%;
}
@@ -948,6 +952,10 @@ video {
width: 100%;
}
+.min-w-0 {
+ min-width: 0px;
+}
+
.min-w-max {
min-width: -moz-max-content;
min-width: max-content;
@@ -957,6 +965,10 @@ video {
max-width: 42rem;
}
+.max-w-full {
+ max-width: 100%;
+}
+
.max-w-md {
max-width: 28rem;
}
@@ -969,6 +981,10 @@ video {
max-width: 36rem;
}
+.flex-1 {
+ flex: 1 1 0%;
+}
+
.flex-shrink-0 {
flex-shrink: 0;
}
@@ -1236,6 +1252,10 @@ video {
border-left-width: 4px;
}
+.border-r-0 {
+ border-right-width: 0px;
+}
+
.border-gray-200 {
--tw-border-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-border-opacity));
@@ -1261,6 +1281,11 @@ video {
border-color: rgb(244 149 65 / var(--tw-border-opacity));
}
+.border-primary-600 {
+ --tw-border-opacity: 1;
+ border-color: rgb(214 131 56 / var(--tw-border-opacity));
+}
+
.border-red-200 {
--tw-border-opacity: 1;
border-color: rgb(254 202 202 / var(--tw-border-opacity));
@@ -1321,9 +1346,8 @@ video {
background-color: rgb(107 114 128 / var(--tw-bg-opacity));
}
-.bg-gray-600 {
- --tw-bg-opacity: 1;
- background-color: rgb(75 85 99 / var(--tw-bg-opacity));
+.bg-gray-600\/50 {
+ background-color: rgb(75 85 99 / 0.5);
}
.bg-gray-700 {
@@ -1850,10 +1874,22 @@ video {
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
+.shadow-xl {
+ --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
+ --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
+}
+
.filter {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
+.backdrop-blur-sm {
+ --tw-backdrop-blur: blur(4px);
+ -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
+ backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
+}
+
.transition {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
@@ -2040,11 +2076,6 @@ video {
--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
}
-.focus\:ring-gray-500:focus {
- --tw-ring-opacity: 1;
- --tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity));
-}
-
.focus\:ring-green-300:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(134 239 172 / var(--tw-ring-opacity));
@@ -2136,6 +2167,10 @@ video {
border-color: rgb(234 179 8 / var(--tw-border-opacity));
}
+.dark\:bg-black\/70:is(.dark *) {
+ background-color: rgb(0 0 0 / 0.7);
+}
+
.dark\:bg-blue-800:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgb(30 64 175 / var(--tw-bg-opacity));
@@ -2154,6 +2189,11 @@ video {
background-color: rgb(30 58 138 / 0.3);
}
+.dark\:bg-gray-500:is(.dark *) {
+ --tw-bg-opacity: 1;
+ background-color: rgb(107 114 128 / var(--tw-bg-opacity));
+}
+
.dark\:bg-gray-600:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
@@ -2358,6 +2398,12 @@ video {
color: rgb(156 163 175 / var(--tw-placeholder-opacity));
}
+.dark\:shadow-2xl:is(.dark *) {
+ --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
+ --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
+}
+
.dark\:ring-offset-gray-800:is(.dark *) {
--tw-ring-offset-color: #1f2937;
}
@@ -2404,11 +2450,6 @@ video {
color: rgb(96 165 250 / var(--tw-text-opacity));
}
-.dark\:hover\:text-gray-200:hover:is(.dark *) {
- --tw-text-opacity: 1;
- color: rgb(229 231 235 / var(--tw-text-opacity));
-}
-
.dark\:hover\:text-gray-300:hover:is(.dark *) {
--tw-text-opacity: 1;
color: rgb(209 213 219 / var(--tw-text-opacity));
@@ -2444,6 +2485,11 @@ video {
--tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity));
}
+.dark\:focus\:ring-gray-400:focus:is(.dark *) {
+ --tw-ring-opacity: 1;
+ --tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity));
+}
+
.dark\:focus\:ring-gray-600:focus:is(.dark *) {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity));
@@ -2489,10 +2535,6 @@ video {
margin-bottom: 1.25rem;
}
- .sm\:mr-2 {
- margin-right: 0.5rem;
- }
-
.sm\:flex {
display: flex;
}