Commit graph

443 commits

Author SHA1 Message Date
rcourtman
0b717bfa44 Improve test coverage 2025-12-17 12:00:59 +00:00
rcourtman
307bb9f6cc feat: add Linux agent archives to releases and improve version mismatch detection
Release improvements:
- Add standalone Linux agent archives (amd64, arm64, armv7, armv6, 386) to releases
- Previously only Darwin/Windows had standalone agent downloads

Agent version mismatch detection:
- New agentVersion.ts utility compares agent versions against server version
- DockerHostSummaryTable now shows accurate 'outdated' warnings when
  agent version is older than the connected Pulse server
- Better tooltips explain version status and upgrade instructions
2025-12-16 22:51:10 +00:00
rcourtman
6bfa8a3837 fix: AI model selector dropdown overflow on small screens
Add max-height and overflow-y-auto to the model selector dropdown in
the AI chat panel to prevent it from extending past the screen when
there are many models available (e.g., with Ollama).

Fixes feedback from discussion #845
2025-12-16 20:59:42 +00:00
rcourtman
a9c0a4d682 feat: configurable backup freshness thresholds for dashboard indicator
Adds FreshHours and StaleHours settings to control when the dashboard
backup indicator shows green (fresh), amber (stale), or red (critical).

- Backend: Added FreshHours/StaleHours to BackupAlertConfig (default 24/72 hours)
- Frontend: getBackupInfo() now accepts optional thresholds parameter
- Dashboard/GuestRow components use thresholds from alert config
- Settings saved/loaded with alert configuration

Closes #839
2025-12-16 16:36:08 +00:00
rcourtman
a8957a2e7b feat(ui): make AI settings page more compact and user-friendly
- Replace verbose info banner with streamlined layout
- Add collapsible 'Advanced Model Selection' accordion for Chat/Patrol models
- Make AI Patrol Settings section collapsible with inline summary badges
- Compact Cost Controls into single-row inline layout
- Reduce form spacing for tighter presentation
- Remove unused formHelpText import

Also includes:
- OpenAI provider fixes for max_tokens parameters
- Security setup CSRF and 401 fixes
- Minor UI tweaks
2025-12-16 09:20:09 +00:00
rcourtman
101fa62997 fix(security): show actual backend error instead of misleading DISABLE_AUTH message
The frontend was incorrectly assuming any 401/403 response from the
quick-setup endpoint meant the legacy DISABLE_AUTH flag was present.

This was wrong - the real causes are typically:
- Missing bootstrap token (for first-run setup)
- Invalid bootstrap token
- Authentication required for existing setups

Now the frontend properly displays the actual error message from the
backend, which includes helpful instructions for retrieving the
bootstrap token.
2025-12-15 22:30:24 +00:00
rcourtman
a3909f1b39 fix: strip provider prefix from all AI provider models and instant URL refresh
Backend fixes:
- Strip provider prefix (anthropic:, openai:, deepseek:, ollama:) in all
  provider Chat methods and constructors for robust handling
- Models are now correctly parsed regardless of caller format

Frontend fixes:
- Tool cards now persist in AI chat after approval execution by adding
  to streamEvents array
- Dashboard now listens for pulse:metadata-changed custom event
- AI Chat emits this event when set_resource_url tool completes
- Guest URL icons now update instantly when AI sets them
2025-12-15 19:18:09 +00:00
rcourtman
43d658556b feat(ai): improve AI settings first-time setup UX
- Add setup modal that appears when enabling AI without configured provider
- Modal allows selecting provider (Anthropic, OpenAI, DeepSeek, Ollama)
- Enter API key/URL and enable AI in one smooth flow
- Reorder backend to apply API keys before enabled check
- Fix Ollama to strip 'ollama:' prefix from model names
- Simplify backend error message for unconfigured providers
2025-12-15 18:59:19 +00:00
rcourtman
06ae5295b3 fix(ai): send Ollama URL when using default localhost address
The form pre-fills the Ollama URL field with http://localhost:11434 but
compared it against that same default value to detect changes. This meant
users configuring Ollama with the default URL never actually saved it.

Also shows actual backend error messages instead of generic "Failed to update"
when toggling the AI enable switch.

Related to #847
2025-12-15 10:03:15 +00:00
rcourtman
3b4c77de28 fix(ui): add CPU tooltip to Proxmox Overview. Related to #816 2025-12-15 02:06:12 +00:00
rcourtman
9e7240042f fix(ui): apply threshold-based coloring to memory bars
Fixes #828

Memory bars were always showing green regardless of usage percentage.
Added getMemoryColor() function that applies threshold-based coloring:
- Green: Below 70%
- Yellow/Orange: 70-90%
- Red: Above 90%

This matches the existing disk bar behavior and restores the expected
visual warning for high memory usage.
2025-12-14 22:11:07 +00:00
rcourtman
3948652a21 fix(docker): truncate long image names in container table
Fixes #825

Long Docker image names (like Immich postgres containers) were expanding
the entire table row, requiring horizontal scrolling to see CPU/Memory.

Changed the image cell to use:
- Inline style max-width (more reliable in table layouts)
- Block span with truncate class
- overflow-hidden on parent container

Images now truncate with ellipsis at 200px, with full name in tooltip.
2025-12-14 22:05:38 +00:00
rcourtman
b004f6d017 fix(ui): stabilize type badge order in unified agents table
Fixes #773

The type badge order was flapping between 'Host Docker' and 'Docker Host'
because Array.from(new Set([...])) doesn't preserve insertion order reliably.

Added a sortTypes helper that ensures types are always displayed in a
consistent order: 'host' before 'docker'. This prevents visual flapping
even when the underlying data sources update at slightly different times.
2025-12-14 21:51:06 +00:00
rcourtman
aca2534a1a fix: Quick tips banner incorrectly states 0 disables alerts, should be -1
The Quick tips banner on the Alerts page said "Set any threshold to 0" but
the actual code uses -1 to disable alerts. The tooltips on individual fields
were correct; only the top-of-page banner was wrong.

Related to #843
2025-12-14 19:08:24 +00:00
rcourtman
49c30ea412 fix: update UnifiedAgents test for 'Force Docker' label change 2025-12-14 18:11:13 +00:00
rcourtman
6795f83e63 feat: auto-detect platforms during agent install and allow multi-host tokens
- Install script now auto-detects Docker, Kubernetes, and Proxmox
- Platform monitoring is enabled automatically when detected
- Users can override with --disable-* or --enable-* flags
- Allow same token to register multiple hosts (one per hostname)
- Update tests to reflect new multi-host token behavior
- Improve CompleteStep and UnifiedAgents UI components
- Update UNIFIED_AGENT.md documentation
2025-12-14 16:21:59 +00:00
rcourtman
eb59faaa4a fix: cluster-aware guest deduplication and multi-agent token binding
- Add cluster-aware guest ID generation (clusterName-VMID instead of instanceName-VMID)
  to prevent duplicate VMs/containers when multiple cluster nodes are monitored

- Add cluster deduplication at registration time - when a node is added that belongs
  to an already-configured cluster, merge as endpoint instead of creating duplicate

- Add startup consolidation to automatically merge duplicate cluster instances

- Change host agent token binding from agent GUID to hostname, allowing:
  - Multiple host agents to share a token (each bound by hostname)
  - Agent reinstalls on same host without token conflicts

- Remove 12-character password minimum requirement

- Remove emoji from auto-registration success message

- Fix grouped view node lookup to support both cluster-aware node IDs
  (clusterName-nodeName) and legacy guest grouping keys (instance-nodeName)

Fixes duplicate guests appearing when agents are installed on multiple
cluster nodes. Also improves multi-agent UX by allowing shared tokens.
2025-12-14 10:16:17 +00:00
rcourtman
1b8a310f2e feat: display linked host agent badge on PVE nodes
- NodeGroupHeader shows '+ Host Agent' badge when node has linked agent
- NodeSummaryTable shows '+Agent' badge in the node row
- Filter out linked hosts from Managed Agents list (prevents duplication)

This provides visual feedback when a PVE node has enhanced monitoring
via an installed host agent.
2025-12-13 23:18:31 +00:00
rcourtman
db8afeea18 feat: frontend support for linked host agents and PVE nodes
- Added linkedHostAgentId to Node interface
- Added linkedNodeId/linkedVmId/linkedContainerId to Host interface
- Filter out linked hosts from 'Managed Agents' list (they show merged with nodes)

Next: Update Dashboard to display linked entity badges
2025-12-13 23:16:48 +00:00
rcourtman
cc5586c5c0 feat: auto-generate new token after each install command copy
Users no longer need to manually click 'New Token' - a fresh token is
automatically generated after each copy. The command shown is always
ready for the next host.
2025-12-13 23:00:58 +00:00
rcourtman
893d3d5c79 fix: clarify one-token-per-host requirement and improve stale agent cleanup
- Setup wizard now clearly states 'Use a different token for each host'
- New Token button is always visible and more prominent (blue styling)
- WebSocket store now clears stale agents (>60s since lastSeen) immediately
  when receiving empty host arrays, instead of waiting for 3 consecutive updates
2025-12-13 22:57:00 +00:00
rcourtman
68456763f9 fix: apply empty agent updates immediately when existing agents are stale
The anti-flapping logic previously required 3 consecutive empty updates
before clearing stale agents from the UI. Now if all existing hosts/dockerHosts
have lastSeen > 60 seconds ago, empty updates are applied immediately.

This fixes the issue where removed agents stayed visible for too long.
2025-12-13 22:41:15 +00:00
rcourtman
122bd49700 fix: clarify that one token works on multiple hosts
Changed misleading 'Each copy uses a unique token' to 'Use the same
command on multiple servers'. Also toned down the 'Different Token'
button since it's rarely needed.
2025-12-13 22:22:25 +00:00
rcourtman
9aa1000bdb feat: make uninstall command always visible in Agents settings
Previously the uninstall command was hidden behind the token generation step.
Now it's always visible at the bottom of the 'Add a unified agent' card.
2025-12-13 21:41:27 +00:00
rcourtman
1a9973461e chore: update lockfiles 2025-12-13 21:30:57 +00:00
rcourtman
7891027d55 style: replace emojis with text indicators in UI components
- SecurityWarning: replace emoji icons with text-based indicators
- NodeModal: minor formatting cleanup
2025-12-13 21:30:44 +00:00
rcourtman
7eb6d33dad fix: add null safety checks for resources() in useResourcesAsLegacy
Prevents errors when resources array is undefined during initial load.
2025-12-13 21:30:36 +00:00
rcourtman
4ad8235f7a feat: add API token to WebSocket URL for authentication
WebSocket connections can't send custom headers, so the token is passed
as a query parameter. Works with the backend change to support ?token= auth.
2025-12-13 21:30:27 +00:00
rcourtman
a5893bba21 perf: debounce search and optimize filter parsing in Backups and Storage
- UnifiedBackups: memoize parsed search filters, debounce search input
- Storage: debounce search input to prevent jank during rapid typing
2025-12-13 21:29:45 +00:00
rcourtman
d5638c7c14 perf: debounce search input in Kubernetes clusters view
Prevents UI jank during rapid typing by using a 200ms debounced search term.
2025-12-13 21:28:19 +00:00
rcourtman
8abcc93aac perf: optimize Dashboard guest sorting and parent node lookups
- Pre-compute guest-to-parent-node mapping to avoid repeated lookups during render
- Memoize sort comparator to avoid duplicating sorting logic
- Reduces computational overhead when rendering large guest lists
2025-12-13 21:27:50 +00:00
rcourtman
8ed0851fb9 feat: simplify setup wizard to 3 steps (welcome, security, complete)
Removed Connect and Features steps that were adding friction without much value.
The wizard now focuses on:
1. Welcome - introduction and bootstrap token entry
2. Security - credential setup
3. Complete - shows install command and connected agents

Agent polling now happens in CompleteStep instead of relying on WebSockets
which aren't available during the pre-login setup phase.
2025-12-13 21:27:21 +00:00
rcourtman
7ae0b5cafd fix: Hide AI sidebar button when AI is disabled
The button was showing when aiChatStore.enabled was undefined.
Changed condition from 'enabled !== false' to 'enabled === true'
to only show when AI is explicitly enabled.
2025-12-13 16:13:25 +00:00
rcourtman
ae3e3a64f0 fix: Make OIDC toggle auto-save when disabling
- Disabling OIDC now saves immediately (safe operation)
- Enabling requires Save button press (prevents lockout without config)
- Shows helpful hint when enabling: configure first, then save
2025-12-13 16:09:48 +00:00
rcourtman
e4fa231ad3 fix: Make AI Assistant toggle auto-save immediately
The toggle was only updating local state without persisting.
Now it saves and shows confirmation feedback on toggle.
2025-12-13 16:01:03 +00:00
rcourtman
5a52913a90 fix: Resolve TypeScript errors and add ARIA accessibility
- Fixed type mismatches in ProxmoxAgentNodesPanel (prop signatures)
- Fixed temperatureTransports type (array vs single object)
- Added ARIA attributes to SetupWizard for screen reader support
- All tsc --noEmit checks pass
2025-12-13 15:49:37 +00:00
rcourtman
414574739b chore: Use proper logger in WelcomeStep instead of console.error 2025-12-13 15:43:13 +00:00
rcourtman
c1d9c1bb95 fix: Correct NodeConfig import path in ProxmoxAgentNodesPanel 2025-12-13 15:39:28 +00:00
rcourtman
e470fbec83 chore: Fix lint warnings in SetupWizard and add AI API docs
- Fixed unused variables in wizard components
- Fixed invalid aiEnabled field in FeaturesStep (AI uses separate API)
- Added AI endpoints section to API.md
2025-12-13 15:36:40 +00:00
rcourtman
e27b6f2657 Merge main into ai-features: incorporate latest bugfixes
Resolved conflicts:
- pkg/fsfilters/filters.go: Keep both TrueNAS and EnhanceCP filter fixes
- DockerUnifiedTable.tsx: Use main's resource column overlap fix
2025-12-13 15:18:51 +00:00
rcourtman
cb06077fab feat: Add multi-step Setup Wizard for Pulse 5.0 onboarding
- New SetupWizard component with 5-step flow:
  1. Welcome: Bootstrap token unlock, platform showcase
  2. Security: Admin account + API token creation
  3. Connect: Multi-platform infrastructure (Proxmox, Docker, K8s)
  4. Features: AI and auto-updates toggles
  5. Complete: Credentials display with copy/download

- Replaced FirstRunSetup with SetupWizard in Login.tsx
- Added Install Update button to UpdatesSettingsPanel
- Enhanced UpdatesSettingsPanel with update plan integration
- Added UpdateConfirmationModal to Settings for inline updates

Positions Pulse as a unified infrastructure monitoring platform,
not just a Proxmox-specific tool.
2025-12-13 15:08:47 +00:00
rcourtman
dbac8632b7 feat: add persistent metrics history API endpoint
- Add GET /api/metrics-store/history endpoint for querying SQLite-backed metrics
- Support flexible time ranges: 1h, 6h, 12h, 24h, 7d, 30d, 90d
- Return aggregated data with min/max values for longer time ranges
- Add TypeScript types and ChartsAPI.getMetricsHistory() client method

This enables frontend charts to visualize long-term trends using the
tiered retention system (raw → minute → hourly → daily averages).
2025-12-13 14:18:16 +00:00
rcourtman
17aaf6d603 Enhance settings panels with improved UI/UX
General Settings:
- Add animated sun/moon icon to dark mode toggle with gradient backgrounds
- Dynamic label showing current theme state (Light mode/Dark mode)
- Smooth CSS transitions for icon rotation and scaling

Updates Settings:
- Redesign version display with visual card layout
- Add build type badges (Development, Docker, Source) as colorful pills
- Show 3-column layout with arrow indicator when updates available
- Move Check Now button to footer with refresh icon
- Display auto-check status indicator

Security Overview:
- Add loading skeleton during data fetch
- Enhance proxy auth notice with gradient header and admin badge
- Style logout/guide links as proper buttons
- Add Security Best Practices tips card with recommendations
2025-12-13 13:41:43 +00:00
rcourtman
c5ac33e8c6 feat(backups): Add time format toggle to BackupsFilter
- Added toggle button to switch between relative and absolute time display
- Time preference is persisted to localStorage
- Toggle shows clock icon with 'Relative' or 'Absolute' label
- Implements the TODO from UnifiedBackups.tsx
2025-12-13 13:17:35 +00:00
rcourtman
75874687fb chore: Fix all remaining lint warnings
- Prefix unused catch error variables with underscore in AIChat.tsx and Alerts.tsx
- Reduced lint warnings from 8 to 0
- Clean lint output with no warnings or errors
2025-12-13 11:05:08 +00:00
rcourtman
3c0f4aa576 chore(settings): Remove unused diagnostics code and cleanup
- Removed unused helper functions (formatIsoDateTime, formatIsoRelativeTime, etc.)
- Removed unused handler functions (handleRegisterProxyNodes, handleDockerPrepareToken, handleCopy)
- Removed unused type interfaces (ProxyRegisterNode, DockerMigrationResult)
- Removed unused imports (copyToClipboard, showTokenReveal, APITokenRecord)
- Removed unused state signals for diagnostics actions
- Reduced lint warnings from 26 to 8
- Settings.tsx reduced from 5955 to 5740 lines
2025-12-13 10:53:18 +00:00
rcourtman
529daf58f8 chore(settings): Prefix unused variables to suppress lint warnings
- Prefix unused destructured variables with underscore
- Reduces lint warnings from 26 to 18
- Remaining warnings are for legacy helper functions
2025-12-13 08:02:24 +00:00
rcourtman
065cbe46cf chore(settings): Clean up unused imports and optimize polling
- Removed unused getPulsePort/getPulseWebSocketUrl imports
- Optimized polling to only run on proxmox tab (DiagnosticsPanel handles its own fetching)
- Remaining lint warnings are for legacy code that may need future refactoring
2025-12-13 07:59:52 +00:00
rcourtman
de2f6e0edb enhance(settings): Improve SecurityPostureSummary with score indicator
- Added dynamic security score calculation (0-100%)
- Added gradient header that changes color based on score:
  - Green (>=80%): Strong security
  - Amber (50-79%): Moderate security
  - Red (<50%): Weak security
- Improved visual hierarchy with color-coded status cards
- Added 'Critical' labels for important missing features
- Changed icons to lucide-solid for consistency
2025-12-13 07:54:09 +00:00
rcourtman
6a3c143740 refactor(settings): Extract DiagnosticsPanel and improve AI Settings UX
- Created standalone DiagnosticsPanel component with modern visual design
  - Gradient header with system health indicator
  - Card-based layout for System Runtime, PVE Nodes, PBS, Discovery
  - Status badges and improved visual hierarchy
  - Export functionality (full and GitHub-sanitized)

- Reduced Settings.tsx from 8,035 to 5,956 lines (26% reduction)
  - Removed ~2,079 lines of inline diagnostics code
  - Improved maintainability by encapsulating diagnostics logic

- Improved AI Settings UX:
  - Cost Controls: Gradient design, RECOMMENDED badge, $ prefix
  - Shows daily/weekly budget equivalents when value is entered
  - Auto-Fix: Streamlined acknowledgment with clear button instead of checkbox
  - Better visual hierarchy throughout
2025-12-13 07:51:49 +00:00