This commit is contained in:
Halbe Bruno
2025-12-05 19:40:39 -03:00
commit f37bc712e6
4312 changed files with 359196 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
<div class="px-6 py-4 border-b border-gray-100 bg-gray-50">
<h3 class="text-lg font-semibold text-gray-800">Meus Servidores</h3>
</div>
<div class="overflow-x-auto">
<table class="w-full text-left border-collapse">
<thead>
<tr>
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Nome
</th>
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">IP (v4)
</th>
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Serial
Key</th>
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Status
</th>
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Agente
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
<?php if (!empty($servers)): ?>
<?php foreach ($servers as $server): ?>
<?php
$lastSeen = !empty($server['last_seen']) ? strtotime($server['last_seen']) : 0;
$isOnline = $lastSeen && (time() - $lastSeen < 300); // 5 minutes
$lastSeenText = $lastSeen ? date('d/m/Y H:i', $lastSeen) : 'Nunca';
?>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-6 py-4 text-sm font-medium text-gray-900"><?= htmlspecialchars($server['name']) ?>
</td>
<td class="px-6 py-4 text-sm text-gray-500"><?= htmlspecialchars($server['ip_v4']) ?></td>
<td class="px-6 py-4 text-sm text-gray-400 font-mono text-xs">
<div class="flex items-center space-x-2">
<span><?= substr($server['serial_key'], 0, 8) ?>...</span>
<button onclick="navigator.clipboard.writeText('<?= $server['serial_key'] ?>')"
class="text-primary-600 hover:text-primary-800" title="Copiar Serial Completo">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">
</path>
</svg>
</button>
</div>
</td>
<td class="px-6 py-4 text-sm">
<span
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?= $server['status'] == 'active' ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800' ?>">
<?= $server['status'] == 'active' ? 'Ativo' : 'Inativo' ?>
</span>
</td>
<td class="px-6 py-4 text-sm">
<span title="Visto por último: <?= $lastSeenText ?>"
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?= $isOnline ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800' ?>">
<?= $isOnline ? 'Online' : 'Offline' ?>
</span>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="4" class="px-6 py-4 text-center text-gray-500">Nenhum servidor cadastrado.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>