Integração Pangolin Proxy

This commit is contained in:
2025-12-06 21:11:34 -03:00
parent dc7c446254
commit 5291d8ccae
2008 changed files with 1062 additions and 477 deletions

View File

@@ -34,8 +34,21 @@
<?php foreach ($servers as $server): ?>
<?php
$lastSeen = !empty($server['last_seen']) ? strtotime($server['last_seen']) : 0;
$isOnline = $lastSeen && (time() - $lastSeen < 300); // 5 minutes
// Servidor só está online se está ATIVO e foi visto nos últimos 5 minutos
$isOnline = $server['status'] === 'active' && $lastSeen && (time() - $lastSeen < 300);
$lastSeenText = $lastSeen ? date('d/m/Y H:i', $lastSeen) : 'Nunca';
// Define a cor do badge do agente
if ($server['status'] !== 'active') {
$agentClass = 'bg-gray-100 text-gray-600';
$agentText = 'Inativo';
} elseif ($isOnline) {
$agentClass = 'bg-green-100 text-green-800';
$agentText = 'Online';
} else {
$agentClass = 'bg-red-100 text-red-800';
$agentText = 'Offline';
}
?>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-6 py-4 text-sm font-medium text-gray-900"><?= htmlspecialchars($server['name']) ?>
@@ -64,8 +77,8 @@
</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' ?>
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?= $agentClass ?>">
<?= $agentText ?>
</span>
</td>
<td class="px-6 py-4 text-sm font-medium">