1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-21 16:47:35 +01:00

[PM-6201] Self-Host Admin Portal is reporting "10239 GB of Additional… (#5130)

This commit is contained in:
Jonas Hendrickx 2024-12-11 10:32:28 +01:00 committed by GitHub
parent 94761a8c7b
commit 674e522843
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 10 deletions

View File

@ -81,16 +81,8 @@
<i class="fa fa-smile-o fa-lg fa-fw text-body-secondary" title="Freeloader"></i>
}
}
@if(org.MaxStorageGb.HasValue && org.MaxStorageGb > 1)
{
<i class="fa fa-plus-square fa-lg fa-fw"
title="Additional Storage, @(org.MaxStorageGb - 1) GB"></i>
}
else
{
<i class="fa fa-plus-square-o fa-lg fa-fw text-body-secondary"
title="No Additional Storage"></i>
}
<i class="fa fa-hdd-o fa-lg fa-fw"
title="Used Storage, @org.StorageGb GB"></i>
@if(org.Enabled)
{
<i class="fa fa-check-circle fa-lg fa-fw"

View File

@ -181,6 +181,11 @@ public class Organization : ITableObject<Guid>, IStorableSubscriber, IRevisable,
public bool IsExpired() => ExpirationDate.HasValue && ExpirationDate.Value <= DateTime.UtcNow;
/// <summary>
/// Used storage in gigabytes.
/// </summary>
public double StorageGb => Storage.HasValue ? Math.Round(Storage.Value / 1073741824D, 2) : 0;
public long StorageBytesRemaining()
{
if (!MaxStorageGb.HasValue)