mod.rs 34 lignes · 998 octets
//! Admin UI for the fediverse guard (Lot 8).
//!
//! Five Askama screens — dashboard, events, bans, manual_ban,
//! thresholds — exposed under `/admin/fediverse-guard/*`. The standard
//! `admin_required` middleware shipped by `rustwarden-core` is what
//! actually gates access; this module only renders.
//!
//! ## Wiring
//!
//! ```ignore
//! use std::sync::Arc;
//! use rustwarden_fediverse_guard::{
//!     ui, GuardConfig, GuardStore, HybridStore, PostgresStore,
//! };
//!
//! let store: Arc<dyn GuardStore> = Arc::new(HybridStore::new(
//!     Arc::new(PostgresStore::new(db.clone())),
//! ));
//! let config = GuardConfig::from_env()?;
//!
//! let ui_router = ui::default_routes()
//!     .layer(axum::Extension(store))
//!     .layer(axum::Extension(config));
//!
//! builder.merge_routes(ui_router);
//! builder = builder.add_dashboard_card(ui::dashboard_card());
//! ```

mod dashboard;
mod handlers;
mod routes;

pub use dashboard::dashboard_card;
pub use routes::default_routes;