Add icon field to AddRequest and EditRequest interfaces, and update Dashboard component to support icon selection and display. Enhanced server creation and editing functionality with icon integration.

This commit is contained in:
headlessdev
2025-04-19 15:46:01 +02:00
parent b655b7fe2d
commit 3580f7f640
3 changed files with 130 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ interface EditRequest {
hostServer: number;
id: number;
name: string;
icon: string;
os: string;
ip: string;
url: string;
@@ -18,7 +19,7 @@ interface EditRequest {
export async function PUT(request: NextRequest) {
try {
const body: EditRequest = await request.json();
const { host, hostServer, id, name, os, ip, url, cpu, gpu, ram, disk } = body;
const { host, hostServer, id, name, icon, os, ip, url, cpu, gpu, ram, disk } = body;
const existingServer = await prisma.server.findUnique({ where: { id } });
if (!existingServer) {
@@ -38,6 +39,7 @@ export async function PUT(request: NextRequest) {
host,
hostServer: newHostServer,
name,
icon,
os,
ip,
url,