Skip to main content

Crate autumn_admin_plugin

Crate autumn_admin_plugin 

Source
Expand description

§autumn-admin-plugin

Out-of-the-box admin panel plugin for autumn-web applications.

Provides auto-generated CRUD views, search, filtering, and audit trails for any model registered via the AdminPlugin builder. The UI is server-rendered with Maud + HTMX — no JS build step required.

§Quick start

ⓘ
use autumn_admin_plugin::{prelude::*, AdminPlugin};

autumn_web::app()
    .plugin(
        AdminPlugin::new()
            .register(ProjectAdmin::default())
            .register(TicketAdmin::default()),
    )
    .routes(routes![...])
    .run()
    .await;

§Security

The plugin requires the "admin" role in the session by default. Override with AdminPlugin::require_role (pass None to disable; not recommended for production).

§Naming convention

First-party plugin: autumn-<name>-plugin.

Modules§

experiments
Admin panel model for autumn_experiments.
feature_flags
Admin panel model for autumn_feature_flags.
prelude
Common downstream imports for implementing admin models.
tokens
Admin panel model for scoped API tokens (api_tokens).

Structs§

AdminAction
A named bulk action that can be performed on selected records.
AdminField
Metadata for a single model field.
AdminHistoryEntry
A single entry in the admin History pane for an opted-in model.
AdminHistoryPage
Paginated history result for the admin History pane.
AdminImpersonation
Request extractor resolving the impersonation banner for the current session, or None when the session is not impersonating.
AdminImportError
A single parse/validation error from an admin CSV import.
AdminImportReport
Summary of a completed (or dry-run) admin CSV import.
AdminPlugin
The admin panel plugin.
AdminRegistry
Holds all registered admin models, keyed by their URL slug.
ImpersonationBanner
Everything the impersonation banner needs to render.
ListParams
Parameters for a list query.
ListResult
Result of a list query, containing records and pagination metadata.
SelectOption
A single option in a AdminFieldKind::Select dropdown.

Enums§

AdminError
Error type for admin operations.
AdminFieldKind
The kind of a model field, used to select the appropriate form widget.
AdminImportRowResult
The outcome of processing a single imported CSV row.
CsvImportMode
Mode for an admin CSV import operation.
SortDirection
Sort direction for list queries.

Constants§

IMPERSONATION_BANNER_CSS
Styles for the impersonation banner (impersonation_banner).

Traits§

AdminModel
The core trait that enables a model to be managed in the admin panel.

Functions§

dispatch_restore_purge_or_unhandled
Dispatch the built-in "restore"/"purge" bulk actions and the fallback error for anything else.
impersonation_banner
Render the persistent “Viewing as … — Stop impersonating” banner.
impersonation_banner_for
Render the impersonation banner for the current request, or None when the session is not impersonating.

Type Aliases§

AdminFuture
Type alias for the boxed future returned by async AdminModel methods.