Browse Source

Merge branch 'main' of https://github.com/fosrl/pangolin

Milo Schwartz 9 months ago
parent
commit
3eca2ab08e

+ 1 - 1
server/db/schema.ts

@@ -12,7 +12,7 @@ export const sites = sqliteTable("sites", {
     orgId: text("orgId").references(() => orgs.orgId, {
         onDelete: "cascade",
     }),
-    niceId: text("niceId"),
+    niceId: text("niceId").notNull(),
     exitNode: integer("exitNode").references(() => exitNodes.exitNodeId, {
         onDelete: "set null",
     }),

+ 3 - 3
src/app/[orgId]/sites/[niceId]/components/create-site.tsx

@@ -176,13 +176,13 @@ sh get-docker.sh`;
                         )}
                     />
                     {form.watch("method") === "wg" && !isLoading ? (
-                        <pre className="mt-2 w-full rounded-md bg-slate-950 p-4 overflow-x-auto">
-                            <code className="text-white whitespace-pre-wrap">{wgConfig}</code>
+                        <pre className="mt-2 w-full rounded-md bg-muted p-4 overflow-x-auto">
+                            <code className="text-white whitespace-pre-wrap font-mono">{wgConfig}</code>
                         </pre>
                     ) : form.watch("method") === "wg" && isLoading ? (
                         <p>Loading WireGuard configuration...</p>
                     ) : (
-                        <pre className="mt-2 w-full rounded-md bg-slate-950 p-4 overflow-x-auto">
+                        <pre className="mt-2 w-full rounded-md bg-muted p-4 overflow-x-auto">
                             <code className="text-white whitespace-pre-wrap">{newtConfig}</code>
                         </pre>
                     )}

+ 4 - 4
src/app/[orgId]/sites/components/SitesTable.tsx

@@ -23,7 +23,7 @@ export type SiteRow = {
 
 export const columns: ColumnDef<SiteRow>[] = [
     {
-        accessorKey: "id",
+        accessorKey: "name",
         header: ({ column }) => {
             return (
                 <Button
@@ -32,14 +32,14 @@ export const columns: ColumnDef<SiteRow>[] = [
                         column.toggleSorting(column.getIsSorted() === "asc")
                     }
                 >
-                    Site
+                    Name
                     <ArrowUpDown className="ml-2 h-4 w-4" />
                 </Button>
             );
         },
     },
     {
-        accessorKey: "name",
+        accessorKey: "id",
         header: ({ column }) => {
             return (
                 <Button
@@ -48,7 +48,7 @@ export const columns: ColumnDef<SiteRow>[] = [
                         column.toggleSorting(column.getIsSorted() === "asc")
                     }
                 >
-                    Name
+                    Site
                     <ArrowUpDown className="ml-2 h-4 w-4" />
                 </Button>
             );

+ 1 - 1
src/app/[orgId]/sites/page.tsx

@@ -22,8 +22,8 @@ export default async function Page({ params }: SitesPageProps) {
 
     const siteRows: SiteRow[] = sites.map((site) => {
         return {
-            id: site.siteId.toString(),
             name: site.name,
+            id: site.niceId.toString(),
             mbIn: site.megabytesIn || 0,
             mbOut: site.megabytesOut || 0,
             orgId: params.orgId,

+ 3 - 3
src/app/globals.css

@@ -38,7 +38,7 @@
         --chart-4: 23.33 8.82% 60%;
         --chart-5: 24 8.98% 67.25%;
 
-        --radius: 0.5rem;
+        --radius: 0.25rem;
     }
     .dark {
         --background: 0 0% 10.98%;
@@ -50,7 +50,7 @@
         --card: 0 0% 8.63%;
         --card-foreground: 24 9.09% 89.22%;
 
-        --popover: 0 0% 4.71%;
+        --popover: 0 0% 10.98%;
         --popover-foreground: 24 9.09% 89.22%;
 
         --secondary: 23.33 28.13% 12.55%;
@@ -75,7 +75,7 @@
         --chart-4: 23.33 23.68% 14.9%;
         --chart-5: 24 23.81% 12.35%;
 
-        --radius: 0.5rem;
+        --radius: 0.25rem;
     }
 }