# Proxmox Integration - v1.2.1 Fixes Plan ## Executive Summary This plan addresses 4 critical issues reported against the Proxmox integration and ensures proper feature parity with Proxmox Datacenter Manager (PDM) while maintaining **MIT license compliance**. **Version:** v1.2.1 **Branch:** `fix/proxmox-v1.2.1` **Status:** Planning Phase --- ## Critical Issues to Fix ### Issue 1: Auto-updater for tftsr Application ❌ **Problem:** Auto-updater for the tftsr application itself is missing. User wants to pull from latest Stable and Pre-Release builds. **Root Cause:** - PDM does NOT have an application auto-updater (it's a server-side app) - tftsr has NO auto-updater implementation - No Tauri updater plugin installed - No updater UI in Settings section **Tauri Auto-Updater Requirements:** - `tauri-plugin-updater = "2"` dependency - Updater configuration in `tauri.conf.json` - Settings UI for channel selection (Stable/Pre-Release) - Backend commands for checking/updating **Solution:** 1. Add `tauri-plugin-updater` to Cargo.toml 2. Configure updater in tauri.conf.json with Gitea releases endpoint 3. Create Settings UI page for updater configuration 4. Add channel selector (Stable vs Pre-Release) 5. Implement check/update commands **Files to Modify:** - `src-tauri/Cargo.toml` - add updater plugin, **bump version to 1.2.1** - `src-tauri/tauri.conf.json` - add updater config, **bump version to 1.2.1** - `src/App.tsx` - add updater route - `src/pages/Settings/` - add updater UI - `src-tauri/src/commands/system.rs` - add updater commands **Gitea Release API:** - Stable: `https://gogs.tftsr.com/api/v1/repos/sarman/tftsr-devops_investigation/releases?latest=true` - Pre-Release: `https://gogs.tftsr.com/api/v1/repos/sarman/tftsr-devops_investigation/releases?prerelease=true` ### Issue 2: Dummy Data Preloaded ❌ **Problem:** Dummy Proxmox connection data is preloaded in the UI **Root Cause:** `src/pages/Proxmox/RemotesPage.tsx` lines 21-22 contain hardcoded dummy data: ```typescript const [remotes, setRemotes] = useState([ { id: '1', name: 'Production Cluster', url: 'https://pve1.example.com:8006', ... }, { id: '2', name: 'Backup Server', url: 'https://pbs1.example.com:8007', ... }, ]); ``` **Solution:** - Change initial state to empty array: `useState([])` - Fetch real data from backend via `list_proxmox_clusters` command - Display empty state UI when no remotes configured **Files to Modify:** - `src/pages/Proxmox/RemotesPage.tsx` - remove hardcoded data ### Issue 3: Cannot Create/Save Proxmox Connections ❌ **Problem:** User cannot create and save Proxmox connections to test functionality **Root Cause:** Frontend uses React component state instead of calling backend API commands. The `handleAddRemote` and `handleEditRemote` functions only update local state, not the database. **Solution:** 1. Add missing Tauri command wrappers (see Issue 4) 2. Update frontend to call backend commands: - `add_proxmox_cluster` - for creating new connections - `remove_proxmox_cluster` - for deleting connections - `list_proxmox_clusters` - for fetching existing connections **Files to Modify:** - `src/pages/Proxmox/RemotesPage.tsx` - wire up backend commands - `src-tauri/src/commands/proxmox.rs` - verify all commands exist ### Issue 4: Proxmox Section Collapsed by Default ⚠️ **Problem:** Proxmox section should be collapsed by default in sidebar **Solution:** - Modify `src/App.tsx` sidebar configuration - Set Proxmox menu item to collapsed state by default - User can expand as needed **Files to Modify:** - `src/App.tsx` - adjust sidebar default state --- ## PDM Feature Parity Analysis ### What PDM Actually Has (from `/home/sarman/Documents/proxmox-datacenter-manager`) #### ✅ Implemented in tftsr (Feature Parity Achieved) 1. **Dashboard Widgets** - 11 widget types 2. **Resource Tree View** - Hierarchical browser 3. **VM Manager UI** - Start/stop/reboot/shutdown 4. **Ceph Manager UI** - Pools, OSDs, monitors 5. **SDN Manager UI** - EVPN zones, virtual networks 6. **Firewall Manager UI** - Rule management 7. **HA Groups UI** - Group management 8. **User Management UI** - Realm management 9. **Certificate Manager UI** - Certificate management 10. **Subscription Registry UI** - Subscription keys 11. **Search Functionality** - Global search (Ctrl+Space) 12. **Notes System** - Remote notes 13. **Remote Shell** - Terminal access 14. **Task Management** - Task list and status #### ❌ Missing in tftsr (Backend Commands Only) 1. **VM Operations** - Create, clone, delete VMs 2. **VM Snapshots** - Create, rollback, delete snapshots 3. **Backup Job Management** - Create, edit, delete jobs 4. **Ceph Pool Management** - Create, delete, quota management 5. **Ceph OSD Management** - Set weight, mark in/out, zap 6. **Firewall Rule Management** - Move up/down, enable/disable 7. **HA Group Management** - Create, edit, delete groups 8. **Auth Realm Management** - Create, edit, delete realms 9. **Certificate Management** - Upload, delete, renew 10. **Subscription Management** - Add, remove subscription keys #### ⚠️ Documentation Issues 1. **"Phase 8-17" claimed as complete** but no IPC interface 2. **"100% feature parity"** overstated - missing backend commands 3. **UI components exist** but no backend integration --- ## MIT Compliance Requirements ### CRITICAL: Do NOT Copy PDM Code **PDM License:** AGPL-3 (NOT MIT compatible) **What We CAN Do:** - ✅ Use PDM API documentation as reference - ✅ Implement features from scratch - ✅ Follow tftsr's architecture patterns - ✅ Use official Proxmox VE/PBS API docs **What We CANNOT Do:** - ❌ Copy PDM source code directly - ❌ Use PDM UI components - ❌ Use PDM Rust modules - ❌ Reference PDM code in implementation **Implementation Strategy:** 1. Review PDM's API endpoints in `server/src/api/` 2. Implement equivalent Rust backend commands in tftsr 3. Create React/TypeScript UI components in tftsr 4. Ensure all code follows tftsr's existing patterns --- ## Implementation Plan ### Phase 1: Critical Fixes (High Priority) **Time Estimate:** 3-4 hours 1. **Create new branch** `fix/proxmox-v1.2.1` 2. **Add tauri-plugin-updater** - Enable auto-updater for tftsr 3. **Configure updater in tauri.conf.json** - Gitea releases endpoint 4. **Create Settings UI page** - Channel selector (Stable/Pre-Release) 5. **Add updater backend commands** - Check, download, install updates 6. **Remove dummy data** from `RemotesPage.tsx` 7. **Fix connection save** - wire frontend to backend commands 8. **Add Proxmox collapsed** to sidebar default 9. **Update CHANGELOG.md** to v1.2.1 ### Phase 2: Backend Command Wrappers (Medium Priority) **Time Estimate:** 3-4 hours 11. **Add missing Tauri commands** for: - VM operations (create, clone, delete) - Snapshot operations (create, rollback, delete) - Backup job management (create, edit, delete) - Ceph pool management (create, delete, quota) - Ceph OSD management (weight, in/out, zap) - Firewall rules (move, enable/disable) - HA groups (create, edit, delete) - Auth realms (create, edit, delete) - Certificates (upload, delete, renew) - Subscriptions (add, remove keys) ### Phase 3: Documentation Updates (Medium Priority) **Time Estimate:** 1-2 hours 12. **Update feature parity docs** - correct "100% complete" claims 13. **Update implementation summary** - reflect actual status 14. **Add missing features** section 15. **Remove outdated phase claims** ### Phase 4: Verification (High Priority) **Time Estimate:** 1-2 hours 16. **Run cargo fmt** - format Rust code 17. **Run cargo clippy** - fix warnings 18. **Run cargo test** - verify all tests pass 19. **Run npm run build** - verify frontend builds 20. **Run npm run test** - verify frontend tests pass --- ## Files to Modify ### Critical (Phase 1) 1. `src-tauri/Cargo.toml` - Add tauri-plugin-updater, update version to 1.2.1 2. `src-tauri/tauri.conf.json` - Add updater config, update version to 1.2.1 3. `src/pages/Proxmox/RemotesPage.tsx` - Remove dummy data, add backend integration 4. `src/App.tsx` - Make Proxmox section collapsed by default, add updater route 5. `CHANGELOG.md` - Add v1.2.1 entry 6. `src-tauri/src/commands/system.rs` - Add updater commands 7. `src/pages/Settings/` - Create updater settings page ### Backend (Phase 2) 8. `src-tauri/src/commands/proxmox.rs` - Add missing command wrappers 9. `src-tauri/src/proxmox/*.rs` - Verify backend functions exist ### Documentation (Phase 3) 8. `docs/PROXMOX-FEATURE-PARITY-STATUS.md` - Correct phase claims 9. `docs/PROXMOX-COMPLETE.md` - Update status 10. `docs/PROXMOX-IMPLEMENTATION-SUMMARY.md` - Update implementation status 11. `docs/wiki/Proxmox-Management.md` - Add if missing --- ## Testing Strategy ### Manual Testing Checklist - [ ] Create new Proxmox VE connection - [ ] Create new Proxmox PBS connection - [ ] Edit existing connection - [ ] Delete connection - [ ] List all connections - [ ] Verify no dummy data on page load - [ ] Verify Proxmox section collapsed by default - [ ] Test VM operations (start/stop/reboot/shutdown) - [ ] Test Ceph pool operations - [ ] Test SDN zone operations - [ ] Test firewall rule operations ### Automated Testing - [ ] Rust unit tests pass (64 tests) - [ ] Rust clippy passes (0 warnings) - [ ] Rust format check passes - [ ] TypeScript compilation passes - [ ] ESLint passes (0 errors) - [ ] Frontend unit tests pass (13 tests) --- ## Success Criteria ### Issue Resolution - [ ] No dummy data preloaded in Proxmox remotes - [ ] User can create, edit, delete Proxmox connections - [ ] Connections saved to database (not just React state) - [ ] Proxmox section collapsed by default in sidebar - [ ] Auto-updater implemented with Stable/Pre-Release channel selection - [ ] Updates download from Gitea releases API ### Feature Parity - [ ] All documented PDM features implemented - [ ] Backend command wrappers for all UI components - [ ] Frontend calls backend commands correctly - [ ] Documentation reflects actual implementation status ### Code Quality - [ ] 0 clippy warnings - [ ] 0 test failures - [ ] 0 TypeScript errors - [ ] 0 ESLint errors - [ ] MIT license compliance verified --- ## Risks & Mitigations ### Risk 1: Backend Commands Missing **Mitigation:** Verify all backend functions exist in `src-tauri/src/proxmox/` before adding command wrappers. ### Risk 2: Frontend Integration Breaking **Mitigation:** Test each change incrementally, commit after each working change. ### Risk 3: Documentation Inconsistency **Mitigation:** Update all docs in single commit to ensure consistency. ### Risk 4: MIT Compliance Violation **Mitigation:** Never copy PDM source code. Use only API documentation as reference. --- ## Notes 1. **PDM does NOT have app auto-updater** - it's a server-side app with manual updates 2. **PDM uses Yew (Rust WASM)** - completely different from tftsr's React/TypeScript 3. **PDM is AGPL-3** - cannot copy code, must implement from scratch 4. **tftsr has solid foundation** - many UI components exist, need backend integration 5. **Documentation overstated** - "100% complete" claims need correction 6. **Auto-updater for tftsr** - Will use Tauri's updater plugin with Gitea releases API 7. **Version bump required** - Cargo.toml (1.2.0 → 1.2.1), tauri.conf.json (1.1.0 → 1.2.1) 8. **Updater location** - No updater currently exists in Proxmox section; this issue is about adding app auto-updater to Settings, not moving existing Proxmox updates --- **Document Version:** 1.1 **Last Updated:** 2026-06-13 **Author:** AI Assistant **Status:** Implementation Complete - PR #95 Created