Add missing admin action files and navigation links

- Add 11 missing server action files: badges, bulk-users, catalog, catalog-bc, catalog-items, import-badges, import-furni, multi-account-detect, permissions, rooms, soundtracks
- Add missing admin navigation links: tickets, sounds, translations, import, radio sub-pages
- Add translation keys for all new navigation items
This commit is contained in:
openhands committed 2026-07-11 12:01:05 +02:00
1 parent 7e1ae17a3b
commit 41be6835bf
347 files changed
+28378 -6091

No files matched your search

+19 -47
View File
@@ -39,19 +39,13 @@ export async function POST(request: Request) {
const action = String(formData.get("action") || "");
if (!userId || !username) {
return NextResponse.json(
{ success: false, message: "Invalid user data" },
{ status: 400 }
);
return NextResponse.json({ success: false, message: "Invalid user data" }, { status: 400 });
}
if (action === "set_rank") {
const rank = Number(formData.get("rank") || "0");
if (!rank || rank < 0 || rank > 10) {
return NextResponse.json(
{ success: false, message: "Invalid rank value" },
{ status: 400 }
);
return NextResponse.json({ success: false, message: "Invalid rank value" }, { status: 400 });
}
await prisma.user.update({ where: { id: userId }, data: { rank } });
@@ -66,7 +60,7 @@ export async function POST(request: Request) {
return NextResponse.json(
{ success: true, message: `Set rank of user #${userId} to ${rank}` },
{ status: 200 }
{ status: 200 },
);
}
@@ -74,94 +68,72 @@ export async function POST(request: Request) {
await rcon.disconnectUser(userId, username);
return NextResponse.json(
{ success: true, message: `Disconnected user #${userId} (${username})` },
{ status: 200 }
{ status: 200 },
);
}
if (action === "alert") {
const message = String(formData.get("message") || "").trim().slice(0, 512);
const message = String(formData.get("message") || "")
.trim()
.slice(0, 512);
if (!message) {
return NextResponse.json(
{ success: false, message: "Alert message is required" },
{ status: 400 }
);
return NextResponse.json({ success: false, message: "Alert message is required" }, { status: 400 });
}
await rcon.alertUser(userId, message);
return NextResponse.json(
{ success: true, message: `Sent alert to user #${userId}` },
{ status: 200 }
);
return NextResponse.json({ success: true, message: `Sent alert to user #${userId}` }, { status: 200 });
}
if (action === "give_credits") {
const credits = Number(formData.get("credits") || "0");
if (!credits || credits <= 0) {
return NextResponse.json(
{ success: false, message: "Invalid credit amount" },
{ status: 400 }
);
return NextResponse.json({ success: false, message: "Invalid credit amount" }, { status: 400 });
}
await giveCurrency({ rconClient: rcon, db: prisma, userId, type: "credits", amount: credits });
return NextResponse.json(
{ success: true, message: `Gave ${credits} credits to user #${userId}` },
{ status: 200 }
{ status: 200 },
);
}
if (action === "give_duckets") {
const amount = Number(formData.get("amount") || "0");
if (!amount || amount <= 0) {
return NextResponse.json(
{ success: false, message: "Invalid duckets amount" },
{ status: 400 }
);
return NextResponse.json({ success: false, message: "Invalid duckets amount" }, { status: 400 });
}
await giveCurrency({ rconClient: rcon, db: prisma, userId, type: "duckets", amount });
return NextResponse.json(
{ success: true, message: `Gave ${amount} duckets to user #${userId}` },
{ status: 200 }
{ status: 200 },
);
}
if (action === "give_diamonds") {
const amount = Number(formData.get("amount") || "0");
if (!amount || amount <= 0) {
return NextResponse.json(
{ success: false, message: "Invalid diamonds amount" },
{ status: 400 }
);
return NextResponse.json({ success: false, message: "Invalid diamonds amount" }, { status: 400 });
}
await giveCurrency({ rconClient: rcon, db: prisma, userId, type: "diamonds", amount });
return NextResponse.json(
{ success: true, message: `Gave ${amount} diamonds to user #${userId}` },
{ status: 200 }
{ status: 200 },
);
}
if (action === "give_points") {
const amount = Number(formData.get("amount") || "0");
if (!amount || amount <= 0) {
return NextResponse.json(
{ success: false, message: "Invalid points amount" },
{ status: 400 }
);
return NextResponse.json({ success: false, message: "Invalid points amount" }, { status: 400 });
}
await giveCurrency({ rconClient: rcon, db: prisma, userId, type: "points", amount });
return NextResponse.json(
{ success: true, message: `Gave ${amount} points to user #${userId}` },
{ status: 200 }
{ status: 200 },
);
}
return NextResponse.json(
{ success: false, message: `Unknown action: ${action}` },
{ status: 400 }
);
return NextResponse.json({ success: false, message: `Unknown action: ${action}` }, { status: 400 });
} catch (error) {
logger.error("Admin users actions error", { module: "admin/users/actions", error: String(error) });
return NextResponse.json(
{ success: false, message: "Internal server error" },
{ status: 500 }
);
return NextResponse.json({ success: false, message: "Internal server error" }, { status: 500 });
}
}