Rearange site table?
This commit is contained in:
parent
84e118d1fa
commit
68e5ec2d88
3 changed files with 18 additions and 18 deletions
|
@ -12,7 +12,7 @@ export const sites = sqliteTable("sites", {
|
||||||
orgId: text("orgId").references(() => orgs.orgId, {
|
orgId: text("orgId").references(() => orgs.orgId, {
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
}),
|
||||||
niceId: text("niceId"),
|
niceId: text("niceId").notNull(),
|
||||||
exitNode: integer("exitNode").references(() => exitNodes.exitNodeId, {
|
exitNode: integer("exitNode").references(() => exitNodes.exitNodeId, {
|
||||||
onDelete: "set null",
|
onDelete: "set null",
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -22,22 +22,6 @@ export type SiteRow = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const columns: ColumnDef<SiteRow>[] = [
|
export const columns: ColumnDef<SiteRow>[] = [
|
||||||
{
|
|
||||||
accessorKey: "id",
|
|
||||||
header: ({ column }) => {
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
onClick={() =>
|
|
||||||
column.toggleSorting(column.getIsSorted() === "asc")
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Site
|
|
||||||
<ArrowUpDown className="ml-2 h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessorKey: "name",
|
accessorKey: "name",
|
||||||
header: ({ column }) => {
|
header: ({ column }) => {
|
||||||
|
@ -54,6 +38,22 @@ export const columns: ColumnDef<SiteRow>[] = [
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "id",
|
||||||
|
header: ({ column }) => {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() =>
|
||||||
|
column.toggleSorting(column.getIsSorted() === "asc")
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Site
|
||||||
|
<ArrowUpDown className="ml-2 h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "mbIn",
|
accessorKey: "mbIn",
|
||||||
header: "MB In",
|
header: "MB In",
|
||||||
|
|
|
@ -22,8 +22,8 @@ export default async function Page({ params }: SitesPageProps) {
|
||||||
|
|
||||||
const siteRows: SiteRow[] = sites.map((site) => {
|
const siteRows: SiteRow[] = sites.map((site) => {
|
||||||
return {
|
return {
|
||||||
id: site.siteId.toString(),
|
|
||||||
name: site.name,
|
name: site.name,
|
||||||
|
id: site.niceId.toString(),
|
||||||
mbIn: site.megabytesIn || 0,
|
mbIn: site.megabytesIn || 0,
|
||||||
mbOut: site.megabytesOut || 0,
|
mbOut: site.megabytesOut || 0,
|
||||||
orgId: params.orgId,
|
orgId: params.orgId,
|
||||||
|
|
Loading…
Add table
Reference in a new issue