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}

15
package-lock.json generated
View File

@ -4609,6 +4609,21 @@
"optional": true
}
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "15.3.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.3.0.tgz",
"integrity": "sha512-vHUQS4YVGJPmpjn7r5lEZuMhK5UQBNBRSB+iGDvJjaNk649pTIcRluDWNb9siunyLLiu/LDPHfvxBtNamyuLTw==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
}
}
}