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 page = Math.max(1, body.page || 1);
const ITEMS_PER_PAGE = body.ITEMS_PER_PAGE || 4; const ITEMS_PER_PAGE = body.ITEMS_PER_PAGE || 4;
// Host-Server mit Paginierung holen
const hosts = await prisma.server.findMany({ const hosts = await prisma.server.findMany({
where: { hostServer: null }, where: { hostServer: 0 },
skip: (page - 1) * ITEMS_PER_PAGE, skip: (page - 1) * ITEMS_PER_PAGE,
take: ITEMS_PER_PAGE, take: ITEMS_PER_PAGE,
orderBy: { name: 'asc' } orderBy: { name: 'asc' }
}); });
// VMs für alle Hosts sammeln
const hostsWithVms = await Promise.all( const hostsWithVms = await Promise.all(
hosts.map(async (host) => ({ hosts.map(async (host) => ({
...host, ...host,

View File

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

15
package-lock.json generated
View File

@@ -4609,6 +4609,21 @@
"optional": true "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"
}
} }
} }
} }