- Full auth system with email/password (using phx.gen.auth) - Login, registration, password reset - Session management with remember-me functionality - Magic link login support 2. Organization Management - Multi-tenant organization system - Organizations schema with unique slugs - Automatic organization creation when users register - Organization switcher UI at /orgs 3. Membership System - Users can belong to multiple organizations - 4 permission levels: Owner, Admin, Member, Viewer - Complete permission matrix implemented - Join/leave organizations 4. Invitation System - Email-based invitations with secure tokens - 7-day expiration on invites - Track who invited and who accepted 5. Authorization - Full policy system (Organizations.Policy) - can?(membership, :action, :resource) helper - Enforced via plugs in router 6. LiveView Pages - /orgs - List all your organizations - /orgs/new - Create new organization - /orgs/:slug - Organization dashboard (placeholder) 7. Database Schema - users table - organizations table - organization_memberships table - organization_invitations table - All migrations run successfully
45 lines
1.5 KiB
Text
45 lines
1.5 KiB
Text
<.header>
|
|
Dashboard
|
|
<:subtitle>Welcome to {@current_organization.name}</:subtitle>
|
|
</.header>
|
|
|
|
<div class="mt-8 grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
|
<div class="card bg-base-100 shadow">
|
|
<div class="card-body">
|
|
<h3 class="card-title text-base">Sites</h3>
|
|
<p class="text-3xl font-bold">0</p>
|
|
<p class="text-sm text-base-content/60">Total sites</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card bg-base-100 shadow">
|
|
<div class="card-body">
|
|
<h3 class="card-title text-base">Equipment</h3>
|
|
<p class="text-3xl font-bold">0</p>
|
|
<p class="text-sm text-base-content/60">Total equipment</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card bg-base-100 shadow">
|
|
<div class="card-body">
|
|
<h3 class="card-title text-base">Active Alerts</h3>
|
|
<p class="text-3xl font-bold text-error">0</p>
|
|
<p class="text-sm text-base-content/60">Unacknowledged alerts</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-8">
|
|
<h2 class="text-xl font-semibold mb-4">Quick Actions</h2>
|
|
<div class="flex flex-wrap gap-4">
|
|
<.link navigate={~p"/orgs/#{@current_organization.slug}/sites"} class="btn btn-primary">
|
|
<.icon name="hero-building-office" class="w-5 h-5" /> Manage Sites
|
|
</.link>
|
|
<.link navigate={~p"/orgs/#{@current_organization.slug}/equipment"} class="btn btn-primary">
|
|
<.icon name="hero-server" class="w-5 h-5" /> Manage Equipment
|
|
</.link>
|
|
<.link navigate={~p"/orgs/#{@current_organization.slug}/settings"} class="btn">
|
|
<.icon name="hero-cog-6-tooth" class="w-5 h-5" /> Settings
|
|
</.link>
|
|
</div>
|
|
</div>
|