Skip to content

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

Implement WASM alias view page

Leendert de Borst031844f4c95b
diff --git a/src/AliasVault.Api/Controllers/AliasController.cs b/src/AliasVault.Api/Controllers/AliasController.cs
index c16fa321e..e6b99883f 100644
--- a/src/AliasVault.Api/Controllers/AliasController.cs
+++ b/src/AliasVault.Api/Controllers/AliasController.cs
@@ -45,7 +45,7 @@ public class AliasController : AuthenticatedRequestController
}
}
- [HttpGet("alias/{aliasId}")]
+ [HttpGet("{aliasId}")]
public async Task<IActionResult> GetAlias(Guid aliasId)
{
var user = await GetCurrentUserAsync();
@@ -74,8 +74,11 @@ public class AliasController : AuthenticatedRequestController
},
Identity = new Identity()
{
+ NickName = x.Identity.NickName,
FirstName = x.Identity.FirstName,
LastName = x.Identity.LastName,
+ BirthDate = x.Identity.BirthDate,
+ AddressStreet = x.Identity.AddressStreet,
AddressCity = x.Identity.AddressCity,
AddressState = x.Identity.AddressState,
AddressZipCode = x.Identity.AddressZipCode,
@@ -89,7 +92,7 @@ public class AliasController : AuthenticatedRequestController
},
Password = new AliasVault.Shared.Models.WebApi.Password()
{
- Value = x.Passwords.First().Value,
+ Value = x.Passwords.First().Value ?? "",
Description = "",
CreatedAt = x.Passwords.First().CreatedAt,
UpdatedAt = x.Passwords.First().UpdatedAt
diff --git a/src/AliasVault.WebApp/Components/Alias/Alias.razor b/src/AliasVault.WebApp/Components/Alias/Alias.razor
index bce8743fb..ba0d336fc 100644
--- a/src/AliasVault.WebApp/Components/Alias/Alias.razor
+++ b/src/AliasVault.WebApp/Components/Alias/Alias.razor
@@ -17,7 +17,7 @@
private void ShowDetails()
{
// Redirect to view page instead for now.
- NavigationManager.NavigateTo($"/alias/{Guid.NewGuid()}");
+ NavigationManager.NavigateTo($"/alias/{Obj.Id}");
//showModal = true;
}
diff --git a/src/AliasVault.WebApp/Components/CopyPasteFormRow.razor b/src/AliasVault.WebApp/Components/CopyPasteFormRow.razor
new file mode 100644
index 000000000..324a36ade
--- /dev/null
+++ b/src/AliasVault.WebApp/Components/CopyPasteFormRow.razor
@@ -0,0 +1,30 @@
+@inject IJSRuntime JSRuntime
+
+<label for="last-name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">@Label</label>
+<input type="text" name="last-name" id="last-name" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" value="@Value" onclick="@CopyToClipboard" required="">
+@if (_copied)
+{
+ <div class="text-sm text-green-500 dark:text-green-400">Copied!</div>
+}
+@code {
+ [Parameter]
+ public string Label { get; set; }
+ [Parameter]
+ public string Value { get; set; }
+
+ private bool _copied = false;
+
+ public async Task CopyToClipboard()
+ {
+ await JSRuntime.InvokeVoidAsync("window.clipboardCopy.copyText", Value);
+ _copied = true;
+
+ StateHasChanged();
+
+ // After 2 seconds, remove the success class again
+ await Task.Delay(2000);
+ _copied = false;
+
+ StateHasChanged();
+ }
+}
diff --git a/src/AliasVault.WebApp/Pages/Aliases/View.razor b/src/AliasVault.WebApp/Pages/Aliases/View.razor
index 9ae00c0e4..cda263275 100644
--- a/src/AliasVault.WebApp/Pages/Aliases/View.razor
+++ b/src/AliasVault.WebApp/Pages/Aliases/View.razor
@@ -1,125 +1,145 @@
@page "/alias/{id:guid}"
+@using AliasVault.Shared.Models.WebApi
+@using AliasVault.WebApp.Services
+@inject AliasService AliasService
@inherits PageBase
<LayoutPageTitle>View alias</LayoutPageTitle>
-<div class="grid grid-cols-2 px-4 pt-6 md:grid-cols-3 lg:gap-4 dark:bg-gray-900">
- <div class="mb-4 col-span-full xl:mb-2">
- <Breadcrumb BreadcrumbItems="BreadcrumbItems" />
- <h1 class="text-xl font-semibold text-gray-900 sm:text-2xl dark:text-white">User settings</h1>
- </div>
- <!-- Right Content -->
- <div class="col-span-full lg:col-auto">
- <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
- <div class="items-center sm:flex xl:block 2xl:flex sm:space-x-4 xl:space-x-0 2xl:space-x-4">
- <img class="mb-4 rounded-lg w-28 h-28 sm:mb-0 xl:mb-4 2xl:mb-0" src="/img/service-placeholder.webp" alt="Service logo">
- <div>
- <h3 class="mb-1 text-xl font-bold text-gray-900 dark:text-white">Service name</h3>
- </div>
- </div>
- </div>
- <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
- <h3 class="mb-4 text-xl font-semibold dark:text-white">Email</h3>
- <div class="mb-4">
- No recent emails.
- </div>
+
+@if (IsLoading || Alias == null)
+{
+<LoadingIndicator />
+}
+else
+{
+ <div class="grid grid-cols-2 px-4 pt-6 md:grid-cols-3 lg:gap-4 dark:bg-gray-900">
+ <div class="mb-4 col-span-full xl:mb-2">
+ <Breadcrumb BreadcrumbItems="BreadcrumbItems"/>
+ <h1 class="text-xl font-semibold text-gray-900 sm:text-2xl dark:text-white">User settings</h1>
</div>
- </div>
- <div class="col-span-2">
- <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
- <h3 class="mb-4 text-xl font-semibold dark:text-white">Login credentials</h3>
- <form action="#">
- <div class="grid gap-6">
- <div class="col-span-6 sm:col-span-3">
- <label for="current-password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Email</label>
- <input type="text" name="current-password" id="current-password" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" required="">
- </div>
- <div class="col-span-6 sm:col-span-3">
- <label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Username</label>
- <input data-popover-target="popover-password" data-popover-placement="bottom" type="text" id="password" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required="">
- </div>
- <div class="col-span-6 sm:col-span-3">
- <label for="confirm-password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Password</label>
- <input type="text" name="confirm-password" id="confirm-password" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" required="">
+ <!-- Right Content -->
+ <div class="col-span-full lg:col-auto">
+ <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
+ <div class="items-center sm:flex xl:block 2xl:flex sm:space-x-4 xl:space-x-0 2xl:space-x-4">
+ <img class="mb-4 rounded-lg w-28 h-28 sm:mb-0 xl:mb-4 2xl:mb-0" src="/img/service-placeholder.webp" alt="Service logo">
+ <div>
+ <h3 class="mb-1 text-xl font-bold text-gray-900 dark:text-white">Service name</h3>
</div>
</div>
- </form>
- </div>
-
- <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
- <h3 class="mb-4 text-xl font-semibold dark:text-white">Name</h3>
- <form action="#">
- <div class="grid grid-cols-6 gap-6">
- <div class="col-span-6 sm:col-span-3">
- <label for="first-name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Initials</label>
- <input type="text" name="first-name" id="first-name" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="Bonnie" required="">
- </div>
- <div class="col-span-6 sm:col-span-3">
- <label for="last-name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">First name</label>
- <input type="text" name="last-name" id="last-name" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="Green" required="">
- </div>
- <div class="col-span-6 sm:col-span-3">
- <label for="country" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Last name</label>
- <input type="text" name="country" id="country" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="United States" required="">
- </div>
- <div class="col-span-6 sm:col-span-3">
- <label for="city" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Birthdate</label>
- <input type="text" name="city" id="city" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="e.g. San Francisco" required="">
- </div>
+ </div>
+ <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
+ <h3 class="mb-4 text-xl font-semibold dark:text-white">Email</h3>
+ <div class="mb-4">
+ No recent emails.
</div>
- </form>
+ </div>
</div>
-
- <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
- <h3 class="mb-4 text-xl font-semibold dark:text-white">Contact</h3>
- <form action="#">
- <div class="grid grid-cols-6 gap-6">
- <div class="col-span-6 sm:col-span-3">
- <label for="first-name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Phone</label>
- <input type="text" name="first-name" id="first-name" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="Bonnie" required="">
+ <div class="col-span-2">
+ <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
+ <h3 class="mb-4 text-xl font-semibold dark:text-white">Login credentials</h3>
+ <form action="#">
+ <div class="grid gap-6">
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Email" Value="@AliasEmail"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Username" Value="@(Alias.Identity.NickName)"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Password" Value="@(Alias.Password.Value)"></CopyPasteFormRow>
+ </div>
</div>
- <div class="col-span-6 sm:col-span-3">
- <label for="last-name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">IBAN</label>
- <input type="text" name="last-name" id="last-name" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="Green" required="">
+ </form>
+ </div>
+ <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
+ <h3 class="mb-4 text-xl font-semibold dark:text-white">Name</h3>
+ <form action="#">
+ <div class="grid grid-cols-6 gap-6">
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Initials" Value="@(Alias.Identity.FirstName.Substring(0,1))"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="First name" Value="@(Alias.Identity.FirstName)"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Last name" Value="@(Alias.Identity.LastName)"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Birthdate" Value="@(Alias.Identity.BirthDate.ToShortDateString())"></CopyPasteFormRow>
+ </div>
</div>
- </div>
- </form>
- </div>
+ </form>
+ </div>
- <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
- <h3 class="mb-4 text-xl font-semibold dark:text-white">Address</h3>
- <form action="#">
- <div class="grid grid-cols-6 gap-6">
- <div class="col-span-6 sm:col-span-3">
- <label for="first-name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Street</label>
- <input type="text" name="first-name" id="first-name" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="Bonnie" required="">
- </div>
- <div class="col-span-6 sm:col-span-3">
- <label for="last-name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Postal code</label>
- <input type="text" name="last-name" id="last-name" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="Green" required="">
- </div>
- <div class="col-span-6 sm:col-span-3">
- <label for="country" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">City</label>
- <input type="text" name="country" id="country" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="United States" required="">
+ <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
+ <h3 class="mb-4 text-xl font-semibold dark:text-white">Contact</h3>
+ <form action="#">
+ <div class="grid grid-cols-6 gap-6">
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Phone" Value="@(Alias.Identity.PhoneMobile)"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="IBAN" Value="@(Alias.Identity.BankAccountIBAN)"></CopyPasteFormRow>
+ </div>
</div>
- <div class="col-span-6 sm:col-span-3">
- <label for="city" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Country</label>
- <input type="text" name="city" id="city" class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500" placeholder="e.g. San Francisco" required="">
+ </form>
+ </div>
+
+ <div class="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
+ <h3 class="mb-4 text-xl font-semibold dark:text-white">Address</h3>
+ <form action="#">
+ <div class="grid grid-cols-6 gap-6">
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Street" Value="@(Alias.Identity.AddressStreet)"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Postal code" Value="@(Alias.Identity.AddressZipCode)"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="City" Value="@(Alias.Identity.AddressCity)"></CopyPasteFormRow>
+ </div>
+ <div class="col-span-6 sm:col-span-3">
+ <CopyPasteFormRow Label="Country" Value="@(Alias.Identity.AddressCountry)"></CopyPasteFormRow>
+ </div>
</div>
- </div>
- </form>
+ </form>
+ </div>
</div>
-
</div>
-</div>
+}
@code {
[Parameter]
public Guid Id { get; set; }
+ private bool IsLoading { get; set; } = true;
+ private Alias? Alias { get; set; } = new();
+ private string AliasEmail { get; set; } = string.Empty;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
BreadcrumbItems.Add(new BreadcrumbItem { DisplayName = "View alias" });
}
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if (firstRender)
+ {
+ await LoadAliasesAsync();
+ }
+ }
+
+ private async Task LoadAliasesAsync()
+ {
+ IsLoading = true;
+ StateHasChanged();
+
+ // Load the aliases from the webapi via AliasService.
+ Alias = await AliasService.LoadAliasAsync(Id);
+ AliasEmail = Alias?.Identity.EmailPrefix + "@landmail.nl";
+
+ IsLoading = false;
+ StateHasChanged();
+ }
}
diff --git a/src/AliasVault.WebApp/Pages/Counter.razor b/src/AliasVault.WebApp/Pages/Counter.razor
deleted file mode 100644
index 7f483c9bf..000000000
--- a/src/AliasVault.WebApp/Pages/Counter.razor
+++ /dev/null
@@ -1,19 +0,0 @@
-@page "/counter"
-
-<PageTitle>Counter</PageTitle>
-
-<h1>Counter</h1>
-
-<p role="status">Current count: @currentCount</p>
-
-<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
-
-@code {
- private int currentCount = 0;
-
- private void IncrementCount()
- {
- currentCount++;
- }
-
-}
diff --git a/src/AliasVault.WebApp/Pages/Weather.razor b/src/AliasVault.WebApp/Pages/Weather.razor
deleted file mode 100644
index e78bc295a..000000000
--- a/src/AliasVault.WebApp/Pages/Weather.razor
+++ /dev/null
@@ -1,60 +0,0 @@
-@page "/weather"
-@inject HttpClient Http
-
-<PageTitle>Weather</PageTitle>
-
-<h1>Weather</h1>
-
-<p>This component demonstrates fetching data from the server.</p>
-
-@if (forecasts == null)
-{
- <p>
- <em>Loading...</em>
- </p>
-}
-else
-{
- <table class="table">
- <thead>
- <tr>
- <th>Date</th>
- <th>Temp. (C)</th>
- <th>Temp. (F)</th>
- <th>Summary</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var forecast in forecasts)
- {
- <tr>
- <td>@forecast.Date.ToShortDateString()</td>
- <td>@forecast.TemperatureC</td>
- <td>@forecast.TemperatureF</td>
- <td>@forecast.Summary</td>
- </tr>
- }
- </tbody>
- </table>
-}
-
-@code {
- private WeatherForecast[]? forecasts;
-
- protected override async Task OnInitializedAsync()
- {
- forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
- }
-
- public class WeatherForecast
- {
- public DateOnly Date { get; set; }
-
- public int TemperatureC { get; set; }
-
- public string? Summary { get; set; }
-
- public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
- }
-
-}
diff --git a/src/AliasVault.WebApp/Services/AliasService.cs b/src/AliasVault.WebApp/Services/AliasService.cs
index 5e22291cb..a6ba7a21a 100644
--- a/src/AliasVault.WebApp/Services/AliasService.cs
+++ b/src/AliasVault.WebApp/Services/AliasService.cs
@@ -93,18 +93,17 @@ public class AliasService
/// Load existing entry from database.
/// </summary>
/// <param name="aliasId"></param>
- public async Task<Login> LoadAliasAsync(Guid aliasId)
+ public async Task<Alias?> LoadAliasAsync(Guid aliasId)
{
- using (var dbContext = new AliasDbContext())
+ // Make webapi call to get list of all entries.
+ try
{
- var aliasObject = await dbContext.Logins
- .Include(x => x.Passwords)
- .Include(x => x.Identity)
- .Include(x => x.Service)
- .Where(x => x.Id == aliasId)
- .FirstAsync();
-
- return aliasObject;
+ return await _httpClient.GetFromJsonAsync<Alias>("api/Alias/" + aliasId);
+ }
+ catch
+ {
+ // Return null if failed. If authentication failed, the AliasVaultApiHandlerService will redirect to login page.
+ return null;
}
}
diff --git a/src/AliasVault.WebApp/wwwroot/css/tailwind.css b/src/AliasVault.WebApp/wwwroot/css/tailwind.css
index 57bad3aec..129e5c290 100644
--- a/src/AliasVault.WebApp/wwwroot/css/tailwind.css
+++ b/src/AliasVault.WebApp/wwwroot/css/tailwind.css
@@ -590,10 +590,6 @@ video {
z-index: 10;
}
-.z-20 {
- z-index: 20;
-}
-
.z-30 {
z-index: 30;
}
@@ -602,16 +598,16 @@ video {
z-index: 50;
}
-.col-span-full {
- grid-column: 1 / -1;
+.col-span-2 {
+ grid-column: span 2 / span 2;
}
.col-span-6 {
grid-column: span 6 / span 6;
}
-.col-span-2 {
- grid-column: span 2 / span 2;
+.col-span-full {
+ grid-column: 1 / -1;
}
.mx-3 {
@@ -633,26 +629,14 @@ video {
margin-bottom: -0.25rem;
}
-.-mt-5 {
- margin-top: -1.25rem;
-}
-
.mb-1 {
margin-bottom: 0.25rem;
}
-.mb-1\.5 {
- margin-bottom: 0.375rem;
-}
-
.mb-2 {
margin-bottom: 0.5rem;
}
-.mb-3 {
- margin-bottom: 0.75rem;
-}
-
.mb-4 {
margin-bottom: 1rem;
}
@@ -673,10 +657,6 @@ video {
margin-left: 0.75rem;
}
-.ml-6 {
- margin-left: 1.5rem;
-}
-
.ml-auto {
margin-left: auto;
}
@@ -713,26 +693,6 @@ video {
margin-top: 2rem;
}
-.-ml-1 {
- margin-left: -0.25rem;
-}
-
-.mb-0 {
- margin-bottom: 0px;
-}
-
-.mb-0\.5 {
- margin-bottom: 0.125rem;
-}
-
-.mb-6 {
- margin-bottom: 1.5rem;
-}
-
-.mt-6 {
- margin-top: 1.5rem;
-}
-
.block {
display: block;
}
@@ -753,14 +713,6 @@ video {
display: inline-flex;
}
-.table {
- display: table;
-}
-
-.flow-root {
- display: flow-root;
-}
-
.grid {
display: grid;
}
@@ -769,12 +721,12 @@ video {
display: none;
}
-.h-11 {
- height: 2.75rem;
+.h-10 {
+ height: 2.5rem;
}
-.h-3 {
- height: 0.75rem;
+.h-28 {
+ height: 7rem;
}
.h-4 {
@@ -789,10 +741,6 @@ video {
height: 1.5rem;
}
-.h-7 {
- height: 1.75rem;
-}
-
.h-8 {
height: 2rem;
}
@@ -805,38 +753,22 @@ video {
height: 100%;
}
-.h-1 {
- height: 0.25rem;
-}
-
-.h-28 {
- height: 7rem;
-}
-
-.h-10 {
- height: 2.5rem;
-}
-
.w-1\/2 {
width: 50%;
}
-.w-11 {
- width: 2.75rem;
+.w-10 {
+ width: 2.5rem;
}
-.w-3 {
- width: 0.75rem;
+.w-28 {
+ width: 7rem;
}
.w-4 {
width: 1rem;
}
-.w-44 {
- width: 11rem;
-}
-
.w-5 {
width: 1.25rem;
}
@@ -853,10 +785,6 @@ video {
width: 16rem;
}
-.w-7 {
- width: 1.75rem;
-}
-
.w-8 {
width: 2rem;
}
@@ -865,50 +793,18 @@ video {
width: 100%;
}
-.w-28 {
- width: 7rem;
-}
-
-.w-72 {
- width: 18rem;
-}
-
-.w-auto {
- width: auto;
-}
-
-.w-10 {
- width: 2.5rem;
-}
-
-.min-w-0 {
- min-width: 0px;
-}
-
.max-w-screen-2xl {
max-width: 1536px;
}
-.max-w-sm {
- max-width: 24rem;
-}
-
.max-w-xl {
max-width: 36rem;
}
-.flex-1 {
- flex: 1 1 0%;
-}
-
.flex-shrink-0 {
flex-shrink: 0;
}
-.flex-grow {
- flex-grow: 1;
-}
-
.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));
}
@@ -935,24 +831,20 @@ video {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
-.grid-cols-3 {
- grid-template-columns: repeat(3, minmax(0, 1fr));
+.grid-cols-2 {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-4 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
-.grid-cols-7 {
- grid-template-columns: repeat(7, minmax(0, 1fr));
-}
-
.grid-cols-6 {
grid-template-columns: repeat(6, minmax(0, 1fr));
}
-.grid-cols-2 {
- grid-template-columns: repeat(2, minmax(0, 1fr));
+.grid-cols-7 {
+ grid-template-columns: repeat(7, minmax(0, 1fr));
}
.flex-col {
@@ -991,10 +883,6 @@ video {
gap: 1.5rem;
}
-.gap-2 {
- gap: 0.5rem;
-}
-
.space-x-1 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.25rem * var(--tw-space-x-reverse));
@@ -1025,12 +913,6 @@ video {
margin-bottom: calc(2rem * var(--tw-space-y-reverse));
}
-.space-x-4 > :not([hidden]) ~ :not([hidden]) {
- --tw-space-x-reverse: 0;
- margin-right: calc(1rem * var(--tw-space-x-reverse));
- margin-left: calc(1rem * 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)));
@@ -1042,11 +924,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;
}
@@ -1059,12 +936,6 @@ video {
overflow-y: auto;
}
-.truncate {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
.whitespace-nowrap {
white-space: nowrap;
}
@@ -1103,11 +974,6 @@ video {
border-top-width: 1px;
}
-.border-gray-100 {
- --tw-border-opacity: 1;
- border-color: rgb(243 244 246 / var(--tw-border-opacity));
-}
-
.border-gray-200 {
--tw-border-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-border-opacity));
@@ -1118,11 +984,6 @@ video {
border-color: rgb(209 213 219 / var(--tw-border-opacity));
}
-.border-white {
- --tw-border-opacity: 1;
- border-color: rgb(255 255 255 / var(--tw-border-opacity));
-}
-
.bg-gray-200 {
--tw-bg-opacity: 1;
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
@@ -1143,44 +1004,20 @@ video {
background-color: rgb(17 24 39 / var(--tw-bg-opacity));
}
-.bg-green-400 {
- --tw-bg-opacity: 1;
- background-color: rgb(74 222 128 / var(--tw-bg-opacity));
-}
-
.bg-primary-700 {
--tw-bg-opacity: 1;
background-color: rgb(184 112 47 / var(--tw-bg-opacity));
}
-.bg-purple-500 {
- --tw-bg-opacity: 1;
- background-color: rgb(168 85 247 / var(--tw-bg-opacity));
-}
-
-.bg-red-600 {
- --tw-bg-opacity: 1;
- background-color: rgb(220 38 38 / var(--tw-bg-opacity));
-}
-
.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
-.bg-orange-300 {
- --tw-bg-opacity: 1;
- background-color: rgb(253 186 116 / var(--tw-bg-opacity));
-}
-
.bg-opacity-50 {
--tw-bg-opacity: 0.5;
}
-.fill-blue-600 {
- fill: #2563eb;
-}
-
.fill-primary-600 {
fill: #d68338;
}
@@ -1201,10 +1038,6 @@ video {
padding: 1.5rem;
}
-.p-3 {
- padding: 0.75rem;
-}
-
.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
@@ -1245,24 +1078,6 @@ video {
padding-bottom: 1.5rem;
}
-.py-2\.5 {
- padding-top: 0.625rem;
- padding-bottom: 0.625rem;
-}
-
-.py-4 {
- padding-top: 1rem;
- padding-bottom: 1rem;
-}
-
-.pl-3 {
- padding-left: 0.75rem;
-}
-
-.pr-4 {
- padding-right: 1rem;
-}
-
.ps-3 {
padding-inline-start: 0.75rem;
}
@@ -1279,14 +1094,6 @@ video {
padding-top: 2rem;
}
-.pb-6 {
- padding-bottom: 1.5rem;
-}
-
-.pt-4 {
- padding-top: 1rem;
-}
-
.text-center {
text-align: center;
}
@@ -1311,16 +1118,6 @@ video {
line-height: 1.75rem;
}
-.text-xs {
- font-size: 0.75rem;
- line-height: 1rem;
-}
-
-.text-lg {
- font-size: 1.125rem;
- line-height: 1.75rem;
-}
-
.font-bold {
font-weight: 700;
}
@@ -1349,8 +1146,9 @@ video {
line-height: 2.25rem;
}
-.leading-none {
- line-height: 1;
+.text-gray-200 {
+ --tw-text-opacity: 1;
+ color: rgb(229 231 235 / var(--tw-text-opacity));
}
.text-gray-400 {
@@ -1373,6 +1171,11 @@ video {
color: rgb(17 24 39 / var(--tw-text-opacity));
}
+.text-green-500 {
+ --tw-text-opacity: 1;
+ color: rgb(34 197 94 / var(--tw-text-opacity));
+}
+
.text-primary-700 {
--tw-text-opacity: 1;
color: rgb(184 112 47 / var(--tw-text-opacity));
@@ -1383,26 +1186,6 @@ video {
color: rgb(255 255 255 / var(--tw-text-opacity));
}
-.text-gray-300 {
- --tw-text-opacity: 1;
- color: rgb(209 213 219 / var(--tw-text-opacity));
-}
-
-.text-green-400 {
- --tw-text-opacity: 1;
- color: rgb(74 222 128 / var(--tw-text-opacity));
-}
-
-.text-primary-900 {
- --tw-text-opacity: 1;
- color: rgb(123 74 30 / var(--tw-text-opacity));
-}
-
-.text-gray-200 {
- --tw-text-opacity: 1;
- color: rgb(229 231 235 / var(--tw-text-opacity));
-}
-
.opacity-0 {
opacity: 0;
}
@@ -1455,11 +1238,6 @@ video {
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
}
-.hover\:bg-gray-50:hover {
- --tw-bg-opacity: 1;
- background-color: rgb(249 250 251 / var(--tw-bg-opacity));
-}
-
.hover\:bg-primary-800:hover {
--tw-bg-opacity: 1;
background-color: rgb(154 93 38 / var(--tw-bg-opacity));
@@ -1480,17 +1258,13 @@ video {
color: rgb(184 112 47 / var(--tw-text-opacity));
}
-.hover\:text-blue-700:hover {
- --tw-text-opacity: 1;
- color: rgb(29 78 216 / var(--tw-text-opacity));
-}
-
.hover\:underline:hover {
text-decoration-line: underline;
}
-.focus\:z-10:focus {
- z-index: 10;
+.focus\:border-blue-500:focus {
+ --tw-border-opacity: 1;
+ border-color: rgb(59 130 246 / var(--tw-border-opacity));
}
.focus\:border-primary-500:focus {
@@ -1498,11 +1272,6 @@ video {
border-color: rgb(244 149 65 / var(--tw-border-opacity));
}
-.focus\:border-blue-500:focus {
- --tw-border-opacity: 1;
- border-color: rgb(59 130 246 / var(--tw-border-opacity));
-}
-
.focus\:outline-none:focus {
outline: 2px solid transparent;
outline-offset: 2px;
@@ -1514,6 +1283,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));
@@ -1534,26 +1308,11 @@ video {
--tw-ring-color: rgb(244 149 65 / var(--tw-ring-opacity));
}
-.focus\:ring-blue-500:focus {
- --tw-ring-opacity: 1;
- --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
-}
-
-.group:hover .group-hover\:text-gray-500 {
- --tw-text-opacity: 1;
- color: rgb(107 114 128 / var(--tw-text-opacity));
-}
-
.dark\:divide-gray-600:is(.dark *) > :not([hidden]) ~ :not([hidden]) {
--tw-divide-opacity: 1;
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-600:is(.dark *) {
--tw-border-opacity: 1;
border-color: rgb(75 85 99 / var(--tw-border-opacity));
@@ -1584,16 +1343,6 @@ video {
background-color: rgb(214 131 56 / var(--tw-bg-opacity));
}
-.dark\:bg-gray-600:is(.dark *) {
- --tw-bg-opacity: 1;
- background-color: rgb(75 85 99 / var(--tw-bg-opacity));
-}
-
-.dark\:bg-orange-400:is(.dark *) {
- --tw-bg-opacity: 1;
- background-color: rgb(251 146 60 / var(--tw-bg-opacity));
-}
-
.dark\:bg-opacity-80:is(.dark *) {
--tw-bg-opacity: 0.8;
}
@@ -1608,34 +1357,29 @@ video {
color: rgb(156 163 175 / var(--tw-text-opacity));
}
-.dark\:text-primary-400:is(.dark *) {
- --tw-text-opacity: 1;
- color: rgb(246 167 82 / var(--tw-text-opacity));
-}
-
-.dark\:text-primary-500:is(.dark *) {
+.dark\:text-gray-600:is(.dark *) {
--tw-text-opacity: 1;
- color: rgb(244 149 65 / var(--tw-text-opacity));
+ color: rgb(75 85 99 / var(--tw-text-opacity));
}
-.dark\:text-white:is(.dark *) {
+.dark\:text-green-400:is(.dark *) {
--tw-text-opacity: 1;
- color: rgb(255 255 255 / var(--tw-text-opacity));
+ color: rgb(74 222 128 / var(--tw-text-opacity));
}
-.dark\:text-green-500:is(.dark *) {
+.dark\:text-primary-200:is(.dark *) {
--tw-text-opacity: 1;
- color: rgb(34 197 94 / var(--tw-text-opacity));
+ color: rgb(251 203 116 / var(--tw-text-opacity));
}
-.dark\:text-primary-200:is(.dark *) {
+.dark\:text-primary-500:is(.dark *) {
--tw-text-opacity: 1;
- color: rgb(251 203 116 / var(--tw-text-opacity));
+ color: rgb(244 149 65 / var(--tw-text-opacity));
}
-.dark\:text-gray-600:is(.dark *) {
+.dark\:text-white:is(.dark *) {
--tw-text-opacity: 1;
- color: rgb(75 85 99 / var(--tw-text-opacity));
+ color: rgb(255 255 255 / var(--tw-text-opacity));
}
.dark\:placeholder-gray-400:is(.dark *)::-moz-placeholder {
@@ -1677,8 +1421,9 @@ video {
color: rgb(255 255 255 / var(--tw-text-opacity));
}
-.dark\:hover\:underline:hover:is(.dark *) {
- text-decoration-line: underline;
+.dark\:focus\:border-blue-500:focus:is(.dark *) {
+ --tw-border-opacity: 1;
+ border-color: rgb(59 130 246 / var(--tw-border-opacity));
}
.dark\:focus\:border-primary-500:focus:is(.dark *) {
@@ -1686,14 +1431,9 @@ video {
border-color: rgb(244 149 65 / var(--tw-border-opacity));
}
-.dark\:focus\:border-blue-500:focus:is(.dark *) {
- --tw-border-opacity: 1;
- border-color: rgb(59 130 246 / var(--tw-border-opacity));
-}
-
-.dark\:focus\:text-white:focus:is(.dark *) {
- --tw-text-opacity: 1;
- color: rgb(255 255 255 / var(--tw-text-opacity));
+.dark\:focus\:ring-blue-500:focus:is(.dark *) {
+ --tw-ring-opacity: 1;
+ --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
}
.dark\:focus\:ring-gray-600:focus:is(.dark *) {
@@ -1721,16 +1461,6 @@ video {
--tw-ring-color: rgb(154 93 38 / var(--tw-ring-opacity));
}
-.dark\:focus\:ring-blue-500:focus:is(.dark *) {
- --tw-ring-opacity: 1;
- --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
-}
-
-.group:hover .dark\:group-hover\:text-gray-400:is(.dark *) {
- --tw-text-opacity: 1;
- color: rgb(156 163 175 / var(--tw-text-opacity));
-}
-
@media (min-width: 640px) {
.sm\:col-span-3 {
grid-column: span 3 / span 3;
@@ -1758,14 +1488,14 @@ video {
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}
- .sm\:p-8 {
- padding: 2rem;
- }
-
.sm\:p-6 {
padding: 1.5rem;
}
+ .sm\:p-8 {
+ padding: 2rem;
+ }
+
.sm\:text-2xl {
font-size: 1.5rem;
line-height: 2rem;
@@ -1778,10 +1508,6 @@ video {
}
@media (min-width: 768px) {
- .md\:col-auto {
- grid-column: auto;
- }
-
.md\:mb-0 {
margin-bottom: 0px;
}
@@ -1806,18 +1532,14 @@ video {
height: 100vh;
}
- .md\:w-auto {
- width: auto;
+ .md\:grid-cols-3 {
+ grid-template-columns: repeat(3, minmax(0, 1fr));
}
.md\:grid-cols-4 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
- .md\:grid-cols-3 {
- grid-template-columns: repeat(3, minmax(0, 1fr));
- }
-
.md\:items-center {
align-items: center;
}
@@ -1832,31 +1554,10 @@ video {
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}
- .md\:border-0 {
- border-width: 0px;
- }
-
- .md\:p-0 {
- padding: 0px;
- }
-
.md\:py-10 {
padding-top: 2.5rem;
padding-bottom: 2.5rem;
}
-
- .md\:hover\:bg-transparent:hover {
- background-color: transparent;
- }
-
- .md\:hover\:text-primary-700:hover {
- --tw-text-opacity: 1;
- color: rgb(184 112 47 / var(--tw-text-opacity));
- }
-
- .md\:dark\:hover\:bg-transparent:hover:is(.dark *) {
- background-color: transparent;
- }
}
@media (min-width: 1024px) {
@@ -1916,18 +1617,10 @@ video {
}
@media (min-width: 1280px) {
- .xl\:col-auto {
- grid-column: auto;
- }
-
.xl\:mb-2 {
margin-bottom: 0.5rem;
}
- .xl\:mb-0 {
- margin-bottom: 0px;
- }
-
.xl\:mb-4 {
margin-bottom: 1rem;
}
@@ -1936,10 +1629,6 @@ video {
display: block;
}
- .xl\:w-full {
- width: 100%;
- }
-
.xl\:grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@@ -1948,29 +1637,20 @@ video {
grid-template-columns: repeat(6, minmax(0, 1fr));
}
- .xl\:grid-cols-2 {
- grid-template-columns: repeat(2, minmax(0, 1fr));
- }
-
.xl\:gap-4 {
gap: 1rem;
}
- .xl\:space-x-8 > :not([hidden]) ~ :not([hidden]) {
- --tw-space-x-reverse: 0;
- margin-right: calc(2rem * var(--tw-space-x-reverse));
- margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
- }
-
.xl\:space-x-0 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0px * var(--tw-space-x-reverse));
margin-left: calc(0px * calc(1 - var(--tw-space-x-reverse)));
}
- .xl\:px-0 {
- padding-left: 0px;
- padding-right: 0px;
+ .xl\:space-x-8 > :not([hidden]) ~ :not([hidden]) {
+ --tw-space-x-reverse: 0;
+ margin-right: calc(2rem * var(--tw-space-x-reverse));
+ margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
}
}
@@ -1987,10 +1667,6 @@ video {
display: flex;
}
- .\32xl\:w-auto {
- width: auto;
- }
-
.\32xl\:space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1rem * var(--tw-space-x-reverse));
diff --git a/src/AliasVault.WebApp/wwwroot/index.html b/src/AliasVault.WebApp/wwwroot/index.html
index 27d4ccefc..fd3f97985 100644
--- a/src/AliasVault.WebApp/wwwroot/index.html
+++ b/src/AliasVault.WebApp/wwwroot/index.html
@@ -32,6 +32,15 @@
window.initTopMenu = function() {
initDarkModeSwitcher();
};
+
+ window.clipboardCopy = {
+ copyText: function (text) {
+ navigator.clipboard.writeText(text).then(function () { })
+ .catch(function (error) {
+ alert(error);
+ });
+ }
+ };
</script>
<script src="_framework/blazor.webassembly.js"></script>
diff --git a/src/AliasVault.WebApp/wwwroot/sample-data/weather.json b/src/AliasVault.WebApp/wwwroot/sample-data/weather.json
deleted file mode 100644
index b7459733f..000000000
--- a/src/AliasVault.WebApp/wwwroot/sample-data/weather.json
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "date": "2022-01-06",
- "temperatureC": 1,
- "summary": "Freezing"
- },
- {
- "date": "2022-01-07",
- "temperatureC": 14,
- "summary": "Bracing"
- },
- {
- "date": "2022-01-08",
- "temperatureC": -13,
- "summary": "Freezing"
- },
- {
- "date": "2022-01-09",
- "temperatureC": -16,
- "summary": "Balmy"
- },
- {
- "date": "2022-01-10",
- "temperatureC": -2,
- "summary": "Chilly"
- }
-]