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:
1 parent
7e1ae17a3b
commit
41be6835bf
347 files changed
+28378
-6091
No files matched your search
@@ -7,11 +7,7 @@ import { Package } from "lucide-react";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function EditShopArticle({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
export default async function EditShopArticle({ params }: { params: Promise<{ id: string }> }) {
|
||||
const t = await getTranslations("pages.admin.shop");
|
||||
|
||||
const { id } = await params;
|
||||
@@ -31,7 +27,10 @@ export default async function EditShopArticle({
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">{t("editPackageTitle")}</h1>
|
||||
<Link href="/admin/shop" className="text-xs text-[var(--color-text-muted)] hover:text-[var(--color-primary)]">
|
||||
<Link
|
||||
href="/admin/shop"
|
||||
className="text-xs text-[var(--color-text-muted)] hover:text-[var(--color-primary)]"
|
||||
>
|
||||
← {t("backToShop")}
|
||||
</Link>
|
||||
</div>
|
||||
@@ -40,17 +39,91 @@ export default async function EditShopArticle({
|
||||
<form action={updateShopArticle} className="admin-card">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<input type="hidden" name="id" value={String(pkg.id)} />
|
||||
<input name="name" defaultValue={pkg.name} placeholder={t("form.namePlaceholder")} required maxLength={255} className="w-full" />
|
||||
<input name="info" defaultValue={pkg.info} placeholder={t("form.infoPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="icon" defaultValue={pkg.iconUrl} placeholder={t("form.iconPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="color" defaultValue={pkg.color} placeholder={t("form.colorPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="costs" type="number" min={0} defaultValue={pkg.costs} placeholder={t("form.costsPlaceholder")} required className="w-full" />
|
||||
<input name="credits" type="number" min={0} defaultValue={pkg.credits ?? undefined} placeholder={t("form.creditsPlaceholder")} className="w-full" />
|
||||
<input name="duckets" type="number" min={0} defaultValue={pkg.duckets ?? undefined} placeholder={t("form.ducketsPlaceholder")} className="w-full" />
|
||||
<input name="diamonds" type="number" min={0} defaultValue={pkg.diamonds ?? undefined} placeholder={t("form.diamondsPlaceholder")} className="w-full" />
|
||||
<input name="giveRank" type="number" min={0} defaultValue={pkg.giveRank ?? undefined} placeholder={t("form.giveRankPlaceholder")} className="w-full" />
|
||||
<input name="badges" defaultValue={pkg.badges ?? ""} placeholder={t("form.badgesPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="position" type="number" min={0} defaultValue={pkg.position} placeholder={t("form.positionPlaceholder")} className="w-full" />
|
||||
<input
|
||||
name="name"
|
||||
defaultValue={pkg.name}
|
||||
placeholder={t("form.namePlaceholder")}
|
||||
required
|
||||
maxLength={255}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="info"
|
||||
defaultValue={pkg.info}
|
||||
placeholder={t("form.infoPlaceholder")}
|
||||
maxLength={255}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="icon"
|
||||
defaultValue={pkg.iconUrl}
|
||||
placeholder={t("form.iconPlaceholder")}
|
||||
maxLength={255}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="color"
|
||||
defaultValue={pkg.color}
|
||||
placeholder={t("form.colorPlaceholder")}
|
||||
maxLength={255}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="costs"
|
||||
type="number"
|
||||
min={0}
|
||||
defaultValue={pkg.costs}
|
||||
placeholder={t("form.costsPlaceholder")}
|
||||
required
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="credits"
|
||||
type="number"
|
||||
min={0}
|
||||
defaultValue={pkg.credits ?? undefined}
|
||||
placeholder={t("form.creditsPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="duckets"
|
||||
type="number"
|
||||
min={0}
|
||||
defaultValue={pkg.duckets ?? undefined}
|
||||
placeholder={t("form.ducketsPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="diamonds"
|
||||
type="number"
|
||||
min={0}
|
||||
defaultValue={pkg.diamonds ?? undefined}
|
||||
placeholder={t("form.diamondsPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="giveRank"
|
||||
type="number"
|
||||
min={0}
|
||||
defaultValue={pkg.giveRank ?? undefined}
|
||||
placeholder={t("form.giveRankPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="badges"
|
||||
defaultValue={pkg.badges ?? ""}
|
||||
placeholder={t("form.badgesPlaceholder")}
|
||||
maxLength={255}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="position"
|
||||
type="number"
|
||||
min={0}
|
||||
defaultValue={pkg.position}
|
||||
placeholder={t("form.positionPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-6 flex gap-2">
|
||||
<button type="submit" className="btn btn-primary">
|
||||
|
||||
@@ -14,7 +14,10 @@ export default async function NewShopArticle() {
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">{t("newPackageTitle")}</h1>
|
||||
<Link href="/admin/shop" className="text-xs text-[var(--color-text-muted)] hover:text-[var(--color-primary)]">
|
||||
<Link
|
||||
href="/admin/shop"
|
||||
className="text-xs text-[var(--color-text-muted)] hover:text-[var(--color-primary)]"
|
||||
>
|
||||
← {t("backToShop")}
|
||||
</Link>
|
||||
</div>
|
||||
@@ -22,17 +25,61 @@ export default async function NewShopArticle() {
|
||||
|
||||
<form action={createShopArticle} className="admin-card">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<input name="name" placeholder={t("form.namePlaceholder")} required maxLength={255} className="w-full" />
|
||||
<input
|
||||
name="name"
|
||||
placeholder={t("form.namePlaceholder")}
|
||||
required
|
||||
maxLength={255}
|
||||
className="w-full"
|
||||
/>
|
||||
<input name="info" placeholder={t("form.infoPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="icon" placeholder={t("form.iconPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="color" placeholder={t("form.colorPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="costs" type="number" min={0} placeholder={t("form.costsPlaceholder")} required className="w-full" />
|
||||
<input name="credits" type="number" min={0} placeholder={t("form.creditsPlaceholder")} className="w-full" />
|
||||
<input name="duckets" type="number" min={0} placeholder={t("form.ducketsPlaceholder")} className="w-full" />
|
||||
<input name="diamonds" type="number" min={0} placeholder={t("form.diamondsPlaceholder")} className="w-full" />
|
||||
<input name="giveRank" type="number" min={0} placeholder={t("form.giveRankPlaceholder")} className="w-full" />
|
||||
<input
|
||||
name="costs"
|
||||
type="number"
|
||||
min={0}
|
||||
placeholder={t("form.costsPlaceholder")}
|
||||
required
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="credits"
|
||||
type="number"
|
||||
min={0}
|
||||
placeholder={t("form.creditsPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="duckets"
|
||||
type="number"
|
||||
min={0}
|
||||
placeholder={t("form.ducketsPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="diamonds"
|
||||
type="number"
|
||||
min={0}
|
||||
placeholder={t("form.diamondsPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input
|
||||
name="giveRank"
|
||||
type="number"
|
||||
min={0}
|
||||
placeholder={t("form.giveRankPlaceholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
<input name="badges" placeholder={t("form.badgesPlaceholder")} maxLength={255} className="w-full" />
|
||||
<input name="position" type="number" min={0} placeholder={t("form.positionPlaceholder")} defaultValue={0} className="w-full" />
|
||||
<input
|
||||
name="position"
|
||||
type="number"
|
||||
min={0}
|
||||
placeholder={t("form.positionPlaceholder")}
|
||||
defaultValue={0}
|
||||
className="w-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-6 text-right">
|
||||
<button type="submit" className="btn btn-primary">
|
||||
|
||||
@@ -65,7 +65,9 @@ export default async function AdminShop() {
|
||||
</div>
|
||||
|
||||
<section className="mt-6">
|
||||
<h2>{t("packages")} ({packages.length})</h2>
|
||||
<h2>
|
||||
{t("packages")} ({packages.length})
|
||||
</h2>
|
||||
{packages.length === 0 ? (
|
||||
<p className="muted">{t("noPackages")}</p>
|
||||
) : (
|
||||
@@ -105,7 +107,9 @@ export default async function AdminShop() {
|
||||
</section>
|
||||
|
||||
<section className="mt-6">
|
||||
<h2>{t("recentOrders")} ({orders.length})</h2>
|
||||
<h2>
|
||||
{t("recentOrders")} ({orders.length})
|
||||
</h2>
|
||||
<p className="muted" style={{ marginTop: "-0.4rem" }}>
|
||||
{t("ordersHint")} (<code>website_paypal_transactions</code>).
|
||||
</p>
|
||||
@@ -148,9 +152,7 @@ export default async function AdminShop() {
|
||||
<span className="muted">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="muted">
|
||||
{o.createdAt ? o.createdAt.toISOString().slice(0, 10) : "—"}
|
||||
</td>
|
||||
<td className="muted">{o.createdAt ? o.createdAt.toISOString().slice(0, 10) : "—"}</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in new issue
Block a user