This commit is contained in:
headlessdev
2025-04-18 16:52:14 +02:00
parent 41647a2e6c
commit 8627c54be9
3 changed files with 17 additions and 4 deletions

View File

@@ -12,15 +12,13 @@ export async function POST(request: NextRequest) {
const page = Math.max(1, body.page || 1);
const ITEMS_PER_PAGE = body.ITEMS_PER_PAGE || 4;
// Host-Server mit Paginierung holen
const hosts = await prisma.server.findMany({
where: { hostServer: null },
where: { hostServer: 0 },
skip: (page - 1) * ITEMS_PER_PAGE,
take: ITEMS_PER_PAGE,
orderBy: { name: 'asc' }
});
// VMs für alle Hosts sammeln
const hostsWithVms = await Promise.all(
hosts.map(async (host) => ({
...host,

View File

@@ -585,7 +585,7 @@ export default function Dashboard() {
}
>
{servers
.filter((server) => server.hostServer === null)
.filter((server) => server.hostServer === 0)
.map((server) => (
<Card
key={server.id}