From 38e4bbea7f6b40fe607b2f9957206652c0d06803 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Tue, 28 Oct 2025 11:52:27 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20restaurar=20utilit=C3=A1rios=20de=20aces?= =?UTF-8?q?so=20remoto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/machines/admin-machines-overview.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/admin/machines/admin-machines-overview.tsx b/src/components/admin/machines/admin-machines-overview.tsx index cf4f089..49c7936 100644 --- a/src/components/admin/machines/admin-machines-overview.tsx +++ b/src/components/admin/machines/admin-machines-overview.tsx @@ -249,6 +249,15 @@ type MachineRemoteAccessEntry = { metadata: Record | null } +export type MachineRemoteAccess = { + provider: string | null + identifier: string | null + url: string | null + notes: string | null + lastVerifiedAt: number | null + metadata: Record | null +} + function collectInitials(name: string): string { const words = name.split(/\s+/).filter(Boolean) if (words.length === 0) return "?" @@ -309,7 +318,7 @@ function normalizeMachineRemoteAccessEntry(raw: unknown): MachineRemoteAccessEnt id: null, clientId: createRemoteAccessClientId(), provider: null, - identifier: trimmed, + identifier: isUrl ? null : trimmed, url: isUrl ? trimmed : null, notes: null, lastVerifiedAt: null, @@ -341,6 +350,13 @@ function normalizeMachineRemoteAccessEntry(raw: unknown): MachineRemoteAccessEnt } } +export function normalizeMachineRemoteAccess(raw: unknown): MachineRemoteAccess | null { + const entry = normalizeMachineRemoteAccessEntry(raw) + if (!entry) return null + const { provider, identifier, url, notes, lastVerifiedAt, metadata } = entry + return { provider, identifier, url, notes, lastVerifiedAt, metadata } +} + export function normalizeMachineRemoteAccessList(raw: unknown): MachineRemoteAccessEntry[] { if (!raw) return [] const source = Array.isArray(raw) ? raw : [raw]