Skip to content

Commit

Permalink
Revert "[PM-6201] Fix creation of organizations no longer working aft…
Browse files Browse the repository at this point in the history
…er merging #5130 (#5142)"

This reverts commit 64573d0.
  • Loading branch information
jonashendrickx committed Dec 11, 2024
1 parent 64573d0 commit b190426
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/Admin/AdminConsole/Models/OrganizationsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ public class OrganizationsModel : PagedModel<Organization>
public bool? Paid { get; set; }
public string Action { get; set; }
public bool SelfHosted { get; set; }

public double StorageGB(Organization org) => org.Storage.HasValue ? Math.Round(org.Storage.Value / 1073741824D, 2) : 0;
}
3 changes: 2 additions & 1 deletion src/Admin/AdminConsole/Views/Organizations/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
<i class="fa fa-smile-o fa-lg fa-fw text-body-secondary" title="Freeloader"></i>
}
}
<i class="fa fa-hdd-o fa-lg fa-fw" title="Used Storage, @Model.StorageGB(org) GB"></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"
Expand Down
5 changes: 5 additions & 0 deletions src/Core/AdminConsole/Entities/Organization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ public string SubscriberType()

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)
Expand Down

0 comments on commit b190426

Please sign in to comment.