Let admins hide the Proxmox-link card per server

Not every registered server is a Proxmox VM/LXC -- bare-metal boxes
and other hosts had no reason to show a "link to Proxmox" option, but
it appeared unconditionally on every server's detail page.

New hideProxmoxLink column on servers (default false, so existing
behavior is unchanged until someone opts in). A "Not a VM? Hide this"
link in the card's header sets it; once hidden, a small "+ Show
Proxmox link options" link takes its place so it's still reachable,
not buried in a settings form. The card always shows regardless of
this flag once a server IS actually linked, so unlinking never becomes
unreachable by hiding the card out from under an active link.

Verified against a temp SQLite DB with real migrations: a new server
defaults to false, and toggling true/false both persist correctly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5 committed 2026-09-18 21:34:52 +02:00
1 parent f2a6253ddf
commit 08a984719f
8 files changed
+1193 -2

No files matched your search

+1
View File
@@ -0,0 +1 @@
ALTER TABLE `servers` ADD `hide_proxmox_link` integer DEFAULT false NOT NULL;
File diff suppressed because it is too large. Load diff
+7
View File
@@ -36,6 +36,13 @@
"when": 1789677988329,
"tag": "0004_brown_gambit",
"breakpoints": true
},
{
"idx": 5,
"version": "6",
"when": 1789759852933,
"tag": "0005_bent_violations",
"breakpoints": true
}
]
}
+7
View File
@@ -197,6 +197,13 @@ export const servers = sqliteTable("servers", {
proxmoxNode: text("proxmox_node"),
proxmoxGuestType: text("proxmox_guest_type").$type<ProxmoxGuestTypeCol>(),
proxmoxVmid: integer("proxmox_vmid"),
// Not every server is a Proxmox guest (bare-metal boxes, other hosts) — an
// admin can hide the "Proxmox link" card on this server's detail page
// rather than seeing an irrelevant option on every server. Ignored (the
// card always shows) once a server IS actually linked, so unlinking stays
// reachable.
hideProxmoxLink: integer("hide_proxmox_link", { mode: "boolean" }).notNull().default(false),
});
export const scheduledTasks = sqliteTable("scheduled_tasks", {
+1
View File
@@ -96,6 +96,7 @@ const updateServerSchema = z
proxmoxNode: z.string().nullable().optional(),
proxmoxGuestType: z.enum(["qemu", "lxc"]).nullable().optional(),
proxmoxVmid: z.number().int().nullable().optional(),
hideProxmoxLink: z.boolean().optional(),
})
.refine(
(data) => {