PhoenixKitWeb.Live.Modules.Storage.BucketUsage (phoenix_kit v2.52.2)

Copy Markdown View Source

How the Storage settings show which storage profiles use a bucket (PhoenixKit.Modules.Storage.Profiles.bucket_usage/1): the "Used by" cell of the Buckets list, the panel on the bucket's edit page, and the wording of the refusal when a bucket that is in use is deleted or disabled.

A user's own storage profile and their libraries are private to them: they are counted here, never named.

Summary

Functions

What the admin is told when action (:delete or :disable) on bucket is refused because the profiles in usage list it.

The Buckets list's "Used by" cell: a chip per site profile, one for personal ones.

The profiles in usage in words: the site's by name and how the bucket is used there, then a count of personal ones, then how many libraries that reaches.

Functions

refusal_message(action, bucket, usage)

@spec refusal_message(:delete | :disable, struct(), [map()]) :: String.t()

What the admin is told when action (:delete or :disable) on bucket is refused because the profiles in usage list it.

usage_cell(assigns)

The Buckets list's "Used by" cell: a chip per site profile, one for personal ones.

Attributes

  • usage (:list) (required) - the bucket's entry of Profiles.bucket_usage/1.

used_by_text(usage)

@spec used_by_text([map()]) :: String.t()

The profiles in usage in words: the site's by name and how the bucket is used there, then a count of personal ones, then how many libraries that reaches.