Update language and add debug

This commit is contained in:
Owen
2026-09-22 10:37:52 -04:00
parent 0de5c763b3
commit d38281b9f7
3 changed files with 47 additions and 9 deletions
+26 -1
View File
@@ -1,7 +1,7 @@
"use client";
import { useState, useEffect } from "react";
import { LicenseKeyCache } from "@server/license/license";
import { LicenseKeyCache, LicenseKeyTier } from "@server/license/license";
import { createApiClient } from "@app/lib/api";
import { useEnvContext } from "@app/hooks/useEnvContext";
import { toast } from "@app/hooks/useToast";
@@ -65,6 +65,23 @@ const ENTERPRISE_DOCS_URL =
"https://docs.pangolin.net/self-host/enterprise-edition";
const ENTERPRISE_PRICING_URL = "https://pangolin.net/pricing#Self-Hosted";
function getTierLabel(
tier: LicenseKeyTier | undefined,
t: (key: string) => string
): string {
switch (tier) {
case "enterprise":
return t("licenseTierEnterprise");
case "tier1":
return t("licenseTierTier1");
case "tier2":
return t("licenseTierTier2");
case "personal":
default:
return t("licenseTierPersonal");
}
}
export default function LicensePage() {
const api = createApiClient(useEnvContext());
const [rows, setRows] = useState<LicenseKeyCache[]>([]);
@@ -514,6 +531,14 @@ export default function LicensePage() {
</div>
)}
</div>
<div className="space-y-2">
<div className="text-sm font-medium">
{t("licenseTierLabel")}
</div>
<div className="text-lg">
{getTierLabel(licenseStatus?.tier, t)}
</div>
</div>
{licenseStatus?.hostId && (
<div className="space-y-2">
<div className="text-sm font-medium">