feat: trading terminal live rates + fix spread negativo + fix USD→BRL

- Adiciona widget de cotações ao vivo (USD/BRL e EUR/BRL) com design
  estilo terminal de trading (dark theme, tipografia mono, glow effects)
- Proxy server-side /api/cotacao com cache 3s e token AwesomeAPI
- Auto-refresh a cada 3 segundos apenas quando a página está aberta
- Corrige cálculo de spread negativo: remove Math.abs() em USD→BRL
  e Math.max(0,...) no spread líquido
- Corrige seção USD→BRL que não aparecia (filtro status !== 'finalizado')
- Corrige valor_reais no fluxo USD→BRL: agora calcula valor * cotação
- Adiciona classe CSS spread-negative para destacar spreads negativos
- Bandeiras de fluxo (BR/US/EU) nos botões de compra e venda

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-10 22:30:43 -05:00
parent 1ad28f54dd
commit 7ee15ad5e5
12 changed files with 1285 additions and 436 deletions

View File

@@ -16,7 +16,9 @@ if [ -n "$NETBIRD_SETUP_KEY" ]; then
sleep 3
# Connect using setup key and management URL
netbird up --setup-key "$NETBIRD_SETUP_KEY" --management-url "$MGMT_URL" &
# Use custom hostname for stable DNS name (default: bi-ccc)
NETBIRD_HOSTNAME="${NETBIRD_HOSTNAME:-bi-ccc}"
netbird up --setup-key "$NETBIRD_SETUP_KEY" --management-url "$MGMT_URL" --hostname "$NETBIRD_HOSTNAME" &
# Wait for connection
echo "Waiting for Netbird connection..."
@@ -24,6 +26,11 @@ if [ -n "$NETBIRD_SETUP_KEY" ]; then
# Check connection status
netbird status || echo "Netbird connection pending..."
# Add route for local network to bypass VPN tunnel
# This ensures responses to LAN clients go via Docker bridge, not VPN
echo "Adding local network route..."
ip route add 192.168.88.0/24 via 172.23.0.1 dev eth0 2>/dev/null || true
else
echo "WARNING: NETBIRD_SETUP_KEY not set. Database connection may fail."
fi