fix: Fixed plans on admin site erroring
Server Deploy / deploy (push) Successful in 3m39s

This commit is contained in:
mrhid6
2026-07-26 16:08:15 +01:00
parent fbad3e44e5
commit 310b3ab03f
+23 -8
View File
@@ -10,7 +10,10 @@ import { limitLabel } from "@/lib/format";
export default function PlansPage() {
const qc = useQueryClient();
const plans = useQuery({ queryKey: ["plans"], queryFn: api.staff.plans });
const licenses = useQuery({ queryKey: ["staff-licenses"], queryFn: () => api.staff.licenses() });
const licenses = useQuery({
queryKey: ["staff-licenses"],
queryFn: () => api.staff.licenses(),
});
const [draft, setDraft] = useState<Plan | null>(null);
const save = useMutation({
@@ -39,7 +42,11 @@ export default function PlansPage() {
<ConfirmPlanChange
plan={original}
next={draft}
issuedCount={(licenses.data ?? []).filter((l) => l.tier === draft.tier).length}
issuedCount={
(licenses.data ?? []).filter(
(l) => l.tier === draft.tier,
).length
}
onConfirm={() => save.mutate(draft)}
onCancel={() => setDraft(null)}
/>
@@ -59,7 +66,9 @@ export default function PlansPage() {
</div>
<div className="flex justify-between gap-2">
<dt>secret groups</dt>
<dd>{limitLabel(p.limits.max_secret_groups)}</dd>
<dd>
{limitLabel(p.limits.max_secret_groups)}
</dd>
</div>
<div className="flex justify-between gap-2">
<dt>channels</dt>
@@ -67,7 +76,7 @@ export default function PlansPage() {
</div>
<div className="flex justify-between gap-2">
<dt>features</dt>
<dd>{p.features.join(", ") || "none"}</dd>
<dd>{p.features?.join(", ") || "none"}</dd>
</div>
</dl>
@@ -76,8 +85,9 @@ export default function PlansPage() {
<span aria-hidden="true">🔒</span>
<span>
Deployment is fixed at{" "}
<b className="font-mono">{p.deployment}</b>. Moving a tier between
cloud and self-hosted is a code change, not a form field.
<b className="font-mono">{p.deployment}</b>.
Moving a tier between cloud and self-hosted is a
code change, not a form field.
</span>
</p>
@@ -86,7 +96,10 @@ export default function PlansPage() {
type="button"
variant="line"
onClick={() =>
setDraft({ ...p, limits: { ...p.limits, max_servers: 7 } })
setDraft({
...p,
limits: { ...p.limits, max_servers: 7 },
})
}
>
Cap servers at 7
@@ -97,7 +110,9 @@ export default function PlansPage() {
onClick={() =>
setDraft({
...p,
features: p.features.filter((f) => f !== "oidc"),
features: p.features.filter(
(f) => f !== "oidc",
),
})
}
>