Edit client page done

This commit is contained in:
Owen
2025-04-18 15:32:20 -04:00
parent 581fdd67b1
commit dc49027b30
20 changed files with 491 additions and 26 deletions

View File

@@ -224,6 +224,7 @@ export default function CreateSiteForm({
name: data.name,
id: data.siteId,
nice: data.niceId.toString(),
address: data.address?.split("/")[0],
mbIn:
data.type == "wireguard" || data.type == "newt"
? "0 MB"

View File

@@ -37,6 +37,7 @@ export type SiteRow = {
orgId: string;
type: "newt" | "wireguard";
online: boolean;
address?: string;
};
type SitesTableProps = {
@@ -259,6 +260,22 @@ export default function SitesTable({ sites, orgId }: SitesTableProps) {
}
}
},
{
accessorKey: "address",
header: ({ column }) => {
return (
<Button
variant="ghost"
onClick={() =>
column.toggleSorting(column.getIsSorted() === "asc")
}
>
Address
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
}
},
{
id: "actions",
cell: ({ row }) => {

View File

@@ -41,6 +41,7 @@ export default async function SitesPage(props: SitesPageProps) {
name: site.name,
id: site.siteId,
nice: site.niceId.toString(),
address: site.address?.split("/")[0],
mbIn: formatSize(site.megabytesIn || 0, site.type),
mbOut: formatSize(site.megabytesOut || 0, site.type),
orgId: params.orgId,