diff --git a/apps/backend/src/jobs/search-indexer.ts b/apps/backend/src/jobs/search-indexer.ts index 00ccb7a4..0b4bdecf 100644 --- a/apps/backend/src/jobs/search-indexer.ts +++ b/apps/backend/src/jobs/search-indexer.ts @@ -67,6 +67,29 @@ export async function runSearchItemsIndexing() { }); } + const sshHosts = await pb.collection("monitoringHosts").getFullList(500, { + filter: `userId="${escapeFilter(userId)}" && type="ssh"`, + sort: "name", + }).catch(() => [] as Array>); + + for (const host of sshHosts) { + const hostId = String(host?.id ?? "").trim(); + const hostname = String(host?.hostname ?? "").trim(); + if (!hostId || !hostname) continue; + + const name = String(host?.name ?? "").trim() || hostname; + rows.push({ + name, + icon: "fa6-solid:terminal", + secondary: `SSH - ${hostname}${host?.port ? `:${host.port}` : ""}`, + action: `url:/apps/monitoring/ssh?host=${encodeURIComponent(hostId)}`, + app: "", + tags: [name, hostname, "ssh"], + sourceId: `monitoring-ssh-host:${hostId}`, + sourceUpdated: String(host?.updated ?? ""), + }); + } + const enabledIntegrations = await getEnabledIntegrationsMap(pb, userId); const integrations = await pb.collection("integrations").getFullList(500, { filter: `user=\"${userId.replace(/"/g, '\\\"')}\"`, @@ -418,4 +441,4 @@ function serializeShortcutAction(action: unknown): string { } } return ""; -} \ No newline at end of file +}