AttachedDashboard

Phoenix LiveView dashboard for the attached file-attachment library.

Screenshots

A short tour. Click any image for the full-resolution file.

Overview

Overview — KPIs (originals, variants, orphans, total size), content-type distribution, storage usage, recent uploads.


Originals

Originals — browse every original with filters (kind, content type, storage backend, owner table/field) and sorting. See variants view for the Variants pill.


Original detail

Original detail — metadata, owner link, variants derived from this original. Variant pages show an origin banner linking back to the source.


Owners

Owners — every (owner_table, owner_field) group with original counts, sizes, and a "browse" link that carries the filter into the originals view.


Processors

Processors — configured metadata extractors, previewers, and transformers with runtime availability and install hints. Doubles as an install checklist.


Orphans

Orphans — originals whose owner record is gone. Purge selectively, per group, or everything at once.

Installation

def deps do
[{:attached_dashboard, "~> 0.1"}]
end

Usage

# router.ex
import AttachedDashboard.Router
scope "/" do
pipe_through :browser
attached_dashboard "/admin/files"
end

Visit /admin/files to open the dashboard.

Access control

The dashboard has no built-in auth — protect it in your router. Two common patterns:

Quick: HTTP Basic Auth

# router.ex
import Plug.BasicAuth, only: [basic_auth: 2]
pipeline :dashboard_auth do
plug :basic_auth, username: "admin", password: System.fetch_env!("DASHBOARD_PASSWORD")
end
scope "/" do
pipe_through [:browser, :dashboard_auth]
attached_dashboard "/admin/files"
end

Proper: hook into your existing auth via :on_mount

scope "/" do
pipe_through [:browser, :require_admin]
attached_dashboard "/admin/files", on_mount: [{MyAppWeb.UserAuth, :ensure_authenticated}]
end

:on_mount hooks run inside the dashboard's live_session, so LiveView navigation stays protected too — not just the initial HTTP request.

License

MIT