mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-17 15:36:50 +00:00
Add m_cpu, m_gpu, m_ram, m_disk, and m_temp boolean fields to AddRequest and EditRequest interfaces
This commit is contained in:
parent
a2b9d92dd4
commit
1d02f5f237
@ -15,13 +15,17 @@ interface AddRequest {
|
||||
disk: string;
|
||||
monitoring: boolean;
|
||||
monitoringURL: string;
|
||||
|
||||
m_cpu: boolean;
|
||||
m_gpu: boolean;
|
||||
m_ram: boolean;
|
||||
m_disk: boolean;
|
||||
m_temp: boolean;
|
||||
}
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const body: AddRequest = await request.json();
|
||||
const { host, hostServer, name, icon, os, ip, url, cpu, gpu, ram, disk, monitoring, monitoringURL } = body;
|
||||
const { host, hostServer, name, icon, os, ip, url, cpu, gpu, ram, disk, monitoring, monitoringURL, m_cpu, m_gpu, m_ram, m_disk, m_temp } = body;
|
||||
|
||||
const server = await prisma.server.create({
|
||||
data: {
|
||||
@ -37,7 +41,12 @@ export async function POST(request: NextRequest) {
|
||||
ram,
|
||||
disk,
|
||||
monitoring,
|
||||
monitoringURL
|
||||
monitoringURL,
|
||||
m_cpu,
|
||||
m_gpu,
|
||||
m_ram,
|
||||
m_disk,
|
||||
m_temp
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -16,12 +16,17 @@ interface EditRequest {
|
||||
disk: string;
|
||||
monitoring: boolean;
|
||||
monitoringURL: string;
|
||||
m_cpu: boolean;
|
||||
m_gpu: boolean;
|
||||
m_ram: boolean;
|
||||
m_disk: boolean;
|
||||
m_temp: boolean;
|
||||
}
|
||||
|
||||
export async function PUT(request: NextRequest) {
|
||||
try {
|
||||
const body: EditRequest = await request.json();
|
||||
const { host, hostServer, id, name, icon, os, ip, url, cpu, gpu, ram, disk, monitoring, monitoringURL } = body;
|
||||
const { host, hostServer, id, name, icon, os, ip, url, cpu, gpu, ram, disk, monitoring, monitoringURL, m_cpu, m_gpu, m_ram, m_disk, m_temp } = body;
|
||||
|
||||
const existingServer = await prisma.server.findUnique({ where: { id } });
|
||||
if (!existingServer) {
|
||||
@ -50,7 +55,12 @@ export async function PUT(request: NextRequest) {
|
||||
ram,
|
||||
disk,
|
||||
monitoring,
|
||||
monitoringURL
|
||||
monitoringURL,
|
||||
m_cpu,
|
||||
m_gpu,
|
||||
m_ram,
|
||||
m_disk,
|
||||
m_temp
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user