1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 13:08:17 -05:00

add various status counts to org information (#1647)

This commit is contained in:
Kyle Spearrin 2021-10-20 17:10:51 -04:00 committed by GitHub
parent 216395f541
commit de3f1005fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -17,6 +17,9 @@ namespace Bit.Admin.Models
{ {
Organization = org; Organization = org;
HasPublicPrivateKeys = org.PublicKey != null && org.PrivateKey != null; HasPublicPrivateKeys = org.PublicKey != null && org.PrivateKey != null;
UserInvitedCount = orgUsers.Count(u => u.Status == OrganizationUserStatusType.Invited);
UserAcceptedCount = orgUsers.Count(u => u.Status == OrganizationUserStatusType.Accepted);
UserConfirmedCount = orgUsers.Count(u => u.Status == OrganizationUserStatusType.Confirmed);
UserCount = orgUsers.Count(); UserCount = orgUsers.Count();
CipherCount = ciphers.Count(); CipherCount = ciphers.Count();
CollectionCount = collections.Count(); CollectionCount = collections.Count();
@ -35,6 +38,9 @@ namespace Bit.Admin.Models
public Organization Organization { get; set; } public Organization Organization { get; set; }
public string Owners { get; set; } public string Owners { get; set; }
public string Admins { get; set; } public string Admins { get; set; }
public int UserInvitedCount { get; set; }
public int UserConfirmedCount { get; set; }
public int UserAcceptedCount { get; set; }
public int UserCount { get; set; } public int UserCount { get; set; }
public int CipherCount { get; set; } public int CipherCount { get; set; }
public int CollectionCount { get; set; } public int CollectionCount { get; set; }

View File

@ -10,7 +10,12 @@
<dd class="col-sm-8 col-lg-9">@(Model.Organization.ExpirationDate?.ToString() ?? "-")</dd> <dd class="col-sm-8 col-lg-9">@(Model.Organization.ExpirationDate?.ToString() ?? "-")</dd>
<dt class="col-sm-4 col-lg-3">Users</dt> <dt class="col-sm-4 col-lg-3">Users</dt>
<dd class="col-sm-8 col-lg-9">@Model.UserCount / @(Model.Organization.Seats?.ToString() ?? "-")</dd> <dd class="col-sm-8 col-lg-9">
@Model.UserCount / @(Model.Organization.Seats?.ToString() ?? "-")
(<span title="Invited">@Model.UserInvitedCount</span> /
<span title="Accepted">@Model.UserAcceptedCount</span> /
<span title="Confirmed">@Model.UserConfirmedCount</span>)
</dd>
<dt class="col-sm-4 col-lg-3">Owners</dt> <dt class="col-sm-4 col-lg-3">Owners</dt>
<dd class="col-sm-8 col-lg-9">@(string.IsNullOrWhiteSpace(Model.Owners) ? "None" : Model.Owners)</dd> <dd class="col-sm-8 col-lg-9">@(string.IsNullOrWhiteSpace(Model.Owners) ? "None" : Model.Owners)</dd>