License machines

This commit is contained in:
Owen
2026-10-20 15:29:37 -04:00
parent 77c0c96823
commit d80c1ff27b
10 changed files with 142 additions and 10 deletions
+47
View File
@@ -536,6 +536,53 @@ export default function LicensePage() {
</div>
)}
</div>
<div className="space-y-2">
<div className="text-sm font-medium">
{t("licenseUsageMachines")}
</div>
<div className="text-2xl">
{t("licenseMachinesUsed", {
count: licenseStatus?.usedMachines || 0
})}
</div>
{licenseStatus?.maxMachines ? (
<div className="space-y-2">
<div className="flex justify-between text-sm">
<span className="text-muted-foreground">
{t("licenseMachinesUsedMax", {
usedMachines:
licenseStatus.usedMachines ||
0,
maxMachines:
licenseStatus.maxMachines
})}
</span>
<span className="text-muted-foreground">
{Math.round(
((licenseStatus.usedMachines ||
0) /
licenseStatus.maxMachines) *
100
)}
%
</span>
</div>
<Progress
value={
((licenseStatus.usedMachines ||
0) /
licenseStatus.maxMachines) *
100
}
className="h-5"
/>
</div>
) : (
<div className="text-sm text-muted-foreground">
{t("licenseNoMachineLimit")}
</div>
)}
</div>
</div>
</SettingsSection>
<SettingsSection>
@@ -255,6 +255,27 @@ export default function GenerateLicenseKeysTable({
return sites === -1 ? "∞" : sites;
}
},
{
accessorKey: "machines",
friendlyName: t("machineClients"),
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() =>
column.toggleSorting(column.getIsSorted() === "asc")
}
>
{t("machineClients")}
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
},
cell: ({ row }) => {
const machines = row.original.machines;
return machines === -1 ? "∞" : machines;
}
},
{
accessorKey: "terminateAt",
friendlyName: t("licenseTableValidUntil"),
+24
View File
@@ -160,6 +160,30 @@ export function LicenseKeysDataTable({
return quantity < 0 ? t("licenseUnlimited") : quantity;
}
},
{
accessorKey: "quantity_3",
friendlyName: t("machineClients"),
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() =>
column.toggleSorting(column.getIsSorted() === "asc")
}
>
{t("machineClients")}
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
},
cell: ({ row }) => {
const quantity = row.original.quantity_3;
if (quantity === undefined) {
return "-";
}
return quantity < 0 ? t("licenseUnlimited") : quantity;
}
},
{
accessorKey: "terminateAt",
friendlyName: t("licenseTableValidUntil"),