Reapply "Add missing admin action files and navigation links"
This reverts commit 4d515bc400.
This commit is contained in:
1 parent
96ed768f14
commit
5b4228261a
338 files changed
+28143
-5948
No files matched your search
+10
-30
@@ -14,11 +14,7 @@ const PROVIDERS: { value: string; label: string }[] = [
|
||||
{ value: "ipqualityscore", label: "IPQualityScore" },
|
||||
];
|
||||
|
||||
export default async function AdminVpn({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ saved?: string }>;
|
||||
}) {
|
||||
export default async function AdminVpn({ searchParams }: { searchParams: Promise<{ saved?: string }> }) {
|
||||
const sp = await searchParams;
|
||||
const t = await getTranslations("pages.admin.vpn");
|
||||
|
||||
@@ -27,10 +23,8 @@ export default async function AdminVpn({
|
||||
const provider = (await siteSettings.get("vpn_provider", "none")) ?? "none";
|
||||
const apiKey = (await siteSettings.get("vpn_api_key", "")) ?? "";
|
||||
const blockMessage =
|
||||
(await siteSettings.get(
|
||||
"vpn_block_message",
|
||||
"Registrations from VPNs or proxies are not allowed.",
|
||||
)) ?? "";
|
||||
(await siteSettings.get("vpn_block_message", "Registrations from VPNs or proxies are not allowed.")) ??
|
||||
"";
|
||||
|
||||
return (
|
||||
<main>
|
||||
@@ -40,12 +34,13 @@ export default async function AdminVpn({
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">{t("title")}</h1>
|
||||
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">{t.rich("subtitle", { ipLink: (chunks) => <Link href="/admin/ip">{chunks}</Link> })}</p>
|
||||
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">
|
||||
{t.rich("subtitle", { ipLink: (chunks) => <Link href="/admin/ip">{chunks}</Link> })}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section className="mt-6">
|
||||
|
||||
{sp.saved ? (
|
||||
<p className="inline-block text-[0.72rem] font-bold px-2 py-0.5 rounded-full bg-green-600/20 text-[var(--color-text)]">
|
||||
{t("settingsSaved")}
|
||||
@@ -68,15 +63,8 @@ export default async function AdminVpn({
|
||||
<form action={saveVpn} className="admin-card">
|
||||
<div style={{ marginBottom: "1rem" }}>
|
||||
<label style={{ display: "flex", alignItems: "center", gap: "0.6rem" }}>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="vpn_block_enabled"
|
||||
value="1"
|
||||
defaultChecked={enabled}
|
||||
/>
|
||||
<span style={{ fontWeight: 700 }}>
|
||||
{t("blockOnDetect")}
|
||||
</span>
|
||||
<input type="checkbox" name="vpn_block_enabled" value="1" defaultChecked={enabled} />
|
||||
<span style={{ fontWeight: 700 }}>{t("blockOnDetect")}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -88,12 +76,7 @@ export default async function AdminVpn({
|
||||
>
|
||||
{t("provider")}
|
||||
</label>
|
||||
<select
|
||||
id="vpn_provider"
|
||||
name="vpn_provider"
|
||||
defaultValue={provider}
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<select id="vpn_provider" name="vpn_provider" defaultValue={provider} style={{ width: "100%" }}>
|
||||
{PROVIDERS.map((p) => (
|
||||
<option key={p.value} value={p.value}>
|
||||
{p.label}
|
||||
@@ -106,10 +89,7 @@ export default async function AdminVpn({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label
|
||||
htmlFor="vpn_api_key"
|
||||
style={{ display: "block", fontWeight: 700, fontSize: "0.85rem" }}
|
||||
>
|
||||
<label htmlFor="vpn_api_key" style={{ display: "block", fontWeight: 700, fontSize: "0.85rem" }}>
|
||||
{t("apiKey")}
|
||||
</label>
|
||||
<input
|
||||
|
||||
Reference in new issue
Block a user