Stabilize discovery workflow

This commit is contained in:
2026-05-29 17:16:46 +08:00
parent 15772bc17e
commit 3981ffdf5e
40 changed files with 2039 additions and 211 deletions
+8
View File
@@ -52,6 +52,14 @@ class DeviceRepository
return $row ? Device::fromArray($row) : null;
}
public function findByIp(string $ipAddress): ?Device
{
$stmt = $this->pdo->prepare('SELECT * FROM devices WHERE primary_ip = :ip');
$stmt->execute(['ip' => $ipAddress]);
$row = $stmt->fetch();
return $row ? Device::fromArray($row) : null;
}
public function getCount(): int
{
return (int)$this->pdo->query('SELECT COUNT(*) FROM devices')->fetchColumn();