mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-02-26 11:57:37 -05:00
Merge pull request #149 from lanedirt/137-improve-credential-email-generation-ui
Admin dashboard tweaks
This commit is contained in:
@@ -32,6 +32,11 @@ public class UserViewModel
|
||||
/// </summary>
|
||||
public int VaultCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the email claim count.
|
||||
/// </summary>
|
||||
public int EmailClaimCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the total vault storage that this user takes up in kilobytes.
|
||||
/// </summary>
|
||||
|
||||
@@ -40,17 +40,25 @@ else
|
||||
@foreach (var email in EmailList)
|
||||
{
|
||||
<tr class="bg-white border-b hover:bg-gray-50">
|
||||
<td class="px-4 py-3 font-medium text-gray-900">@email.Id</td>
|
||||
<td class="px-4 py-3">@email.DateSystem.ToString("yyyy-MM-dd HH:mm")</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="font-medium">@email.FromLocal</span>@@@email.FromDomain
|
||||
<td class="px-4 py-3 font-medium text-gray-900">
|
||||
@email.Id
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="font-medium">@email.ToLocal</span>@@@email.ToDomain
|
||||
@email.DateSystem.ToString("yyyy-MM-dd HH:mm")
|
||||
</td>
|
||||
<td class="px-4 py-3">@email.Subject</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="line-clamp-1">@email.MessagePreview</span>
|
||||
@(email.FromLocal.Length > 15 ? email.FromLocal.Substring(0, 15) : email.FromLocal)@@@(email.FromDomain.Length > 15 ? email.FromDomain.Substring(0, 15) : email.FromDomain)
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
@email.ToLocal@@@email.ToDomain
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
@(email.Subject.Length > 30 ? email.Subject.Substring(0, 30) : email.Subject)
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="line-clamp-1">
|
||||
@(email.MessagePreview?.Length > 30 ? email.MessagePreview.Substring(0, 30) : email.MessagePreview)
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
@email.Attachments.Count
|
||||
|
||||
@@ -33,6 +33,7 @@ else
|
||||
<th scope="col" class="px-4 py-3">Registered</th>
|
||||
<th scope="col" class="px-4 py-3">Username</th>
|
||||
<th scope="col" class="px-4 py-3"># Vaults</th>
|
||||
<th scope="col" class="px-4 py-3"># Email claims</th>
|
||||
<th scope="col" class="px-4 py-3">Storage</th>
|
||||
<th scope="col" class="px-4 py-3">Last vault update</th>
|
||||
<th scope="col" class="px-4 py-3">Actions</th>
|
||||
@@ -46,6 +47,7 @@ else
|
||||
<td class="px-4 py-3">@user.CreatedAt.ToString("yyyy-MM-dd HH:mm")</td>
|
||||
<td class="px-4 py-3">@user.UserName</td>
|
||||
<td class="px-4 py-3">@user.VaultCount</td>
|
||||
<td class="px-4 py-3">@user.EmailClaimCount</td>
|
||||
<td class="px-4 py-3">@Math.Round((double)user.VaultStorageInKb / 1024, 1) MB</td>
|
||||
<td class="px-4 py-3">@user.LastVaultUpdate.ToString("yyyy-MM-dd HH:mm")</td>
|
||||
<td class="px-4 py-3">
|
||||
@@ -122,7 +124,11 @@ else
|
||||
{
|
||||
v.FileSize,
|
||||
v.CreatedAt
|
||||
})
|
||||
}),
|
||||
EmailClaims = u.EmailClaims.Select(ec => new
|
||||
{
|
||||
ec.CreatedAt
|
||||
}),
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
@@ -132,6 +138,7 @@ else
|
||||
UserName = user.UserName?.ToLower() ?? "N/A",
|
||||
CreatedAt = user.CreatedAt,
|
||||
VaultCount = user.Vaults.Count(),
|
||||
EmailClaimCount = user.EmailClaims.Count(),
|
||||
VaultStorageInKb = user.Vaults.Sum(x => x.FileSize),
|
||||
LastVaultUpdate = user.Vaults.Max(x => x.CreatedAt),
|
||||
}).ToList();
|
||||
|
||||
@@ -76,8 +76,7 @@ else
|
||||
<tr>
|
||||
<th scope="col" class="px-4 py-3">ID</th>
|
||||
<th scope="col" class="px-4 py-3">Created</th>
|
||||
<th scope="col" class="px-4 py-3">Filesize</th>
|
||||
<th scope="col" class="px-4 py-3">DB version</th>
|
||||
<th scope="col" class="px-4 py-3">Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user