Fixed 10 text-styled action buttons across 7 files: Agent Management: - Delete Agent buttons (2x) → danger variant - View Setup links (already fixed) → secondary variant Organization Settings: - Remove Member button → danger variant Admin Pages: - Edit Overrides button → secondary variant - Delete Organization button → danger variant - Remove IP/CIDR button → danger variant - Delete User button → danger variant Device Management: - Delete Backup button → danger variant All action buttons now use proper .button component with appropriate variants (danger for destructive actions, secondary for neutral actions). This provides consistent visual hierarchy and makes destructive actions more clearly identifiable.
45 lines
1.9 KiB
Text
45 lines
1.9 KiB
Text
<Layouts.admin flash={@flash} timezone={@timezone}>
|
|
<div class="space-y-6">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-gray-900 dark:text-white">{t("All Users")}</h1>
|
|
<p class="text-gray-600 dark:text-gray-400">Manage system users</p>
|
|
</div>
|
|
|
|
<div class="bg-white dark:bg-gray-800/50 rounded-lg border border-gray-200 dark:border-white/10">
|
|
<.table id="users" rows={@users}>
|
|
<:col :let={user} label={t("Email")}>{user.email}</:col>
|
|
<:col :let={user} label={t("Superuser")}>
|
|
{if user.is_superuser, do: "Yes", else: "No"}
|
|
</:col>
|
|
<:col :let={user} label={t("Organizations")}>{length(user.organizations)}</:col>
|
|
<:col :let={user} label={t("Devices")}>{user.device_count || 0}</:col>
|
|
<:col :let={user} label={t("Joined")}>
|
|
{ToweropsWeb.TimeHelpers.format_date(user.inserted_at, @timezone)}
|
|
</:col>
|
|
<:col :let={user} label="">
|
|
<div class="flex gap-2">
|
|
<form action={~p"/admin/impersonate/#{user.id}"} method="post">
|
|
<input type="hidden" name="_csrf_token" value={Phoenix.Controller.get_csrf_token()} />
|
|
<button
|
|
type="submit"
|
|
disabled={user.id == @current_scope.user.id}
|
|
class="text-sm text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 disabled:text-gray-400 disabled:cursor-not-allowed"
|
|
>
|
|
{t("Impersonate")}
|
|
</button>
|
|
</form>
|
|
<.button
|
|
phx-click="delete_user"
|
|
phx-value-id={user.id}
|
|
data-confirm={t("Are you sure you want to delete this user?")}
|
|
disabled={user.is_superuser}
|
|
variant="danger"
|
|
>
|
|
{t("Delete")}
|
|
</.button>
|
|
</div>
|
|
</:col>
|
|
</.table>
|
|
</div>
|
|
</div>
|
|
</Layouts.admin>
|