feat: implement advanced access control system with user blocking, rate limiting, and enhanced login security; update UI components for improved user experience and documentation

This commit is contained in:
2025-10-29 09:07:37 -03:00
parent d1715f358a
commit 6b14059fde
33 changed files with 6450 additions and 1202 deletions

View File

@@ -0,0 +1,39 @@
<script lang="ts">
interface Props {
title: string;
value: string | number;
icon?: string;
trend?: {
value: number;
isPositive: boolean;
};
description?: string;
color?: "primary" | "secondary" | "accent" | "success" | "warning" | "error";
}
let { title, value, icon, trend, description, color = "primary" }: Props = $props();
</script>
<div class="stats shadow bg-base-100">
<div class="stat">
<div class="stat-figure text-{color}">
{#if icon}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="inline-block w-8 h-8 stroke-current">
{@html icon}
</svg>
{/if}
</div>
<div class="stat-title">{title}</div>
<div class="stat-value text-{color}">{value}</div>
{#if description}
<div class="stat-desc">{description}</div>
{/if}
{#if trend}
<div class="stat-desc {trend.isPositive ? 'text-success' : 'text-error'}">
{trend.isPositive ? '↗︎' : '↘︎'} {Math.abs(trend.value)}%
</div>
{/if}
</div>
</div>

View File

@@ -0,0 +1,22 @@
<script lang="ts">
interface Props {
ativo: boolean;
bloqueado?: boolean;
}
let { ativo, bloqueado = false }: Props = $props();
const getStatus = () => {
if (bloqueado) return { text: "Bloqueado", class: "badge-error" };
if (ativo) return { text: "Ativo", class: "badge-success" };
return { text: "Inativo", class: "badge-warning" };
};
const status = $derived(getStatus());
</script>
<span class="badge {status.class}">
{status.text}
</span>