From 9d17f539b5c428551f2ce64e0241994e5140ed39 Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Mon, 7 Sep 2026 08:36:18 +0000 Subject: [PATCH] fix: Fixed card header margin --- web/app/(app)/keys/[id]/page.tsx | 403 +++++++++++-------------- web/app/(app)/secrets/[group]/page.tsx | 2 +- web/app/(app)/servers/new/page.tsx | 254 ++++++++-------- web/components/ui/Card.tsx | 2 +- 4 files changed, 302 insertions(+), 359 deletions(-) diff --git a/web/app/(app)/keys/[id]/page.tsx b/web/app/(app)/keys/[id]/page.tsx index 035d826..d8a0c6f 100644 --- a/web/app/(app)/keys/[id]/page.tsx +++ b/web/app/(app)/keys/[id]/page.tsx @@ -136,7 +136,7 @@ function PrivateKeyCard({ keyId }: { keyId: string }) { return ( - + Private Key {revealed && (
@@ -255,232 +255,185 @@ export default function KeyDetailPage() { const assignedServerIds = activeAssignments.map((a) => a.server_id); return ( -
- {showAssign && ( - setShowAssign(false)} - /> - )} +
+ {showAssign && setShowAssign(false)} />} -
-
- - ← SSH Keys - -
-

{key.label}

- - {key.source} - -
- {/* A fingerprint is one unbreakable token; without break-all it +
+
+ + ← SSH Keys + +
+

{key.label}

+ {key.source} +
+ {/* A fingerprint is one unbreakable token; without break-all it overflows the column rather than wrapping. */} -

{key.fingerprint}

-
-
- - -
+

{key.fingerprint}

+
+
+ + +
+
+ + {/* + * Typed, like the server and monitor deletes. Deleting a key revokes it + * from every server at once, and for a generated key the stored private + * half goes with it — there is no copy anywhere else, so this is the one + * delete on the fleet side that cannot be undone by re-uploading what + * the operator already has. + */} + setConfirmDelete(false)} + onConfirm={() => deleteKey()} + body={ + <> +

+ {key.label} is deleted + {activeAssignments.length > 0 && ( + <> + {" "} + and revoked from{" "} + + {activeAssignments.length} server{activeAssignments.length !== 1 ? "s" : ""} + + + )} + . Agents rewrite authorized_keys within 30 seconds. +

+ {key.has_private_key &&

The stored private key is destroyed with it. If this is the only copy, access it grants is gone for good.

} + + } + /> + +
+
+ + + Details + +
+
+
Key ID
+
{key.key_id}
+
+
+
Source
+
{key.source}
+
+ {key.generated_by_server_id && ( +
+
Generated By
+
+ + {key.generated_by_server_id} + +
+
+ )} +
+
Active Assignments
+
{activeAssignments.length}
+
+
+
Created
+
{new Date(key.created_at).toLocaleString()}
+
+
+
+ + + + Public Key + + +
+
{key.public_key}
+
+
+ + {key.has_private_key && } +
+ +
+ +
+

+ Server Assignments + {activeAssignments.length} active +

+
+ + {!key.assignments || key.assignments.length === 0 ? ( +
+

Not assigned to any servers.

+ +
+ ) : ( + + + + + + + + + + + + {key.assignments.map((assignment) => ( + + + + + + + + + ))} + +
ServerIP AddressStatusAssignedRevoked +
+ + {assignment.server?.hostname ?? assignment.server_id} + + + {assignment.server?.ip_address ?? "n/a"} + + {assignment.revoked_at ? "revoked" : "active"} + + {new Date(assignment.assigned_at).toLocaleDateString()} + + {assignment.revoked_at ? new Date(assignment.revoked_at).toLocaleDateString() : "n/a"} + + {!assignment.revoked_at && ( + + )} +
+ )} +
+
+
- - {/* - * Typed, like the server and monitor deletes. Deleting a key revokes it - * from every server at once, and for a generated key the stored private - * half goes with it — there is no copy anywhere else, so this is the one - * delete on the fleet side that cannot be undone by re-uploading what - * the operator already has. - */} - setConfirmDelete(false)} - onConfirm={() => deleteKey()} - body={ - <> -

- {key.label} is deleted - {activeAssignments.length > 0 && ( - <> - {" "} - and revoked from{" "} - - {activeAssignments.length} server{activeAssignments.length !== 1 ? "s" : ""} - - - )} - . Agents rewrite authorized_keys within 30 seconds. -

- {key.has_private_key && ( -

- The stored private key is destroyed with it. If this is the only copy, access it grants is gone for - good. -

- )} - - } - /> - -
-
- - - Details - -
-
-
Key ID
-
{key.key_id}
-
-
-
Source
-
{key.source}
-
- {key.generated_by_server_id && ( -
-
Generated By
-
- - {key.generated_by_server_id} - -
-
- )} -
-
Active Assignments
-
{activeAssignments.length}
-
-
-
Created
-
- {new Date(key.created_at).toLocaleString()} -
-
-
-
- - - - Public Key - - -
-
-                {key.public_key}
-              
-
-
- - {key.has_private_key && } -
- -
- -
-

- Server Assignments - - {activeAssignments.length} active - -

-
- - {!key.assignments || key.assignments.length === 0 ? ( -
-

Not assigned to any servers.

- -
- ) : ( - - - - - - - - - - - - {key.assignments.map((assignment) => ( - - - - - - - - - ))} - -
ServerIP AddressStatusAssignedRevoked -
- - {assignment.server?.hostname ?? assignment.server_id} - - - - {assignment.server?.ip_address ?? "n/a"} - - - - {assignment.revoked_at ? "revoked" : "active"} - - - - {new Date(assignment.assigned_at).toLocaleDateString()} - - - - {assignment.revoked_at - ? new Date(assignment.revoked_at).toLocaleDateString() - : "n/a"} - - - {!assignment.revoked_at && ( - - )} -
- )} -
-
-
-
); } diff --git a/web/app/(app)/secrets/[group]/page.tsx b/web/app/(app)/secrets/[group]/page.tsx index 9cebb08..b08b159 100644 --- a/web/app/(app)/secrets/[group]/page.tsx +++ b/web/app/(app)/secrets/[group]/page.tsx @@ -249,7 +249,7 @@ function AddKeyCard({ group }: { group: string }) { return ( - + Add / Update Key

Adding a key that already exists overwrites its value. Others are left untouched.

diff --git a/web/app/(app)/servers/new/page.tsx b/web/app/(app)/servers/new/page.tsx index 24d9dce..34f4714 100644 --- a/web/app/(app)/servers/new/page.tsx +++ b/web/app/(app)/servers/new/page.tsx @@ -25,138 +25,128 @@ export default function NewServerPage() { }; return ( -
-
-

Add Server

-

- Generate an install command to register a new server with the Vantage agent. -

+
+
+

Add Server

+

Generate an install command to register a new server with the Vantage agent.

+
+ +
+ {!result ? ( + + + Generate Install Command + +

+ Click the button below to generate a one-time install command. The command contains a short-lived token (valid for 1 hour) that registers your server and installs the Vantage agent automatically. +

+ + {error &&
Failed to generate install command. Make sure the backend is running.
} + + +
+ ) : ( + <> + + + Install Command + Valid for 1 hour + +
+ {(["linux", "windows"] as const).map((o) => ( + + ))} +
+ +

+ {os === "windows" ? ( + <> + Run this in an elevated PowerShell (Run as Administrator): + + ) : ( + <> + Run this command on the target server as root: + + )} +

+ +
+
+                                  {os === "windows" ? "PS>" : "$"} {command}
+                              
+ +
+
+ + + + Server Details + +
+
+
Server ID
+
{result.server_id}
+
+
+
Status
+
Pending registration
+
+
+
+ + + + What happens next? + +
    + {[ + "The install script detects your CPU architecture (amd64 / arm64)", + "Downloads and verifies the latest agent binary from the Gitea release", + "Writes /etc/vantage/config.yaml with the server ID and token", + "Installs and starts the vantage-agent systemd service", + "The agent calls Register() to obtain a persistent auth token", + "The server status changes to active on the first successful sync", + ].map((step, i) => ( +
  1. + {i + 1} + {step} +
  2. + ))} +
+
+ +
+ +
+ + )} +
- -
- {!result ? ( - - - Generate Install Command - -

- Click the button below to generate a one-time install command. The command - contains a short-lived token (valid for 1 hour) that registers your server - and installs the Vantage agent automatically. -

- - {error && ( -
- Failed to generate install command. Make sure the backend is running. -
- )} - - -
- ) : ( - <> - - - Install Command - - Valid for 1 hour - - -
- {(["linux", "windows"] as const).map((o) => ( - - ))} -
- -

- {os === "windows" ? ( - <>Run this in an elevated PowerShell (Run as Administrator): - ) : ( - <>Run this command on the target server as root: - )} -

- -
-
-                  {os === "windows" ? "PS>" : "$"}{" "}
-                  {command}
-                
- -
-
- - - - Server Details - -
-
-
Server ID
-
{result.server_id}
-
-
-
Status
-
Pending registration
-
-
-
- - - - What happens next? - -
    - {[ - "The install script detects your CPU architecture (amd64 / arm64)", - "Downloads and verifies the latest agent binary from the Gitea release", - "Writes /etc/vantage/config.yaml with the server ID and token", - "Installs and starts the vantage-agent systemd service", - "The agent calls Register() to obtain a persistent auth token", - "The server status changes to active on the first successful sync", - ].map((step, i) => ( -
  1. - - {i + 1} - - {step} -
  2. - ))} -
-
- -
- -
- - )} -
-
); } diff --git a/web/components/ui/Card.tsx b/web/components/ui/Card.tsx index af4ccc4..b18a3d6 100644 --- a/web/components/ui/Card.tsx +++ b/web/components/ui/Card.tsx @@ -24,7 +24,7 @@ export function Card({ className, padding = true, children, ...props }: CardProp export function CardHeader({ className, children, ...props }: HTMLAttributes) { return ( -
+
{children}
);