A modern administrative dashboard interface for Doh applications that automatically discovers and displays available admin routes.
/admin/* routes (one level deep only)Add to your boot.pod.yaml:
host_load:
- admin_dashboard
Navigate to /admin to access the dashboard. Users must be authenticated and have the access:admin_dashboard permission.
Assign the admin_dashboard_user permission group to users who should access the dashboard:
await Doh.assignPermissionGroup(user, 'admin_dashboard_user');
| Route | Method | Description |
|---|---|---|
/admin |
GET | Main dashboard page |
/api/admin_dashboard/routes |
GET | API endpoint returning available admin routes |
Only routes exactly one level deep after /admin/ are displayed:
/admin/users - Included/admin/settings - Included/admin/users/profile/:id - Excluded (too deep)Icons are assigned using a cascade system with weighted patterns:
| Priority | Weight | Example |
|---|---|---|
| Exact match | 100 | /admin/users -> fas fa-users |
| Word-based | 80 | Contains "user" -> fas fa-user |
| Category | 60 | Contains "manage" -> fas fa-tools |
| Fallback | 1 | Default -> fas fa-cog |
The module defines:
access:admin_dashboardadmin_dashboard_user (assignable)admin_dashboard - validates path is /adminexpress_router - Route handlinguser_host - Authentication middlewareThe dashboard uses CSS custom properties for theming. Override in your own stylesheet:
:root {
--ad-bg-color: #1e1e1e;
--ad-text-color: #e0e0e0;
--ad-accent-color: #4d8bbd;
/* See admin_dashboard.css for full list */
}
The UI module exposes methods for programmatic control:
// Refresh the dashboard
admin_dashboard_ui.refresh();
// Set filter programmatically ('all', 'admin', 'auth')
admin_dashboard_ui.setFilter('admin');
// Set search term
admin_dashboard_ui.setSearch('users');