Files
carvalho-finances/neon-handoff/components/HUDStat.vue
T
Mlcavalho1andClaude Sonnet 4.6 acbce4edc0 feat: multi-usuário com autenticação JWT
- Tabela `profiles` + coluna `profile_id` em todas as entidades
  (categories, transactions, recurring_expenses, accounts, player_profile,
   xp_events, player_quests, player_achievements, player_cosmetics)
- Dados existentes migrados para profile_id = 1 (Manoel)
- CLI `./api create-user --name <n> --password <p>` cria perfil com
  seed de categorias e player_profile; faz upsert de senha se já existir
- Auth substituída: cookie+APP_PASSWORD → JWT Bearer 24h (HS256)
- Middleware RequireAuth injeta profile_id no context de todas as rotas
- Todos os repositórios filtram por profile_id do context
- Endpoints: POST /api/auth/login, GET /api/auth/me,
  POST /api/auth/change-password, POST /api/logout
- Frontend: auth store usa localStorage (fc_token/fc_profile),
  api.ts envia Authorization header, LoginView usa campo name
- SettingsView reescrita com troca de senha e logout
- docker-compose.yml: remove APP_USERNAME/APP_PASSWORD, adiciona JWT_SECRET

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-05-27 20:04:44 -03:00

49 lines
1.1 KiB
Vue

<template>
<div class="fc-hud-stat">
<div class="fc-hud-stat__label">{{ label }}</div>
<div class="fc-hud-stat__value">
<span :style="{ color, textShadow: `0 0 8px ${color}66` }">{{ value }}</span>
<span v-if="sub" class="fc-hud-stat__sub">{{ sub }}</span>
</div>
</div>
</template>
<script setup lang="ts">
defineProps<{
/** Short uppercase label, ex: "LV", "XP", "STREAK", "META". */
label: string
/** Main value, displayed in pixel font. */
value: string | number
/** Optional fraction-style suffix, ex: "/4900" or "/40%". */
sub?: string
/** CSS color string (use var(--fc-*) tokens). Default = text color. */
color?: string
}>()
</script>
<style scoped>
.fc-hud-stat {
display: flex;
flex-direction: column;
gap: 2px;
}
.fc-hud-stat__label {
font-family: var(--fc-font-pixel);
font-size: 7px;
color: var(--fc-text-dim);
letter-spacing: .06em;
}
.fc-hud-stat__value {
display: flex;
align-items: baseline;
gap: 4px;
font-family: var(--fc-font-pixel);
font-size: 13px;
}
.fc-hud-stat__sub {
font-family: var(--fc-font-mono);
font-size: 10px;
color: var(--fc-text-dim);
}
</style>