PhoenixKitWeb.Live.Modules.Storage.LibrarySync (phoenix_kit v2.60.2)

Copy Markdown View Source

A library's sync state in the admin: the badge, how many files are left, and the Check now / Pause / Resume controls, shared by the Libraries tab and the library page. The state itself is Storage.LibraryState.

run/4 does what a button asks; the permission check is the Jobs context's (jobs.manage and media.manage, against the active role), so a hand-made event is refused all the same, whoever the buttons were shown to.

Summary

Functions

A flash for a refused run/4.

Check now, Pause or Resume for the library library_uuid, whose current state is state (LibraryState). {:ok, run} or {:error, reason}.

Functions

error_message(reason)

@spec error_message(term()) :: String.t()

A flash for a refused run/4.

run(arg1, library_uuid, state, scope)

@spec run(String.t(), term(), map() | nil, term()) :: {:ok, term()} | {:error, term()}

Check now, Pause or Resume for the library library_uuid, whose current state is state (LibraryState). {:ok, run} or {:error, reason}.

sync_cell(assigns)

Attributes

  • state (:map) - Defaults to nil.
  • uuid (:any) (required)
  • scope (:any) - Defaults to nil.
  • target (:any) (required)