Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions app/(control)/admin/fleet/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ export default async function AdminFleetPage() {
);
}

// Scope the reads to the tenants we'll actually render (the registry), so orphaned/decommissioned
// rows don't get loaded as the fleet grows (Gemini review on #71).
const tenantSlugs = registry.tenants.map((t) => t.slug);
const [devices, summaries] = await Promise.all([
db.fleetDevice.findMany({ orderBy: [{ tenantSlug: "asc" }, { label: "asc" }] }),
db.fleetSummary.findMany(),
db.fleetDevice.findMany({
where: { tenantSlug: { in: tenantSlugs } },
orderBy: [{ tenantSlug: "asc" }, { label: "asc" }],
}),
db.fleetSummary.findMany({ where: { tenantSlug: { in: tenantSlugs } } }),
]);
Comment thread
mahmutkaya marked this conversation as resolved.

const devicesBySlug = new Map<string, FleetDeviceRow[]>();
Expand Down
Loading