feat: add admin accounts and image templates
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { jsonError, jsonOk } from "@/lib/server/api";
|
||||
import { requireAdminUser } from "@/lib/server/auth/current-user";
|
||||
import { appLogFilePath, appLogMaxBytes, clearAppLogs, listAppLogs, type AppLogLevel } from "@/lib/server/log-manager";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
@@ -6,6 +7,7 @@ export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
await requireAdminUser();
|
||||
const url = new URL(request.url);
|
||||
const level = parseLevel(url.searchParams.get("level"));
|
||||
const q = url.searchParams.get("q") || undefined;
|
||||
@@ -27,6 +29,7 @@ export async function GET(request: Request) {
|
||||
|
||||
export async function DELETE(request: Request) {
|
||||
try {
|
||||
await requireAdminUser();
|
||||
await clearAppLogs();
|
||||
return jsonOk({ ok: true });
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user