Files
bi-agents/public/admin-login.html
root 7ee15ad5e5 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>
2026-02-10 22:30:43 -05:00

193 lines
5.0 KiB
HTML

<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BI Agentes - Admin Login</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<style>
:root {
--primary: #6C3FA0;
--primary-light: #8B5FBF;
--primary-dark: #4A2570;
--bg: #F0F2F5;
--card: #FFFFFF;
--text: #1A1D23;
--text-secondary: #5F6368;
--border: #E8EAED;
--error: #D93025;
--error-bg: #FDE7E7;
--admin-accent: #2E7D32;
--admin-bg: #E8F5E9;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: var(--bg);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
-webkit-font-smoothing: antialiased;
}
.login-container {
width: 100%;
max-width: 400px;
padding: 20px;
}
.login-card {
background: var(--card);
border-radius: 16px;
padding: 40px 36px;
box-shadow: 0 4px 24px rgba(0,0,0,0.08);
border: 1px solid var(--border);
}
.login-header {
text-align: center;
margin-bottom: 32px;
}
.login-header .logo {
width: 56px; height: 56px;
background: linear-gradient(135deg, var(--admin-accent) 0%, #1B5E20 100%);
border-radius: 14px;
display: flex; align-items: center; justify-content: center;
margin: 0 auto 16px;
font-size: 28px;
color: white;
}
.login-header h1 {
font-size: 22px;
font-weight: 800;
color: var(--text);
letter-spacing: -0.5px;
}
.login-header .admin-badge {
display: inline-block;
background: var(--admin-bg);
color: var(--admin-accent);
padding: 4px 12px;
border-radius: 12px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-top: 8px;
}
.login-header p {
font-size: 13px;
color: var(--text-secondary);
margin-top: 10px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.3px;
margin-bottom: 6px;
}
.form-group input {
width: 100%;
padding: 12px 16px;
border: 1.5px solid var(--border);
border-radius: 10px;
font-size: 14px;
font-family: inherit;
color: var(--text);
transition: all 0.15s;
background: white;
}
.form-group input:focus {
outline: none;
border-color: var(--admin-accent);
box-shadow: 0 0 0 3px rgba(46,125,50,0.12);
}
.btn-login {
width: 100%;
padding: 13px;
background: linear-gradient(135deg, var(--admin-accent) 0%, #1B5E20 100%);
color: white;
border: none;
border-radius: 10px;
font-size: 14px;
font-weight: 700;
font-family: inherit;
cursor: pointer;
transition: all 0.15s;
box-shadow: 0 2px 8px rgba(46,125,50,0.3);
margin-top: 4px;
}
.btn-login:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(46,125,50,0.4);
}
.btn-login:active { transform: translateY(0); }
.error-msg {
background: var(--error-bg);
color: var(--error);
padding: 10px 14px;
border-radius: 8px;
font-size: 13px;
font-weight: 500;
margin-bottom: 20px;
display: none;
}
.footer {
text-align: center;
margin-top: 24px;
font-size: 12px;
color: var(--text-secondary);
}
.footer a {
color: var(--primary);
text-decoration: none;
}
.footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="login-container">
<div class="login-card">
<div class="login-header">
<div class="logo">&#x2699;</div>
<h1>BI Agentes</h1>
<span class="admin-badge">Administrador</span>
<p>Painel de Gerenciamento de Agentes</p>
</div>
<div class="error-msg" id="errorMsg"></div>
<form id="loginForm" method="POST" action="/admin/login">
<div class="form-group">
<label>E-mail</label>
<input type="email" name="email" id="email" required placeholder="admin@email.com" autocomplete="email">
</div>
<div class="form-group">
<label>Senha</label>
<input type="password" name="senha" id="senha" required placeholder="Digite sua senha" autocomplete="current-password">
</div>
<button type="submit" class="btn-login">Entrar como Admin</button>
</form>
</div>
<div class="footer">
<a href="/login">Voltar para login de agentes</a>
<br><br>
CambioReal &copy; 2026
</div>
</div>
<script>
const params = new URLSearchParams(window.location.search);
if (params.get('error')) {
const el = document.getElementById('errorMsg');
el.textContent = 'E-mail ou senha incorretos.';
el.style.display = 'block';
}
document.getElementById('email').focus();
</script>
</body>
</html>