Commit graph

4826 commits

Author SHA1 Message Date
rcourtman
a4cfc09061 chore: reduce minimum password length to 1
Allows users to choose their own password security level instead of
enforcing a 12-character minimum. Users are adults.
2025-12-13 21:29:00 +00:00
rcourtman
1dc573e209 feat: support token query parameter for WebSocket authentication
Allows WebSocket connections to authenticate via ?token= query parameter
when headers cannot be sent (browser WebSocket limitations).
2025-12-13 21:28:50 +00:00
rcourtman
2675ac6497 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
467fbf7e73 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
329672209e 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
7acff2215c style: remove emojis from AI context formatting and prompts
Replaced emoji indicators with text equivalents for better cross-platform
compatibility and cleaner LLM prompts.
2025-12-13 21:26:49 +00:00
rcourtman
5e3a2849b4 chore: add upgrade detection and messaging to install script
Shows version information when upgrading an existing pulse-agent installation.
Minor UX improvement - script already handled upgrades correctly.
2025-12-13 21:22:14 +00:00
rcourtman
8919281718 fix: clear agents that connected during unauthenticated setup window
When no auth is configured (fresh install), CheckAuth allows all requests.
This creates a race condition where existing agents from a previous setup
can report data before the wizard completes security configuration.

This fix clears all host agents and docker hosts when /api/security/quick-setup
is called, ensuring the wizard shows a clean state after security is configured.

Added:
- State.ClearAllHosts() - removes all host agents
- State.ClearAllDockerHosts() - removes all docker hosts
- Monitor.ClearUnauthenticatedAgents() - clears both and resets token bindings
- Call to ClearUnauthenticatedAgents() in handleQuickSecuritySetupFixed()
2025-12-13 21:22:04 +00:00
rcourtman
163276ef78 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
21e96aa54c 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
2dc03b02a5 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
f476e26e1c Merge ai-features into main for 5.0 release
Major features:
- Pulse AI (chat, patrol, auto-fix, multi-provider)
- Kubernetes monitoring via agents
- OCI container support (Proxmox 9.1+)
- Proxmox Mail Gateway monitoring
- Metrics history with configurable retention
- Multi-step Setup Wizard
- One-click updates
- OIDC/SSO support

Documentation:
- Added AI.md, METRICS_HISTORY.md, MAIL_GATEWAY.md, AUTO_UPDATE.md
- Updated README with 5.0 features
- Added AI endpoints to API.md

Fixes:
- TypeScript strict mode compliance
- ARIA accessibility in wizard
- Shell script permissions
- Console.log cleanup
2025-12-13 15:49:57 +00:00
rcourtman
4c0e243cc9 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
dd6107406f fix: Add execute permissions to shell scripts 2025-12-13 15:44:51 +00:00
rcourtman
dea2f62e3a chore: Use proper logger in WelcomeStep instead of console.error 2025-12-13 15:43:13 +00:00
rcourtman
6cf2788e61 fix: Correct NodeConfig import path in ProxmoxAgentNodesPanel 2025-12-13 15:39:28 +00:00
rcourtman
5e2311035b 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
3497780426 docs: Update README with 5.0 features - AI, K8s, multi-platform 2025-12-13 15:30:57 +00:00
rcourtman
9d255c6d58 docs: Add documentation for Pulse 5.0 features
- AI.md: Pulse AI assistant (chat, patrol, auto-fix)
- METRICS_HISTORY.md: Persistent metrics storage
- MAIL_GATEWAY.md: PMG monitoring support
- AUTO_UPDATE.md: One-click updates
- Updated README.md with 5.0 features section
2025-12-13 15:27:36 +00:00
rcourtman
1b85986b26 chore: remove machine-specific dev workflow from tracking 2025-12-13 15:22:37 +00:00
rcourtman
3a2a73f9d6 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
c3fdb6d6f8 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
5c4069cdbf 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
97f2bfa1ed feat: add configurable metrics retention settings
- Add MetricsRetentionRawHours, MetricsRetentionMinuteHours, MetricsRetentionHourlyDays, MetricsRetentionDailyDays to SystemSettings
- Wire settings from system.json through Config to metrics store initialization
- Set sensible defaults: Raw=2h, Minute=24h, Hourly=7d, Daily=90d
- Log active retention values on startup for transparency

Users can now customize how long metrics are stored at each aggregation tier.
2025-12-13 14:14:07 +00:00
rcourtman
e228f15063 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
26802cd7bf feat(backend): Implement remaining TODOs
1. resources/store.go: Implement sorting in Query.Execute()
   - Added sortResources function with support for common fields
   - Supports: name, type, status, cpu, memory, disk, last_seen
   - Both ascending and descending order supported

2. ai/service.go: Implement hasAgentForTarget properly
   - Now maps target to specific agent based on hostname/node
   - Uses ResourceProvider lookup for container→host mapping
   - Supports cluster peer routing for Proxmox clusters
   - Properly handles single-agent vs multi-agent scenarios
2025-12-13 13:21:23 +00:00
rcourtman
163c0eaf26 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
5a7ccc6ca9 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
90f0e32eee 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
bd19a7a1c5 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
62d1be3d06 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
bdeea3a7c4 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
1c0f7e21a5 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
rcourtman
0ade1ac223 fix(frontend): hide unconfigured navigation tabs 2025-12-13 00:21:00 +00:00
rcourtman
e71916f246 Redesign Ceph, Replication, and Mail Gateway pages for UI consistency
- Ceph: Complete rework with summary cards (storage, clusters, services, pools),
  search with type-to-search, proper loading/disconnected/empty states, cluster
  overview table, pools table with filtering, health badges with tooltips

- Replication: Add summary cards (total/healthy/issues/next sync), status filter
  buttons (All/Healthy/Warning/Error), search with type-to-search, countdown timers
  for next sync with overdue/imminent highlighting, row highlighting for problem jobs,
  error tooltips, loading state

- Mail Gateway: Add aggregate summary cards across all instances (mail/spam/virus/
  quarantine/queue), visual threat rate progress bars, status badges with health
  indicators, queue depth tooltips with breakdown, streamlined stats grid with
  color-coded threat categories, improved cluster nodes table

All three pages now follow the same design patterns as Dashboard, Hosts, Docker,
and Storage using Card, EmptyState, and consistent styling.
2025-12-13 00:08:29 +00:00
rcourtman
c0e01a5651 fix(hosts): Merge filter sections into single row 2025-12-12 23:43:13 +00:00
rcourtman
7c01168884 style(hosts,docker): Move search bar to its own row above filters
- Consistent with Kubernetes page layout
- Search bar now takes full width on top row
- Filter toggles on second row below search
2025-12-12 23:41:37 +00:00
rcourtman
93355847f2 style(kubernetes): Move search bar to its own row above filters 2025-12-12 23:37:49 +00:00
rcourtman
0b0c514e6e feat(kubernetes): Add keyboard focus for search input
- Typing anywhere on the page auto-focuses the search input
- Escape key clears search and blurs input
- Matches Dashboard behavior for consistent UX
- Fixed missing createEffect import
2025-12-12 23:36:31 +00:00
rcourtman
8852432a8e feat(kubernetes): Add column picker and sorting for all views
- Add sortable headers to Clusters and Nodes views
- Add ColumnPicker dropdown for Pods view (toggle Namespace, Cluster, Ready, Restarts, Image, Age columns)
- Column visibility persists to localStorage
- Sorting persists across sessions for all views
2025-12-12 23:31:46 +00:00
rcourtman
eee11d0c66 feat(kubernetes): Add sorting and namespace filter to K8s UI
- Add sortable table headers for Pod and Deployment views
- Click column headers to toggle sort direction
- Sort state persists across sessions
- Add namespace dropdown filter for Pods/Deployments views
- Auto-populates from available namespaces
- Include namespace filter in reset and active filters check
2025-12-12 23:24:04 +00:00
rcourtman
655c9f81c3 feat(kubernetes): Add Kubernetes mock data and UI
Backend:
- Add K8s cluster, node, pod, deployment mock data generation
- Configurable via PULSE_MOCK_K8S_CLUSTERS, PULSE_MOCK_K8S_NODES,
  PULSE_MOCK_K8S_PODS, PULSE_MOCK_K8S_DEPLOYMENTS env vars
- Generate realistic cluster data with versions, namespaces, pod phases
- Add dynamic metric updates for K8s resources
- Deep copy K8s data in cloneState to prevent race conditions

Frontend:
- Add KubernetesClusters component with 4 view modes:
  Clusters, Nodes, Pods, Deployments
- Filter bar with search, status filter, show hidden toggle
- Nodes view: status, roles, CPU/memory/pod capacity, kubelet version
- Pods view: namespace, status, ready containers, restarts, image, age
- Deployments view: replicas, ready/up-to-date status
- Matches Docker/Dashboard table styling patterns
2025-12-12 23:13:40 +00:00
rcourtman
a259b67348 feat: add Kubernetes platform support 2025-12-12 21:31:11 +00:00
rcourtman
23a27b5b93 fix: correct AI tool description for guest resource ID format
The set_resource_url tool had an incorrect example ID format ('pve1-delly-101')
which caused the AI to save URLs with wrong IDs that didn't match the actual
guest IDs used by Pulse ('instance-VMID' format like 'delly-150').

This fix updates the tool description to clearly document the correct format,
so URLs saved by the AI will now properly appear in the dashboard.
2025-12-12 21:28:34 +00:00
rcourtman
c7361362b3 fix: Robust OCI container detection with state persistence
Backend:
- Seed OCI classification from previous state so containers never
  'downgrade' to LXC if config fetching intermittently fails
- Prevent type regression in recordGuestSnapshot when OCI was previously detected
- Move metrics zeroing before snapshot recording for cleaner flow

Frontend:
- Add isOCIContainer() memo that checks both type and isOci flag
- Use isOCI helper in Dashboard.tsx for AI context building
- Include oci-container type in useResources container conversion
- Preserve isOci and osTemplate fields through legacy conversion

This ensures OCI containers retain their classification even when
Proxmox API permissions or transient errors prevent config reads.
2025-12-12 20:06:39 +00:00
rcourtman
100d639d13 fix: Preserve OCI container type through unified resource conversion
The useResources.ts hook was hardcoding type: 'lxc' when converting
unified resources to legacy container format, causing OCI containers
to intermittently display as LXC when WebSocket updates occurred.

Now preserves the actual type from platformData (oci/lxc).
2025-12-12 19:18:36 +00:00
rcourtman
5456b75bf3 fix: Allow OCI detection for stopped containers
- Refactored enrichContainerMetadata to not return early when container is stopped
- Status API calls are still skipped for stopped containers (as expected)
- Config fetch now runs regardless of status, enabling OCI detection
- Added test for OCI detection on stopped containers

Discovered: Proxmox 9.1 requires VM.Config.Options permission to read
OCI container configs (not just VM.Audit). Document this in setup guides.
2025-12-12 19:12:06 +00:00
rcourtman
59796e1406 feat: Enhanced OCI detection via entrypoint field
- Added isOCIContainerByConfig() to detect OCI containers by:
  - Presence of 'entrypoint' field (only OCI containers have this)
  - Combination of ostype=unmanaged, cmode=console, and lxc.signal.halt
- This is needed because Proxmox doesn't persist ostemplate after creation
- Now supports detection of already-created OCI containers (like the test alpine container)
2025-12-12 18:13:17 +00:00
rcourtman
6aefeca979 feat: Enhance OCI container display and AI context
- Frontend: Add ociImage memo to extract clean image name from osTemplate
- Frontend: Show OCI image name in type badge tooltip
- Frontend: Display OCI image in OS column when no guest agent info available
- Frontend: Include ociImage in AI context data for selected OCI containers
- Backend: Differentiate OCI containers as 'oci_container' type in AI context
- Backend: Add Metadata field to ResourceContext for extensibility
- Backend: Include oci_image in container metadata for AI analysis
- Backend: Update section heading to 'LXC/OCI Containers' in AI context

This follows Docker container patterns to avoid duplicating work.
2025-12-12 18:00:09 +00:00
rcourtman
e55df08dab feat: Add Proxmox 9.1+ OCI container support
- Backend: Add IsOCI and OSTemplate fields to Container model
- Backend: Add extractContainerOSTemplate() and isOCITemplate() detection functions
- Backend: Detect OCI containers via ostemplate config and set type to 'oci'
- Frontend: Add isOci and osTemplate to Container interface
- Frontend: Add 'oci-container' to ResourceType with distinct purple badge
- Frontend: Update Dashboard filters to include OCI containers with LXC
- Tests: Add comprehensive unit tests for OCI detection logic

OCI containers are detected by checking the ostemplate for patterns like:
- oci: prefix (e.g., oci:docker.io/library/alpine:latest)
- docker: prefix (e.g., docker:nginx:latest)
- Known registry URLs (docker.io, ghcr.io, gcr.io, quay.io, etc.)
- Local templates with oci- or oci_ filename patterns
2025-12-12 17:51:43 +00:00