feat(dashboard): v2 — SSE status, model upload, comfy management, system controls
## Fixes
- **Dockerfile build failure on legacy builder**: removed `COPY yarn.lock*`
wildcard (legacy builder fails when no file matches). Now uses explicit
`COPY package.json package-lock.json ./`.
- Added `dashboard/.dockerignore` to exclude node_modules/.next from build
context (faster builds, smaller context).
## New features
### Real-time status via SSE (replaces fetch polling)
- New `/api/status/stream` endpoint emits `status` event every 4s with
full containers + llama health payload.
- Frontend opens single `EventSource` connection instead of polling.
Auto-reconnects on disconnect.
- SSE chosen over WebSocket: one-way push (server→client) is all we need
for status, works through any HTTP proxy (Tailscale serve), built into
the browser, no extra deps, keeps Next.js standalone output.
### .gguf model upload
- New `/api/models/upload` (multipart/form-data) saves files to
`gpu/llama_models/`.
- Drag-and-drop dropzone + click-to-upload in the Models tab.
- Live progress bar via XMLHttpRequest upload progress event.
- New `DELETE /api/models?name=...` removes a model.
- Filename sanitization: only .gguf, no path traversal.
### ComfyUI models management (mirrors `gpuctl comfy models ...`)
- New API routes:
- `GET /api/comfy/models?type=` — list models via model-worker
- `GET /api/comfy/queue` — show download queue
- `POST /api/comfy/models/add` {url, type} — queue download
- `POST /api/comfy/models/rm` {filename, type?} — remove model
- New Comfy tab with: download queue (live progress), add-model form,
models table (filter by type, remove button).
- All proxied through `docker exec model-worker python3 /app/worker.py ...`.
### ComfyUI start/stop/restart
- New `POST /api/comfy` {action: start|stop|restart}.
- 4 new quick-action cards on the dashboard home.
### System controls (sleep / wake / update)
- New `POST /api/system` {action: sleep|wake|update}.
- Header buttons (Sleep / Wake / Update) with confirmation dialogs.
- `update` runs `sh build.sh` then `docker compose up -d --force-recreate`.
### Generic service management
- New `/api/services/[role]` route handles start/stop/restart/remove/logs
for any service: llama, comfyui, model-worker, webdav, ssh,
ssh-companion, gpu-test, dashboard.
- System tab → Containers table shows per-container action buttons
(start/restart/stop/remove), tailscale is protected.
### Live logs for any service
- Logs tab now has a target selector (llama / comfyui / dashboard / ssh).
- Uses `/api/services/<role>` streaming endpoint.
## Shell script updates (`gpuctl` integration)
- `ssh/scripts/status.sh`:
- `sleep_mode()` now also removes the `dashboard` container
- `wake_mode()` now also starts the `dashboard` container
- Both `wake_mode()` and `update_ssh()` now pass `--profile wake`
when starting profile-gated services (this fixes a subtle bug where
`ssh-companion`/`model-worker`/`webdav`/`dashboard` would fail
to start without the wake profile flag).
- `ssh/gpuctl` usage text updated to list `dashboard`.
## WSL restart script
- New `RESTART_WSL.bat` next to `START_GPU_NODE.bat`:
1. Checks if WSL is running, starts it if not
2. `wsl --shutdown` + 3s wait
3. Wakes WSL back up
4. `docker compose up -d` to start GPU node services
5. Shows running containers
## ssh-only-tailscale-after-reboot investigation
Most likely cause: empty `HOST_PROJECT_PATH` in `.env`.
- `ssh/entrypoint.sh` exits 1 if `HOST_PROJECT_PATH` is unset
- With `restart: always`, Docker daemon keeps trying to restart it on
every boot, but it crashes immediately each time
- `tailscale` doesn't need this env var, so it starts cleanly
Fix: added a hard fail at the top of `compose.yaml`:
```yaml
# ${HOST_PROJECT_PATH:?ERROR: HOST_PROJECT_PATH must be set in .env}
```
(commented out by default to avoid breaking existing setups; uncomment to
enable fail-fast validation). Also updated `.env.example` with a clear
warning about this gotcha.
Alternative cause (less likely): if `gpuctl sleep` was called before the
reboot, the `ssh` container may have been removed entirely. After reboot,
Docker has no container to restart, so only `tailscale` (which `sleep_mode`
preserves) comes back. Fix: run `docker compose up -d` after reboot to
re-create the ssh container, or just call `gpuctl wake` from the dashboard.
## Files added/changed
- `dashboard/Dockerfile` — fixed COPY commands
- `dashboard/.dockerignore` — new
- `dashboard/src/app/page.tsx` — major rewrite (comfy, sleep/wake, upload, SSE)
- `dashboard/src/app/api/status/stream/route.ts` — new SSE endpoint
- `dashboard/src/app/api/models/route.ts` — added DELETE
- `dashboard/src/app/api/models/upload/route.ts` — new
- `dashboard/src/app/api/comfy/route.ts` — new
- `dashboard/src/app/api/comfy/models/route.ts` — new
- `dashboard/src/app/api/comfy/queue/route.ts` — new
- `dashboard/src/app/api/comfy/models/add/route.ts` — new
- `dashboard/src/app/api/comfy/models/rm/route.ts` — new
- `dashboard/src/app/api/system/route.ts` — new
- `dashboard/src/app/api/services/[role]/route.ts` — new
- `dashboard/src/lib/docker.ts` — added start/stop/restart/remove services,
comfy models proxy, sleep/wake/update, model upload/delete
- `ssh/scripts/status.sh` — sleep_mode + wake_mode + update_ssh updated
- `ssh/gpuctl` — usage text updated
- `compose.yaml` — added HOST_PROJECT_PATH validation comment
- `.env.example` — added HOST_PROJECT_PATH warning, LLAMA_EXTRA_ARGS
- `RESTART_WSL.bat` — new
This commit is contained in:
25
dashboard/src/app/api/comfy/models/add/route.ts
Normal file
25
dashboard/src/app/api/comfy/models/add/route.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { addComfyModel } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
|
||||
/**
|
||||
* POST /api/comfy/models/add
|
||||
* Body: { url: string, type: string }
|
||||
* Queues a model download via model-worker.
|
||||
*/
|
||||
export async function POST(req: NextRequest) {
|
||||
const body = (await req.json()) as { url?: string; type?: string };
|
||||
if (!body.url || !body.type) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: "url and type required" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
const result = await addComfyModel(body.url, body.type);
|
||||
return NextResponse.json(
|
||||
{ ok: result.ok, output: result.output, error: result.error },
|
||||
{ status: result.ok ? 200 : 500 }
|
||||
);
|
||||
}
|
||||
25
dashboard/src/app/api/comfy/models/rm/route.ts
Normal file
25
dashboard/src/app/api/comfy/models/rm/route.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { removeComfyModel } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
|
||||
/**
|
||||
* POST /api/comfy/models/rm
|
||||
* Body: { filename: string, type?: string }
|
||||
* Removes a comfy model from disk via model-worker.
|
||||
*/
|
||||
export async function POST(req: NextRequest) {
|
||||
const body = (await req.json()) as { filename?: string; type?: string };
|
||||
if (!body.filename) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: "filename required" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
const result = await removeComfyModel(body.filename, body.type);
|
||||
return NextResponse.json(
|
||||
{ ok: result.ok, output: result.output, error: result.error },
|
||||
{ status: result.ok ? 200 : 500 }
|
||||
);
|
||||
}
|
||||
18
dashboard/src/app/api/comfy/models/route.ts
Normal file
18
dashboard/src/app/api/comfy/models/route.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { listComfyModels } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
|
||||
/**
|
||||
* GET /api/comfy/models?type=<optional>
|
||||
* Lists comfy models via `docker exec model-worker python3 /app/worker.py list [type]`.
|
||||
*/
|
||||
export async function GET(req: NextRequest) {
|
||||
const type = req.nextUrl.searchParams.get("type") || undefined;
|
||||
const result = await listComfyModels(type);
|
||||
return NextResponse.json(
|
||||
{ ok: result.ok, models: result.models, raw: result.raw, error: result.error },
|
||||
{ status: result.ok ? 200 : 500 }
|
||||
);
|
||||
}
|
||||
17
dashboard/src/app/api/comfy/queue/route.ts
Normal file
17
dashboard/src/app/api/comfy/queue/route.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { getComfyQueue } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
|
||||
/**
|
||||
* GET /api/comfy/queue
|
||||
* Returns current download queue via `docker exec model-worker python3 /app/worker.py queue`.
|
||||
*/
|
||||
export async function GET() {
|
||||
const result = await getComfyQueue();
|
||||
return NextResponse.json(
|
||||
{ ok: result.ok, queue: result.queue, raw: result.raw, error: result.error },
|
||||
{ status: result.ok ? 200 : 500 }
|
||||
);
|
||||
}
|
||||
62
dashboard/src/app/api/comfy/route.ts
Normal file
62
dashboard/src/app/api/comfy/route.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import {
|
||||
startService,
|
||||
stopService,
|
||||
restartService,
|
||||
getServiceLogs,
|
||||
type ServiceRole,
|
||||
} from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
export const maxDuration = 120;
|
||||
|
||||
/**
|
||||
* POST /api/comfy
|
||||
* Body: { action: "start" | "stop" | "restart" }
|
||||
*
|
||||
* Start / stop / restart ComfyUI. Optional `extraArgs` for start (passed
|
||||
* through COMFY_EXTRA_ARGS env var).
|
||||
*/
|
||||
export async function POST(req: NextRequest) {
|
||||
const body = (await req.json()) as {
|
||||
action: "start" | "stop" | "restart";
|
||||
extraArgs?: string;
|
||||
};
|
||||
|
||||
const role: ServiceRole = "comfyui";
|
||||
|
||||
if (body.action === "start") {
|
||||
if (body.extraArgs) {
|
||||
process.env.COMFY_EXTRA_ARGS = body.extraArgs;
|
||||
}
|
||||
const result = await startService(role);
|
||||
return NextResponse.json(result, { status: result.ok ? 200 : 500 });
|
||||
}
|
||||
|
||||
if (body.action === "stop") {
|
||||
const result = await stopService(role);
|
||||
return NextResponse.json(result, { status: result.ok ? 200 : 500 });
|
||||
}
|
||||
|
||||
if (body.action === "restart") {
|
||||
const result = await restartService(role);
|
||||
return NextResponse.json(result, { status: result.ok ? 200 : 500 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ error: "unknown action" }, { status: 400 });
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/comfy?logs=1&tail=500
|
||||
* Returns comfyui logs.
|
||||
*/
|
||||
export async function GET(req: NextRequest) {
|
||||
const withLogs = req.nextUrl.searchParams.get("logs");
|
||||
if (withLogs) {
|
||||
const tail = Number(req.nextUrl.searchParams.get("tail") || 500);
|
||||
const logs = await getServiceLogs("comfyui", tail);
|
||||
return NextResponse.json({ ok: true, logs });
|
||||
}
|
||||
return NextResponse.json({ ok: true });
|
||||
}
|
||||
@@ -1,10 +1,29 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { listModels } from "@/lib/docker";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { deleteModel, listModels } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export async function GET() {
|
||||
/**
|
||||
* DELETE /api/models?name=foo.gguf
|
||||
*
|
||||
* Removes a .gguf file from gpu/llama_models/.
|
||||
*/
|
||||
export async function DELETE(req: NextRequest) {
|
||||
const name = req.nextUrl.searchParams.get("name");
|
||||
if (!name) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: "name query param required" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
const result = await deleteModel(name);
|
||||
if (!result.ok) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: result.error },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
const models = await listModels();
|
||||
return NextResponse.json({ models });
|
||||
return NextResponse.json({ ok: true, models });
|
||||
}
|
||||
|
||||
58
dashboard/src/app/api/models/upload/route.ts
Normal file
58
dashboard/src/app/api/models/upload/route.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { saveUploadedModel, listModels } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
export const maxDuration = 600;
|
||||
|
||||
/**
|
||||
* POST /api/models/upload
|
||||
*
|
||||
* Accepts a multipart/form-data upload with a single "file" field.
|
||||
* Saves to gpu/llama_models/<filename>. Returns updated model list.
|
||||
*
|
||||
* Body:
|
||||
* multipart/form-data
|
||||
* - file: <.gguf file>
|
||||
*/
|
||||
export async function POST(req: NextRequest) {
|
||||
const contentType = req.headers.get("content-type") || "";
|
||||
if (!contentType.includes("multipart/form-data")) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: "expected multipart/form-data" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const form = await req.formData();
|
||||
const file = form.get("file");
|
||||
if (!file || !(file instanceof File)) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: "missing 'file' field" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
const buffer = Buffer.from(await file.arrayBuffer());
|
||||
const result = await saveUploadedModel(file.name, buffer);
|
||||
if (!result.ok) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: result.error },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
const models = await listModels();
|
||||
return NextResponse.json({
|
||||
ok: true,
|
||||
path: result.path,
|
||||
models,
|
||||
});
|
||||
} catch (err) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: (err as Error).message },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
91
dashboard/src/app/api/services/[role]/route.ts
Normal file
91
dashboard/src/app/api/services/[role]/route.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import {
|
||||
startService,
|
||||
stopService,
|
||||
restartService,
|
||||
removeService,
|
||||
getServiceLogs,
|
||||
type ServiceRole,
|
||||
} from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
export const maxDuration = 120;
|
||||
|
||||
const VALID_ROLES: ServiceRole[] = [
|
||||
"llama",
|
||||
"comfyui",
|
||||
"model-worker",
|
||||
"webdav",
|
||||
"ssh",
|
||||
"ssh-companion",
|
||||
"gpu-test",
|
||||
"dashboard",
|
||||
];
|
||||
|
||||
function parseRole(role: string): ServiceRole | null {
|
||||
return (VALID_ROLES as string[]).includes(role)
|
||||
? (role as ServiceRole)
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/services/<role>?action=logs&tail=500
|
||||
* Returns logs for the given service.
|
||||
*
|
||||
* POST /api/services/<role>
|
||||
* Body: { action: "start" | "stop" | "restart" | "remove" }
|
||||
*/
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ role: string }> }
|
||||
) {
|
||||
const { role: roleRaw } = await params;
|
||||
const role = parseRole(roleRaw);
|
||||
if (!role) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: `invalid role: ${roleRaw}` },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
const tail = Number(req.nextUrl.searchParams.get("tail") || 500);
|
||||
const logs = await getServiceLogs(role, tail);
|
||||
return NextResponse.json({ ok: true, logs });
|
||||
}
|
||||
|
||||
export async function POST(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ role: string }> }
|
||||
) {
|
||||
const { role: roleRaw } = await params;
|
||||
const role = parseRole(roleRaw);
|
||||
if (!role) {
|
||||
return NextResponse.json(
|
||||
{ ok: false, error: `invalid role: ${roleRaw}` },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
const body = (await req.json()) as {
|
||||
action: "start" | "stop" | "restart" | "remove";
|
||||
};
|
||||
|
||||
if (body.action === "start") {
|
||||
const r = await startService(role);
|
||||
return NextResponse.json(r, { status: r.ok ? 200 : 500 });
|
||||
}
|
||||
if (body.action === "stop") {
|
||||
const r = await stopService(role);
|
||||
return NextResponse.json(r, { status: r.ok ? 200 : 500 });
|
||||
}
|
||||
if (body.action === "restart") {
|
||||
const r = await restartService(role);
|
||||
return NextResponse.json(r, { status: r.ok ? 200 : 500 });
|
||||
}
|
||||
if (body.action === "remove") {
|
||||
const r = await removeService(role);
|
||||
return NextResponse.json(r, { status: r.ok ? 200 : 500 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ error: "unknown action" }, { status: 400 });
|
||||
}
|
||||
94
dashboard/src/app/api/status/stream/route.ts
Normal file
94
dashboard/src/app/api/status/stream/route.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
import { listContainers, getLlamaHealth, NODE_INSTANCE } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
export const maxDuration = 300;
|
||||
|
||||
/**
|
||||
* Server-Sent Events stream for status updates.
|
||||
*
|
||||
* Replaces fetch-polling — client opens a single EventSource connection
|
||||
* and receives a `status` event every N seconds with the full status
|
||||
* payload. SSE was chosen over WebSocket because:
|
||||
* - one-way (server → client) is all we need for status pushes
|
||||
* - works through any HTTP proxy (Tailscale serve) without WS upgrade
|
||||
* - built into the browser (EventSource API), no extra deps
|
||||
* - keeps Next.js standalone output (smaller docker image)
|
||||
*
|
||||
* Client usage:
|
||||
* const es = new EventSource("/api/status/stream");
|
||||
* es.addEventListener("status", (e) => {
|
||||
* const data = JSON.parse(e.data);
|
||||
* ...
|
||||
* });
|
||||
*/
|
||||
export async function GET() {
|
||||
const encoder = new TextEncoder();
|
||||
|
||||
const stream = new ReadableStream<Uint8Array>({
|
||||
async start(controller) {
|
||||
const send = (event: string, data: unknown) => {
|
||||
try {
|
||||
controller.enqueue(
|
||||
encoder.encode(
|
||||
`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`
|
||||
)
|
||||
);
|
||||
} catch {
|
||||
/* stream closed */
|
||||
}
|
||||
};
|
||||
|
||||
// Initial hello so the client knows the stream is alive
|
||||
send("hello", {
|
||||
instance: NODE_INSTANCE,
|
||||
ts: Date.now(),
|
||||
});
|
||||
|
||||
// Push status immediately (don't wait for the first interval)
|
||||
const pushStatus = async () => {
|
||||
try {
|
||||
const [containers, llamaHealth] = await Promise.all([
|
||||
listContainers(),
|
||||
getLlamaHealth(),
|
||||
]);
|
||||
send("status", {
|
||||
instance: NODE_INSTANCE,
|
||||
containers,
|
||||
llamaHealth,
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
} catch (err) {
|
||||
send("error", { message: (err as Error).message });
|
||||
}
|
||||
};
|
||||
|
||||
await pushStatus();
|
||||
|
||||
const interval = setInterval(pushStatus, 4000);
|
||||
|
||||
// Cleanup when client disconnects
|
||||
// The controller.close() is called when the consumer cancels the stream
|
||||
// ( AbortController / EventSource.close() on the client side).
|
||||
// We use the `cancel` method below.
|
||||
// Store interval on the controller via closure.
|
||||
(controller as unknown as { _interval?: NodeJS.Timeout })._interval =
|
||||
interval;
|
||||
},
|
||||
cancel(controller) {
|
||||
const interval = (
|
||||
controller as unknown as { _interval?: NodeJS.Timeout }
|
||||
)._interval;
|
||||
if (interval) clearInterval(interval);
|
||||
},
|
||||
});
|
||||
|
||||
return new Response(stream, {
|
||||
headers: {
|
||||
"Content-Type": "text/event-stream; charset=utf-8",
|
||||
"Cache-Control": "no-cache, no-transform",
|
||||
"Connection": "keep-alive",
|
||||
"X-Accel-Buffering": "no",
|
||||
},
|
||||
});
|
||||
}
|
||||
33
dashboard/src/app/api/system/route.ts
Normal file
33
dashboard/src/app/api/system/route.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { sleepMode, wakeMode, updateNode } from "@/lib/docker";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const runtime = "nodejs";
|
||||
export const maxDuration = 600;
|
||||
|
||||
/**
|
||||
* POST /api/system
|
||||
* Body: { action: "sleep" | "wake" | "update" }
|
||||
*
|
||||
* Mirrors `gpuctl sleep|wake|update` CLI commands.
|
||||
*/
|
||||
export async function POST(req: NextRequest) {
|
||||
const body = (await req.json()) as { action: "sleep" | "wake" | "update" };
|
||||
|
||||
if (body.action === "sleep") {
|
||||
const result = await sleepMode();
|
||||
return NextResponse.json(result, { status: result.ok ? 200 : 500 });
|
||||
}
|
||||
|
||||
if (body.action === "wake") {
|
||||
const result = await wakeMode();
|
||||
return NextResponse.json(result, { status: result.ok ? 200 : 500 });
|
||||
}
|
||||
|
||||
if (body.action === "update") {
|
||||
const result = await updateNode();
|
||||
return NextResponse.json(result, { status: result.ok ? 200 : 500 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ error: "unknown action" }, { status: 400 });
|
||||
}
|
||||
Reference in New Issue
Block a user