mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-05 04:09:05 +02:00
Update language and add debug
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user