feat: design system unificado com template e cores CambioReal
- Cria src/ui-template.js com header, footer e estilos compartilhados - Atualiza admin-home.js e admin-panel.js para usar template - Atualiza dashboard.js com logo e cores CambioReal (#7600be) - Atualiza login.html com novo branding BI-CCC - Adiciona public/logo.png (CambioReal original) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* Admin Home Dashboard - Fast daily overview
|
||||
* 3 flows: BRL→USD, USD→BRL, USD→USD (balance)
|
||||
*/
|
||||
const { buildHeader, buildFooter, buildHead } = require('./ui-template');
|
||||
|
||||
function buildAdminHomeHTML(stats, admin) {
|
||||
const now = new Date().toLocaleString('pt-BR');
|
||||
@@ -23,64 +24,9 @@ function buildAdminHomeHTML(stats, admin) {
|
||||
const totalOntem = stats.brlUsd.ontem.qtd + stats.usdBrl.ontem.qtd + stats.usdUsd.ontem.qtd;
|
||||
const totalVar = calcVar(totalHoje, totalOntem);
|
||||
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>BI - CCC - Home</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--primary: #6C3FA0;
|
||||
--bg: #F0F2F5;
|
||||
--card: #FFFFFF;
|
||||
--text: #1A1D23;
|
||||
--text-secondary: #5F6368;
|
||||
--text-muted: #9AA0A6;
|
||||
--border: #E8EAED;
|
||||
--green: #1E8E3E;
|
||||
--green-bg: #E6F4EA;
|
||||
--blue: #1A73E8;
|
||||
--blue-bg: #E8F0FE;
|
||||
--orange: #E8710A;
|
||||
--orange-bg: #FEF3E8;
|
||||
--purple: #7B1FA2;
|
||||
--purple-bg: #F3E5F5;
|
||||
--red: #D93025;
|
||||
--admin-accent: #2E7D32;
|
||||
}
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, sans-serif;
|
||||
background: var(--bg); color: var(--text); line-height: 1.5;
|
||||
}
|
||||
.header {
|
||||
background: linear-gradient(135deg, var(--admin-accent) 0%, #1B5E20 100%);
|
||||
color: white; padding: 24px 40px;
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
box-shadow: 0 2px 8px rgba(27,94,32,0.3);
|
||||
}
|
||||
.header h1 { font-size: 24px; font-weight: 800; }
|
||||
.header .subtitle { font-size: 13px; opacity: 0.8; margin-top: 4px; }
|
||||
.header-right { display: flex; align-items: center; gap: 12px; }
|
||||
.badge {
|
||||
background: rgba(255,255,255,0.15); padding: 8px 16px;
|
||||
border-radius: 24px; font-size: 12px; font-weight: 600;
|
||||
}
|
||||
.btn {
|
||||
padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600;
|
||||
cursor: pointer; text-decoration: none; font-family: inherit;
|
||||
transition: all 0.15s; border: 1px solid rgba(255,255,255,0.3);
|
||||
background: rgba(255,255,255,0.15); color: white;
|
||||
}
|
||||
.btn:hover { background: rgba(255,255,255,0.25); }
|
||||
.btn-blue { background: #1A73E8; border-color: #1A73E8; }
|
||||
.btn-blue:hover { background: #1557B0; }
|
||||
|
||||
.container { padding: 28px 40px; max-width: 1600px; margin: 0 auto; }
|
||||
|
||||
const pageCSS = `
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
|
||||
<style>
|
||||
.date-banner {
|
||||
background: var(--card); border-radius: 12px; padding: 16px 24px;
|
||||
margin-bottom: 24px; border: 1px solid var(--border);
|
||||
@@ -107,7 +53,7 @@ function buildAdminHomeHTML(stats, admin) {
|
||||
font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 12px;
|
||||
}
|
||||
.kpi-badge.up { background: var(--green-bg); color: var(--green); }
|
||||
.kpi-badge.down { background: #FDE7E7; color: var(--red); }
|
||||
.kpi-badge.down { background: var(--red-bg); color: var(--red); }
|
||||
.kpi-badge.neutral { background: var(--blue-bg); color: var(--blue); }
|
||||
.kpi-value { font-size: 36px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
|
||||
.kpi-sub { font-size: 13px; color: var(--text-muted); }
|
||||
@@ -152,52 +98,26 @@ function buildAdminHomeHTML(stats, admin) {
|
||||
.detail-value.green { color: var(--green); }
|
||||
.detail-value.red { color: var(--red); }
|
||||
|
||||
.nav-links {
|
||||
display: flex; gap: 12px; margin-top: 28px;
|
||||
}
|
||||
.nav-card {
|
||||
flex: 1; background: var(--card); border-radius: 12px; padding: 20px;
|
||||
border: 1px solid var(--border); text-decoration: none; color: var(--text);
|
||||
transition: all 0.15s; display: flex; align-items: center; gap: 16px;
|
||||
}
|
||||
.nav-card:hover { border-color: var(--admin-accent); box-shadow: 0 4px 12px rgba(46,125,50,0.1); }
|
||||
.nav-card .icon {
|
||||
width: 48px; height: 48px; border-radius: 12px; background: var(--green-bg);
|
||||
display: flex; align-items: center; justify-content: center; font-size: 24px;
|
||||
}
|
||||
.nav-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
|
||||
.nav-card p { font-size: 12px; color: var(--text-secondary); }
|
||||
|
||||
.footer { text-align: center; padding: 24px; font-size: 12px; color: var(--text-muted); }
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.kpi-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
.detail-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.container { padding: 20px; }
|
||||
.header { padding: 20px; flex-direction: column; gap: 12px; }
|
||||
.kpi-grid, .charts-grid { grid-template-columns: 1fr; }
|
||||
.nav-links { flex-direction: column; }
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
`;
|
||||
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
${buildHead('Home', pageCSS)}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<div>
|
||||
<h1>BI - CCC</h1>
|
||||
<div class="subtitle">CambioReal Central Command</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<div class="badge">Admin: ${admin.nome}</div>
|
||||
<a href="/admin/agentes" class="btn">Gerenciar Agentes</a>
|
||||
<a href="/admin/dashboard" class="btn btn-blue">Dashboard Completo</a>
|
||||
<a href="/logout" class="btn">Sair</a>
|
||||
</div>
|
||||
</div>
|
||||
${buildHeader({ role: 'admin', userName: admin.nome, activePage: 'home' })}
|
||||
|
||||
<div class="container">
|
||||
<div class="app-container">
|
||||
<div class="date-banner">
|
||||
<h2>${hoje}</h2>
|
||||
<div class="time">Atualizado: ${now}</div>
|
||||
@@ -320,26 +240,9 @@ function buildAdminHomeHTML(stats, admin) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nav-links">
|
||||
<a href="/admin/dashboard" class="nav-card">
|
||||
<div class="icon">📈</div>
|
||||
<div>
|
||||
<h4>Dashboard Completo</h4>
|
||||
<p>Analise detalhada com graficos e filtros</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="/admin/agentes" class="nav-card">
|
||||
<div class="icon">👥</div>
|
||||
<div>
|
||||
<h4>Gerenciar Agentes</h4>
|
||||
<p>Cadastro, edicao e emulacao de agentes</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer">BI - CCC - CambioReal Central Command</div>
|
||||
${buildFooter()}
|
||||
|
||||
<script>
|
||||
const stats = ${JSON.stringify(stats)};
|
||||
|
||||
Reference in New Issue
Block a user