| <!doctype html>
|
| <html lang="pt-BR">
|
| <head>
|
| <meta charset="utf-8" />
|
| <meta name="viewport" content="width=device-width" />
|
| <title>Agentes ATCoin Token</title>
|
| <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| </head>
|
| <body class="bg-gray-100 text-gray-900">
|
| <div class="max-w-6xl mx-auto py-8 px-4">
|
| <h1 class="text-4xl font-bold text-center mb-8">Agentes da Inteligência Artificial — AIBANK Token</h1>
|
| <div class="bg-white rounded-xl shadow-md p-6 overflow-x-auto">
|
| <table class="w-full text-left border-collapse">
|
| <thead>
|
| <tr class="bg-gray-800 text-white">
|
| <th class="p-2">Agente</th>
|
| <th class="p-2">Status</th>
|
| <th class="p-2">Última Ação</th>
|
| <th class="p-2">Próxima Execução</th>
|
| <th class="p-2">Resultado</th>
|
| </tr>
|
| </thead>
|
| <tbody id="agentes-body"></tbody>
|
| </table>
|
| </div>
|
|
|
| <div class="mt-12">
|
| <h2 class="text-2xl font-semibold text-center mb-4">Performance dos Agentes</h2>
|
| <canvas id="grafico-retorno" class="w-full max-w-4xl mx-auto"></canvas>
|
| </div>
|
| </div>
|
|
|
| <script>
|
| async function carregarDados() {
|
| try {
|
| const resposta = await fetch('data.json');
|
| const agentes = await resposta.json();
|
| const tabela = document.getElementById('agentes-body');
|
| const nomes = [];
|
| const resultados = [];
|
|
|
| tabela.innerHTML = '';
|
| agentes.forEach(agente => {
|
| nomes.push(agente.nome);
|
| resultados.push(parseFloat(agente.resultado.replace('%', '').replace('+', '')));
|
| tabela.innerHTML += `
|
| <tr class="border-b hover:bg-gray-100 transition">
|
| <td class="p-2 font-medium">${agente.nome}</td>
|
| <td class="p-2">${agente.status}</td>
|
| <td class="p-2">${agente.ultima_acao}</td>
|
| <td class="p-2">${agente.proxima_execucao}</td>
|
| <td class="p-2">${agente.resultado}</td>
|
| </tr>`;
|
| });
|
|
|
| desenharGrafico(nomes, resultados);
|
| } catch (erro) {
|
| console.error("Erro ao carregar dados:", erro);
|
| }
|
| }
|
|
|
| function desenharGrafico(labels, data) {
|
| const ctx = document.getElementById('grafico-retorno').getContext('2d');
|
| if (window.myChart) {
|
| window.myChart.destroy();
|
| }
|
| window.myChart = new Chart(ctx, {
|
| type: 'bar',
|
| data: {
|
| labels,
|
| datasets: [{
|
| label: 'ROI (%)',
|
| data,
|
| backgroundColor: 'rgba(59, 130, 246, 0.7)',
|
| borderColor: 'rgba(37, 99, 235, 1)',
|
| borderWidth: 1
|
| }]
|
| },
|
| options: {
|
| responsive: true,
|
| scales: {
|
| y: { beginAtZero: true }
|
| },
|
| animation: {
|
| duration: 1000,
|
| easing: 'easeOutBounce'
|
| }
|
| }
|
| });
|
| }
|
|
|
| carregarDados();
|
| setInterval(carregarDados, 60000);
|
| </script>
|
| </body>
|
| </html>
|
|
|