- {t("emulatorControls")}
-
+
+ {t("emulatorControls")}
+
+
+ {isPending ? t("executing") : t("chooseCommand")}
+
+
+ {category === "hotel" && (
{t("updateCatalog")}
@@ -71,7 +92,8 @@ export function CommandocentrumControls() {
{t("updateCatalog")}
-
+ )}
+ {category === "hotel" && (
{t("updateWordFilter")}
@@ -93,7 +115,8 @@ export function CommandocentrumControls() {
{t("updateWordFilter")}
-
+ )}
+ {category === "hotel" && (
{t("updateNavigator")}
@@ -115,50 +138,44 @@ export function CommandocentrumControls() {
{t("updateNavigator")}
-
-
-
-
- {t("hotelAlert")}
-
-
- {t("hotelAlertDesc")}
-
-
-
setHotelMessage(e.target.value)}
- required
- maxLength={512}
- placeholder={t("messageToBroadcast")}
- className="flex-1 min-w-[220px]"
- disabled={isPending}
- />
-
+ )}
+ {category === "hotel" && (
+
+
+ {t("hotelAlert")}
+
+
+ {t("hotelAlertDesc")}
+
+
+ setHotelMessage(e.target.value)}
+ required
+ maxLength={512}
+ aria-label={t("messageToBroadcast")}
+ placeholder={t("messageToBroadcast")}
+ className="flex-1 min-w-0 w-full sm:w-auto"
+ disabled={isPending}
+ />
+
+
-
-
-
-
-
+ )}
+ {category === "players" && (
{t("forwardToRoom")}
@@ -282,6 +305,7 @@ export function CommandocentrumControls() {
@@ -293,6 +317,7 @@ export function CommandocentrumControls() {
@@ -325,9 +350,8 @@ export function CommandocentrumControls() {
-
-
-
-
+ )}
+ {category === "rewards" && (
{t("giveDuckets")}
@@ -394,6 +421,7 @@ export function CommandocentrumControls() {
@@ -405,6 +433,7 @@ export function CommandocentrumControls() {
@@ -437,7 +466,8 @@ export function CommandocentrumControls() {
-
+ )}
+ {category === "rewards" && (
{t("giveDiamonds")}
@@ -449,6 +479,7 @@ export function CommandocentrumControls() {
@@ -460,6 +491,7 @@ export function CommandocentrumControls() {
@@ -492,9 +524,8 @@ export function CommandocentrumControls() {
-
-
-
-
+ )}
+ {category === "players" && (
{t("setMotto")}
@@ -561,6 +595,7 @@ export function CommandocentrumControls() {
@@ -571,6 +606,7 @@ export function CommandocentrumControls() {
/>
@@ -604,7 +640,8 @@ export function CommandocentrumControls() {
-
+ )}
+ {category === "players" && (
{t("setRank")}
@@ -616,6 +653,7 @@ export function CommandocentrumControls() {
@@ -628,6 +666,7 @@ export function CommandocentrumControls() {
type="number"
min={0}
max={10}
+ aria-label={t("rankPlaceholder")}
placeholder={t("rankPlaceholder")}
value={rank.rank}
onChange={(e) =>
@@ -660,9 +699,8 @@ export function CommandocentrumControls() {
-
-
-
-
+ )}
+ {category === "rewards" && (
{t("sendGift")}
@@ -731,6 +772,7 @@ export function CommandocentrumControls() {
@@ -742,6 +784,7 @@ export function CommandocentrumControls() {
@@ -752,6 +795,7 @@ export function CommandocentrumControls() {
/>
@@ -791,8 +835,8 @@ export function CommandocentrumControls() {
-
-
- >
+ )}
+
+
);
}
diff --git a/src/app/admin/commandocentrum/page.tsx b/src/app/admin/commandocentrum/page.tsx
index 4463c861d9..80b18a8257 100644
--- a/src/app/admin/commandocentrum/page.tsx
+++ b/src/app/admin/commandocentrum/page.tsx
@@ -10,6 +10,8 @@ import {
OnlineUsersWidget,
StatusCard,
} from "@/components/admin/dashboard";
+import Link from "@/components/link";
+import { env } from "@/env";
import { fetchOpsHealth } from "@/lib/admin/ops-health";
import { fetchOpsOnlineUsers } from "@/lib/admin/ops-online-users";
import { db, EmulatorErrors, StaffActivities, User } from "@/lib/db";
@@ -17,6 +19,7 @@ import { formatDate } from "@/lib/format-date";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
import { siteSettings } from "@/lib/services/site-settings";
import { CommandocentrumControls } from "./commandocentrum-controls";
+import { RefreshStatus } from "./refresh-status";
function decodeStacktrace(raw: unknown): string {
if (raw == null) return "";
@@ -47,28 +50,36 @@ export default async function CommandoCentrum() {
const t = await getTranslations("pages.admin.commandocentrum");
- const [totalUsersRows, errors, health, maintenance, activity, onlineRoster] =
- await Promise.all([
- db
- .select({ total: count() })
- .from(User)
- .catch(() => [{ total: -1 }]),
- db
- .select()
- .from(EmulatorErrors)
- .orderBy(desc(EmulatorErrors.timestamp))
- .limit(50)
- .catch(() => []),
- fetchOpsHealth(),
- siteSettings.getBool("maintenance_enabled", false),
- db
- .select()
- .from(StaffActivities)
- .orderBy(desc(StaffActivities.createdAt))
- .limit(12)
- .catch(() => [] as (typeof StaffActivities.$inferSelect)[]),
- fetchOpsOnlineUsers(40),
- ]);
+ const [
+ totalUsersRows,
+ errorRows,
+ health,
+ maintenance,
+ activity,
+ onlineRoster,
+ ] = await Promise.all([
+ db
+ .select({ total: count() })
+ .from(User)
+ .catch(() => [{ total: -1 }]),
+ db
+ .select()
+ .from(EmulatorErrors)
+ .orderBy(desc(EmulatorErrors.timestamp))
+ .limit(50)
+ .catch(() => null),
+ fetchOpsHealth(),
+ siteSettings.getBool("maintenance_enabled", false),
+ db
+ .select()
+ .from(StaffActivities)
+ .orderBy(desc(StaffActivities.createdAt))
+ .limit(12)
+ .catch(() => [] as (typeof StaffActivities.$inferSelect)[]),
+ fetchOpsOnlineUsers(40),
+ ]);
+ const errors = errorRows ?? [];
+ const errorsAvailable = errorRows !== null;
const totalUsers = Number(totalUsersRows[0]?.total ?? -1);
const dbOk = health.dbOk;
@@ -91,12 +102,30 @@ export default async function CommandoCentrum() {
}
const appKeySet = !!process.env.APP_KEY;
- const smtpSet = !!process.env.SMTP_HOST;
- const rconSet = !!process.env.RCON_HOST;
+ const smtpSet = !!(env.SMTP_HOST || env.RESEND_API_KEY);
+ const rconSet =
+ env.EMULATOR_MODE === "api" ? !!env.EMULATOR_API_URL : !!env.RCON_HOST;
return (