# ADR-002: UI Integration Strategy **Date**: 2026-05-15 **Status**: Accepted **Deciders**: Kevin Adams ## Context The plugin currently adds a UI by patching `pvemanagerlib.js`, the monolithic JavaScript bundle that is Proxmox VE's entire web UI. A separate versioned patch file must be maintained for each Proxmox VE minor release. When PVE updates, the patch breaks. The desired end state is a UI that: - Doesn't break on every PVE update - Ideally doesn't require patching PVE system files - Shows appropriate fields for TrueNAS API credentials ## Options Evaluated ### Option A — Continue Patching pvemanagerlib.js (Status Quo) The current approach. Diff the upstream PVE JS, produce a patch per PVE version. - **Pro**: Works in all PVE versions, field placement is ideal - **Con**: Breaks on every PVE minor release; versioned patch sprawl is visible in the repo already (stable-5 through stable-8 folders) - **Verdict**: Manageable with better automation (auto-detect PVE version in postinst and select the right patch) ### Option B — Serve a Separate JS File via pveproxy Proxmox VE's `pveproxy` serves everything from `/usr/share/pve-manager/`. The HTML template (`/usr/share/pve-manager/index.html.tpl`) explicitly lists which JS files to load. A new file could be injected either by: (a) Patching `index.html.tpl` to add a `