Skip to content

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

Add StatusWorker control to admin project (#113)

Leendert de Borstf51dd0b0cbd1
diff --git a/src/AliasVault.Admin/Main/Components/Refresh/RefreshButton.razor b/src/AliasVault.Admin/Main/Components/Refresh/RefreshButton.razor
new file mode 100644
index 000000000..9ce054a63
--- /dev/null
+++ b/src/AliasVault.Admin/Main/Components/Refresh/RefreshButton.razor
@@ -0,0 +1,52 @@
+@using System.Timers
+
+<button @onclick="HandleClick"
+ disabled="@IsRefreshing"
+ class="@GetButtonClasses()">
+ <svg class="@GetIconClasses()" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
+ </svg>
+ <span class="ml-2">@ButtonText</span>
+</button>
+
+@code {
+ /// <summary>
+ /// The event to call in the parent when the button is clicked.
+ /// </summary>
+ [Parameter] public EventCallback OnRefresh { get; set; }
+
+ /// <summary>
+ /// The text to display on the button.
+ /// </summary>
+ [Parameter] public string ButtonText { get; set; } = "Refresh";
+
+ private bool IsRefreshing;
+ private Timer Timer = new();
+
+ private async Task HandleClick()
+ {
+ if (IsRefreshing) return;
+
+ IsRefreshing = true;
+ await OnRefresh.InvokeAsync();
+
+ Timer = new Timer(500);
+ Timer.Elapsed += (sender, args) =>
+ {
+ IsRefreshing = false;
+ Timer.Dispose();
+ InvokeAsync(StateHasChanged);
+ };
+ Timer.Start();
+ }
+
+ private string GetButtonClasses()
+ {
+ return $"flex items-center px-3 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-4 focus:ring-primary-300 dark:focus:ring-primary-800 {(IsRefreshing ? "bg-gray-400 cursor-not-allowed" : "bg-primary-700 hover:bg-primary-800 dark:bg-primary-600 dark:hover:bg-primary-700")}";
+ }
+
+ private string GetIconClasses()
+ {
+ return $"w-4 h-4 {(IsRefreshing ? "animate-spin" : "")}";
+ }
+}
diff --git a/src/AliasVault.Admin/Main/Components/WorkerStatus/Services.razor b/src/AliasVault.Admin/Main/Components/WorkerStatus/Services.razor
new file mode 100644
index 000000000..8df63b48d
--- /dev/null
+++ b/src/AliasVault.Admin/Main/Components/WorkerStatus/Services.razor
@@ -0,0 +1,137 @@
+@using AliasVault.WorkerStatus.Database
+@inherits MainBase
+
+<button @onclick="SmtpClick"
+ class="@GetSmtpButtonClasses() inline-flex items-center justify-center rounded-xl px-8 py-2 text-white">
+ <span>SmtpService</span>
+ @if (smtpPending)
+ {
+ <svg class="animate-spin ml-2 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
+ <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
+ <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
+ </svg>
+ }
+</button>
+
+
+@code {
+ private List<WorkerServiceStatus> serviceStatus = [];
+ private DateTime lastRefresh = DateTime.Now;
+ private bool initInProgress;
+ private bool firstInitPageDone;
+
+ private bool smtpStatus;
+ private bool smtpPending;
+ å
+ private string GetSmtpButtonClasses()
+ {
+ return $"cursor-pointer {(smtpPending || !firstInitPageDone ? "bg-gray-600" : (smtpStatus ? "bg-green-600" : "bg-red-600"))}";
+ }
+
+ private async void SmtpClick()
+ {
+ smtpPending = true;
+ StateHasChanged();
+
+ smtpStatus = !smtpStatus;
+ await UpdateSmtpStatus(smtpStatus);
+
+ smtpPending = false;
+ StateHasChanged();
+ }
+
+ private async Task InitPage()
+ {
+ if (initInProgress)
+ {
+ return;
+ }
+
+ if (!smtpPending)
+ {
+ initInProgress = true;
+
+ //Console.WriteLine("Init services now: " + DateTime.Now);
+ serviceStatus = await GetServiceStatuses();
+ // Service status checks if the status is "Started" and was lastAlive
+ // (so actually reported itself) in the last 5 minutes..
+ var smtpEntry = serviceStatus.Where(x => x.ServiceName == "AliasVault.SmtpService").First();
+ smtpStatus = (DateTime.Now <= smtpEntry.Heartbeat.AddMinutes(5) && smtpEntry.CurrentStatus == "Started");
+
+ lastRefresh = DateTime.Now;
+ initInProgress = false;
+ firstInitPageDone = true;
+
+ await InvokeAsync(() => StateHasChanged());
+ }
+ else
+ {
+ // Service status changing in progress, don't issue parallel requests..
+ }
+ }
+
+ /// <inheritdoc />
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if (firstRender)
+ {
+ await InitPage();
+ }
+ }
+
+ /// <summary>
+ /// Gets the service statuses.
+ /// </summary>
+ public async Task<List<WorkerServiceStatus>> GetServiceStatuses()
+ {
+ return await DbContext.WorkerServiceStatuses.ToListAsync();
+ }
+
+ /// <summary>
+ /// Update the service statuses.
+ /// </summary>
+ public async Task<bool> UpdateServiceStatus(string serviceName, bool newStatus)
+ {
+ string translateStatus = "";
+ switch (newStatus)
+ {
+ case true:
+ translateStatus = "Started";
+ break;
+ case false:
+ translateStatus = "Stopped";
+ break;
+ }
+
+ var entry = await DbContext.WorkerServiceStatuses.Where(x => x.ServiceName == serviceName).FirstOrDefaultAsync();
+ if (entry != null)
+ {
+ entry.DesiredStatus = translateStatus;
+ await DbContext.SaveChangesAsync();
+
+ // Wait for service to have stopped with ACK
+ // @TODO: add timeout method?
+ while (true)
+ {
+ var newdbContext = await DbContextFactory.CreateDbContextAsync();
+ var check = await newdbContext.WorkerServiceStatuses.Where(x => x.ServiceName == serviceName).FirstAsync();
+ if (check.CurrentStatus == translateStatus)
+ {
+ // Done
+ return true;
+ }
+ await Task.Delay(1000);
+ }
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Update the SMTP service status.
+ /// </summary>
+ public async Task<bool> UpdateSmtpStatus(bool newStatus)
+ {
+ return await UpdateServiceStatus("AliasVault.SmtpService", newStatus);
+ }
+}
diff --git a/src/AliasVault.Admin/Main/Layout/TopMenu.razor b/src/AliasVault.Admin/Main/Layout/TopMenu.razor
index 25a4d81b1..c0aa0e5bc 100644
--- a/src/AliasVault.Admin/Main/Layout/TopMenu.razor
+++ b/src/AliasVault.Admin/Main/Layout/TopMenu.razor
@@ -23,6 +23,7 @@
</div>
</div>
<div class="flex justify-end items-center lg:order-2">
+ <Services />
<button id="theme-toggle" data-tooltip-target="tooltip-toggle" type="button" class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5">
<svg id="theme-toggle-dark-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path></svg>
<svg id="theme-toggle-light-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z" fill-rule="evenodd" clip-rule="evenodd"></path></svg>
diff --git a/src/AliasVault.Admin/Main/Pages/Emails.razor b/src/AliasVault.Admin/Main/Pages/Emails.razor
index 873bfb97a..be3f0f62e 100644
--- a/src/AliasVault.Admin/Main/Pages/Emails.razor
+++ b/src/AliasVault.Admin/Main/Pages/Emails.razor
@@ -9,6 +9,7 @@
<Breadcrumb BreadcrumbItems="BreadcrumbItems" />
<div class="flex items-center justify-between">
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl dark:text-white">Emails</h1>
+ <RefreshButton OnRefresh="RefreshData" ButtonText="Refresh" />
</div>
<p>This page gives an overview of recently received mails by this AliasVault server.</p>
</div>
diff --git a/src/AliasVault.Admin/Main/Pages/Logs.razor b/src/AliasVault.Admin/Main/Pages/Logs.razor
index c9809c055..4d0ec7ee7 100644
--- a/src/AliasVault.Admin/Main/Pages/Logs.razor
+++ b/src/AliasVault.Admin/Main/Pages/Logs.razor
@@ -8,6 +8,7 @@
<Breadcrumb BreadcrumbItems="BreadcrumbItems" />
<div class="flex items-center justify-between">
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl dark:text-white">Logs</h1>
+ <RefreshButton OnRefresh="RefreshData" ButtonText="Refresh" />
</div>
<p>This page gives an overview of recent system logs.</p>
</div>
diff --git a/src/AliasVault.Admin/Main/Pages/MainBase.cs b/src/AliasVault.Admin/Main/Pages/MainBase.cs
index cb6fe7dcb..d6a005056 100644
--- a/src/AliasVault.Admin/Main/Pages/MainBase.cs
+++ b/src/AliasVault.Admin/Main/Pages/MainBase.cs
@@ -12,6 +12,7 @@ using AliasVault.Admin.Main.Models;
using AliasVault.Admin.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
+using Microsoft.EntityFrameworkCore;
using Microsoft.JSInterop;
/// <summary>
@@ -52,6 +53,12 @@ public class MainBase : OwningComponentBase
[Inject]
protected AliasServerDbContext DbContext { get; set; } = null!;
+ /// <summary>
+ /// Gets or sets the AliasServerDbContextFactory instance.
+ /// </summary>
+ [Inject]
+ protected IDbContextFactory<AliasServerDbContext> DbContextFactory { get; set; } = null!;
+
/// <summary>
/// Gets or sets the injected JSRuntime instance.
/// </summary>
diff --git a/src/AliasVault.Admin/Main/_Imports.razor b/src/AliasVault.Admin/Main/_Imports.razor
index e8112844d..ee624b2c7 100644
--- a/src/AliasVault.Admin/Main/_Imports.razor
+++ b/src/AliasVault.Admin/Main/_Imports.razor
@@ -15,6 +15,8 @@
@using AliasVault.Admin.Main.Components
@using AliasVault.Admin.Main.Components.Alerts
@using AliasVault.Admin.Main.Components.Layout
+@using AliasVault.Admin.Main.Components.WorkerStatus
+@using AliasVault.Admin.Main.Components.Refresh
@using AliasVault.Admin.Main.Models
@using AliasVault.Admin.Main.Pages
@using AliasVault.Admin.Services
diff --git a/src/AliasVault.Admin/wwwroot/css/tailwind.css b/src/AliasVault.Admin/wwwroot/css/tailwind.css
index 85d8ec7e0..f29ae592c 100644
--- a/src/AliasVault.Admin/wwwroot/css/tailwind.css
+++ b/src/AliasVault.Admin/wwwroot/css/tailwind.css
@@ -620,6 +620,10 @@ video {
position: relative;
}
+.inset-0 {
+ inset: 0px;
+}
+
.right-0 {
right: 0px;
}
@@ -735,14 +739,6 @@ video {
margin-top: 2rem;
}
-.mr-12 {
- margin-right: 3rem;
-}
-
-.mt-2 {
- margin-top: 0.5rem;
-}
-
.line-clamp-1 {
overflow: hidden;
display: -webkit-box;
@@ -806,18 +802,6 @@ video {
height: 100%;
}
-.h-10 {
- height: 2.5rem;
-}
-
-.h-2 {
- height: 0.5rem;
-}
-
-.h-2\.5 {
- height: 0.625rem;
-}
-
.w-1\/2 {
width: 50%;
}
@@ -850,22 +834,6 @@ video {
width: 100%;
}
-.w-10 {
- width: 2.5rem;
-}
-
-.w-2 {
- width: 0.5rem;
-}
-
-.w-2\.5 {
- width: 0.625rem;
-}
-
-.min-w-full {
- min-width: 100%;
-}
-
.max-w-2xl {
max-width: 42rem;
}
@@ -882,26 +850,32 @@ video {
max-width: 36rem;
}
-.max-w-sm {
- max-width: 24rem;
-}
-
.flex-shrink-0 {
flex-shrink: 0;
}
-.table-fixed {
- table-layout: fixed;
-}
-
.transform {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
+@keyframes spin {
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+.animate-spin {
+ animation: spin 1s linear infinite;
+}
+
.cursor-not-allowed {
cursor: not-allowed;
}
+.cursor-pointer {
+ cursor: pointer;
+}
+
.list-decimal {
list-style-type: decimal;
}
@@ -960,6 +934,12 @@ video {
margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse)));
}
+.space-x-2 > :not([hidden]) ~ :not([hidden]) {
+ --tw-space-x-reverse: 0;
+ margin-right: calc(0.5rem * var(--tw-space-x-reverse));
+ margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
+}
+
.space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1rem * var(--tw-space-x-reverse));
@@ -996,12 +976,6 @@ video {
margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));
}
-.space-x-2 > :not([hidden]) ~ :not([hidden]) {
- --tw-space-x-reverse: 0;
- margin-right: calc(0.5rem * var(--tw-space-x-reverse));
- margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
-}
-
.divide-y > :not([hidden]) ~ :not([hidden]) {
--tw-divide-y-reverse: 0;
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
@@ -1013,11 +987,6 @@ video {
border-color: rgb(243 244 246 / var(--tw-divide-opacity));
}
-.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
- --tw-divide-opacity: 1;
- border-color: rgb(229 231 235 / var(--tw-divide-opacity));
-}
-
.self-center {
align-self: center;
}
@@ -1034,12 +1003,6 @@ video {
overflow-y: auto;
}
-.truncate {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
.whitespace-nowrap {
white-space: nowrap;
}
@@ -1104,6 +1067,11 @@ video {
border-color: rgb(209 213 219 / var(--tw-border-opacity));
}
+.border-primary-300 {
+ --tw-border-opacity: 1;
+ border-color: rgb(248 185 99 / var(--tw-border-opacity));
+}
+
.border-primary-500 {
--tw-border-opacity: 1;
border-color: rgb(244 149 65 / var(--tw-border-opacity));
@@ -1119,9 +1087,9 @@ video {
border-color: rgb(234 179 8 / var(--tw-border-opacity));
}
-.border-primary-300 {
- --tw-border-opacity: 1;
- border-color: rgb(248 185 99 / var(--tw-border-opacity));
+.bg-blue-500 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(59 130 246 / var(--tw-bg-opacity));
}
.bg-gray-100 {
@@ -1139,6 +1107,11 @@ video {
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
+.bg-gray-500 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(107 114 128 / var(--tw-bg-opacity));
+}
+
.bg-gray-800 {
--tw-bg-opacity: 1;
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
@@ -1154,6 +1127,11 @@ video {
background-color: rgb(240 253 244 / var(--tw-bg-opacity));
}
+.bg-green-500 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(34 197 94 / var(--tw-bg-opacity));
+}
+
.bg-primary-100 {
--tw-bg-opacity: 1;
background-color: rgb(253 222 133 / var(--tw-bg-opacity));
@@ -1184,6 +1162,11 @@ video {
background-color: rgb(254 242 242 / var(--tw-bg-opacity));
}
+.bg-red-500 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(239 68 68 / var(--tw-bg-opacity));
+}
+
.bg-red-600 {
--tw-bg-opacity: 1;
background-color: rgb(220 38 38 / var(--tw-bg-opacity));
@@ -1199,39 +1182,29 @@ video {
background-color: rgb(254 249 195 / var(--tw-bg-opacity));
}
-.bg-blue-500 {
- --tw-bg-opacity: 1;
- background-color: rgb(59 130 246 / var(--tw-bg-opacity));
-}
-
-.bg-blue-700 {
- --tw-bg-opacity: 1;
- background-color: rgb(29 78 216 / var(--tw-bg-opacity));
-}
-
-.bg-green-400 {
+.bg-yellow-500 {
--tw-bg-opacity: 1;
- background-color: rgb(74 222 128 / var(--tw-bg-opacity));
+ background-color: rgb(234 179 8 / var(--tw-bg-opacity));
}
-.bg-gray-500 {
+.bg-gray-600 {
--tw-bg-opacity: 1;
- background-color: rgb(107 114 128 / var(--tw-bg-opacity));
+ background-color: rgb(75 85 99 / var(--tw-bg-opacity));
}
-.bg-green-500 {
+.bg-green-600 {
--tw-bg-opacity: 1;
- background-color: rgb(34 197 94 / var(--tw-bg-opacity));
+ background-color: rgb(22 163 74 / var(--tw-bg-opacity));
}
-.bg-red-500 {
+.bg-blue-700 {
--tw-bg-opacity: 1;
- background-color: rgb(239 68 68 / var(--tw-bg-opacity));
+ background-color: rgb(29 78 216 / var(--tw-bg-opacity));
}
-.bg-yellow-500 {
+.bg-gray-400 {
--tw-bg-opacity: 1;
- background-color: rgb(234 179 8 / var(--tw-bg-opacity));
+ background-color: rgb(156 163 175 / var(--tw-bg-opacity));
}
.bg-opacity-50 {
@@ -1314,6 +1287,11 @@ video {
padding-bottom: 2rem;
}
+.px-8 {
+ padding-left: 2rem;
+ padding-right: 2rem;
+}
+
.ps-2 {
padding-inline-start: 0.5rem;
}
@@ -1487,6 +1465,14 @@ video {
opacity: 0.5;
}
+.opacity-25 {
+ opacity: 0.25;
+}
+
+.opacity-75 {
+ opacity: 0.75;
+}
+
.shadow {
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
@@ -1511,22 +1497,22 @@ video {
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
-.transition-colors {
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
+.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;
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
-.transition-opacity {
- transition-property: opacity;
+.transition-colors {
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
-.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;
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
+.transition-opacity {
+ transition-property: opacity;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
@@ -1549,6 +1535,11 @@ video {
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
+.hover\:bg-primary-200:hover {
+ --tw-bg-opacity: 1;
+ background-color: rgb(251 203 116 / var(--tw-bg-opacity));
+}
+
.hover\:bg-primary-700:hover {
--tw-bg-opacity: 1;
background-color: rgb(184 112 47 / var(--tw-bg-opacity));
@@ -1559,19 +1550,9 @@ video {
background-color: rgb(154 93 38 / var(--tw-bg-opacity));
}
-.hover\:bg-blue-600:hover {
- --tw-bg-opacity: 1;
- background-color: rgb(37 99 235 / var(--tw-bg-opacity));
-}
-
-.hover\:bg-primary-200:hover {
- --tw-bg-opacity: 1;
- background-color: rgb(251 203 116 / var(--tw-bg-opacity));
-}
-
-.hover\:bg-red-800:hover {
+.hover\:bg-blue-800:hover {
--tw-bg-opacity: 1;
- background-color: rgb(153 27 27 / var(--tw-bg-opacity));
+ background-color: rgb(30 64 175 / var(--tw-bg-opacity));
}
.hover\:text-gray-900:hover {
@@ -1625,6 +1606,11 @@ video {
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
+.focus\:ring-blue-500:focus {
+ --tw-ring-opacity: 1;
+ --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
+}
+
.focus\:ring-gray-200:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity));
@@ -1650,14 +1636,9 @@ video {
--tw-ring-color: rgb(214 131 56 / var(--tw-ring-opacity));
}
-.focus\:ring-red-300:focus {
+.focus\:ring-blue-300:focus {
--tw-ring-opacity: 1;
- --tw-ring-color: rgb(252 165 165 / var(--tw-ring-opacity));
-}
-
-.focus\:ring-blue-500:focus {
- --tw-ring-opacity: 1;
- --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
+ --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity));
}
.focus\:ring-offset-2:focus {
@@ -1669,11 +1650,6 @@ video {
border-color: rgb(75 85 99 / var(--tw-divide-opacity));
}
-.dark\:divide-gray-700:is(.dark *) > :not([hidden]) ~ :not([hidden]) {
- --tw-divide-opacity: 1;
- border-color: rgb(55 65 81 / var(--tw-divide-opacity));
-}
-
.dark\:border-gray-500:is(.dark *) {
--tw-border-opacity: 1;
border-color: rgb(107 114 128 / var(--tw-border-opacity));
@@ -1729,6 +1705,11 @@ video {
background-color: rgb(113 63 18 / var(--tw-bg-opacity));
}
+.dark\:bg-blue-600:is(.dark *) {
+ --tw-bg-opacity: 1;
+ background-color: rgb(37 99 235 / var(--tw-bg-opacity));
+}
+
.dark\:bg-opacity-80:is(.dark *) {
--tw-bg-opacity: 0.8;
}
@@ -1837,6 +1818,11 @@ video {
background-color: rgb(184 112 47 / var(--tw-bg-opacity));
}
+.dark\:hover\:bg-blue-700:hover:is(.dark *) {
+ --tw-bg-opacity: 1;
+ background-color: rgb(29 78 216 / var(--tw-bg-opacity));
+}
+
.dark\:hover\:text-primary-500:hover:is(.dark *) {
--tw-text-opacity: 1;
color: rgb(244 149 65 / var(--tw-text-opacity));
@@ -1887,9 +1873,9 @@ video {
--tw-ring-color: rgb(154 93 38 / var(--tw-ring-opacity));
}
-.dark\:focus\:ring-red-900:focus:is(.dark *) {
+.dark\:focus\:ring-blue-800:focus:is(.dark *) {
--tw-ring-opacity: 1;
- --tw-ring-color: rgb(127 29 29 / var(--tw-ring-opacity));
+ --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity));
}
@media (min-width: 640px) {
@@ -1917,10 +1903,6 @@ video {
margin-bottom: calc(0px * var(--tw-space-y-reverse));
}
- .sm\:rounded-lg {
- border-radius: 0.5rem;
- }
-
.sm\:p-8 {
padding: 2rem;
}
@@ -2050,10 +2032,6 @@ video {
margin-bottom: 0.5rem;
}
- .xl\:max-w-xs {
- max-width: 20rem;
- }
-
.xl\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
diff --git a/src/Services/AliasVault.SmtpService/Program.cs b/src/Services/AliasVault.SmtpService/Program.cs
index 81fccb8ce..d43270646 100644
--- a/src/Services/AliasVault.SmtpService/Program.cs
+++ b/src/Services/AliasVault.SmtpService/Program.cs
@@ -17,7 +17,6 @@ using SmtpServer;
using SmtpServer.Storage;
using AliasVault.Logging;
using AliasVault.SmtpService.Workers;
-using AliasVault.WorkerStatus.Database;
using AliasVault.WorkerStatus.ServiceExtensions;
var builder = Host.CreateApplicationBuilder(args);
@@ -127,9 +126,6 @@ builder.Services.AddSingleton(
// -----------------------------------------------------------------------
builder.Services.AddStatusHostedService<SmtpServerWorker, AliasServerDbContext>(Assembly.GetExecutingAssembly().GetName().Name!);
// -----------------------------------------------------------------------
-// vs:
-// builder.Services.AddHostedService<SmtpServerWorker>();
-
var host = builder.Build();
diff --git a/src/Utilities/AliasVault.WorkerStatus/ServiceExtensions/StatusHostedService.cs b/src/Utilities/AliasVault.WorkerStatus/ServiceExtensions/StatusHostedService.cs
index e39caacf8..cb2a6f9e9 100644
--- a/src/Utilities/AliasVault.WorkerStatus/ServiceExtensions/StatusHostedService.cs
+++ b/src/Utilities/AliasVault.WorkerStatus/ServiceExtensions/StatusHostedService.cs
@@ -17,11 +17,6 @@ using Microsoft.Extensions.Logging;
public class StatusHostedService<T>(ILogger<StatusHostedService<T>> logger, GlobalServiceStatus globalServiceStatus, T innerService) : BackgroundService
where T : IHostedService
{
- /// <summary>
- /// Lock object to prevent multiple tasks from starting the worker at the same time.
- /// </summary>
- private readonly object _taskLock = new();
-
/// <summary>
/// A minimum delay that is used to wait before restarting the worker after a fault in the innerService.
/// This delay is increased exponentially with a maximum delay of <see cref="_restartMaxDelayInMs"/>.
@@ -33,6 +28,11 @@ public class StatusHostedService<T>(ILogger<StatusHostedService<T>> logger, Glob
/// </summary>
private const int _restartMaxDelayInMs = 300000;
+ /// <summary>
+ /// Lock object to prevent multiple tasks from starting the worker at the same time.
+ /// </summary>
+ private readonly object _taskLock = new();
+
/// <summary>
/// Current delay before restarting the worker.
/// </summary>