Commit Graph

21 Commits

Author SHA1 Message Date
145d37193c fix: update ConfigInfo schema to match Supervisor API response
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m11s
Updated the ConfigInfoSchema to accurately reflect the data structure
returned by Supervisor's getAllConfigInfo() XML-RPC method, fixing Zod
validation errors on the /config page.

Schema changes:
- Removed fields not in API: environment, priority, process_name, numprocs, numprocs_start, username
- Added missing fields: autorestart, killasgroup, process_prio, group_prio, stdout_syslog, stderr_syslog, serverurl
- Fixed type mismatches:
  - stopsignal: string → number (API returns signal numbers like 15)
  - uid: number|null → string (API returns username strings)
  - directory: string|null → string

Updated ConfigTable.tsx to use process_prio instead of priority and
removed the non-existent numprocs column.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 22:39:33 +01:00
9fcb0447ee fix: apply background and blur to nav element for mobile menu
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m12s
Move background styling to the nav element itself with rounded corners.
- Add bg-background/95 backdrop-blur-md to nav element
- Add rounded-lg and p-4 for better visual appearance
- Creates frosted glass card effect for the mobile menu

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 22:18:24 +01:00
df3e022049 fix: correct mobile menu background placement with blur effect
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m10s
Move background styling from outer overlay to inner container for proper visibility.
- Remove bg-background from outer fixed div
- Add bg-background/95 backdrop-blur-md h-full to inner container
- Creates frosted glass effect with proper blur

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 22:04:24 +01:00
dda335d501 fix: resolve 7 critical UI issues - charts, layouts, and mobile responsiveness
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m8s
This commit fixes all reported UI issues across the dashboard:

## Issue 1: Chart Colors and Tooltips 
- Create chartColors utility with static hex colors for Recharts compatibility
- Replace CSS variable colors (hsl(var(--))) with hex colors in all charts
- Add custom tooltip styling with dark background and white text for readability
- Fixes: ProcessStateChart, ProcessUptimeChart, GroupStatistics

## Issue 2: Process Card Heights 
- Add h-full and flex flex-col to ProcessCard component
- Add auto-rows-fr to process grid layout
- Ensures all cards have consistent heights regardless of content

## Issue 3: Batch Actions Button Labels 
- Simplify button labels from "Start Selected" to "Start"
- Remove "Stop Selected" to "Stop", "Restart Selected" to "Restart"
- Labels now always visible on all screen sizes

## Issue 4: Mobile Menu Background 
- Change mobile menu from semi-transparent (bg-background/95) to solid (bg-background)
- Removes backdrop blur for better visibility

## Issue 5: Group Header Button Overflow 
- Add flex-wrap to button container in GroupCard
- Stack buttons vertically on mobile (flex-col md:flex-row)
- Buttons take full width on mobile, auto width on desktop

## Issue 6: Logs Search Input Overflow 
- Change LogSearch from max-w-md to w-full sm:flex-1 sm:max-w-md
- Search input now full width on mobile, constrained on desktop

## Issue 7: Logs Action Button Overflow 
- Add flex-wrap to LogControls button container
- Buttons wrap to new row when space is limited

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 21:52:35 +01:00
791c99097c fix: resolve build errors in api-logger imports and React Query config
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m10s
- Fix import of generateRequestId in events/route.ts (import from logger instead of api-logger)
- Remove deprecated logger config from QueryClient (no longer supported in latest React Query)

These changes resolve TypeScript compilation errors and allow the build to succeed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 21:25:15 +01:00
06dd1c20d0 feat: comprehensive responsive design implementation for mobile devices
Some checks failed
Build and Push Docker Image to Gitea / build-and-push (push) Failing after 58s
This commit implements a complete responsive design overhaul making the Supervisor UI fully mobile-friendly and beautiful across all devices (320px phones to 4K displays).

## Phase 1: Mobile Navigation
- Add hamburger menu to Navbar with slide-out drawer
- Auto-close on navigation with body scroll lock
- Responsive logo sizing

## Phase 2: Touch-Friendly Buttons
- Increase touch targets to 44px on mobile (36px for small buttons)
- Add responsive button layouts in ProcessCard
- Flex-wrap prevents cramped button rows

## Phase 3: Responsive Spacing & Typography
- Add responsive padding to Card components (p-4 md:p-6)
- Scale typography across breakpoints (text-xl md:text-2xl)
- Responsive spacing in AppLayout and all pages

## Phase 4: Mobile-Friendly Tables
- Dual layout for ConfigTable: table on desktop, cards on mobile
- Preserve all data with proper formatting and wrapping
- Hide table on mobile, show card-based layout

## Phase 5: Modal Improvements
- Add horizontal padding (p-4) to all modals
- Prevent edge-touching on mobile devices
- Fixed SignalSender, KeyboardShortcutsHelp, StdinInput modals

## Phase 6: Page-Specific Layouts
- Processes page: responsive header, controls, and grid spacing
- BatchActions bar: full-width on mobile, centered on desktop
- Logs page: responsive controls and height calculations
- Config page: responsive header and error states

## Phase 7: Polish & Final Touches
- Add viewport meta tag to layout
- Responsive empty states and loading skeletons
- Consistent responsive sizing across all error messages
- Mobile-first typography scaling

🎉 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 21:21:22 +01:00
54eb14bf20 fix: correct AppLayout flex direction to prevent content hanging on right side
Changed flex container from horizontal (default) to vertical (flex-col) to properly
stack navbar and main content. This fixes the layout issue where content was
hanging on the right side of the window.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 21:03:00 +01:00
6985032006 feat(logging): add comprehensive error boundary and global error handling (Phase 6)
Implemented complete client-side error handling and reporting system:

Error Boundary Component (components/providers/ErrorBoundary.tsx):
- React Error Boundary to catch component errors
- Automatic error logging to client logger
- Error reporting to server endpoint
- User-friendly fallback UI with error details (dev mode)
- Reset and reload functionality
- Custom fallback support via props

Global Error Handler (lib/utils/global-error-handler.ts):
- Window error event listener for uncaught errors
- Unhandled promise rejection handler
- Automatic error reporting to server
- Comprehensive error metadata collection:
  - Error message and stack trace
  - URL, user agent, timestamp
  - Filename, line number, column number (for window errors)

Client Error Reporting Endpoint (app/api/client-error/route.ts):
- Server-side endpoint to receive client errors
- Integrated with withLogging() for automatic server logging
- Accepts error reports from both ErrorBoundary and global handlers
- Returns acknowledgement to client

Error Boundary Integration (components/providers/Providers.tsx):
- Wrapped entire app in ErrorBoundary
- Initialized global error handlers on mount
- Catches React errors, window errors, and unhandled rejections

Error Reporting Features:
- Duplicate error tracking prevention
- Async error reporting (non-blocking)
- Graceful degradation (fails silently if reporting fails)
- Development vs production error display
- Structured error metadata for debugging

All errors now:
- Log to browser console via client logger
- Report to server for centralized logging
- Display user-friendly error UI
- Include full context for debugging
- Work across React, window, and promise contexts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 21:00:37 +01:00
95acf4542b feat(logging): add comprehensive client-side logging (Phase 5)
Created client-side logging infrastructure for React Query and hooks:

New Client Logger (lib/utils/client-logger.ts):
- Environment-aware logging (debug/info in dev, warn/error in prod)
- Structured logging with context objects
- Performance timing helpers (time/timeEnd)
- Group logging for related operations
- Factory functions for hook/query/mutation-specific loggers

React Query Configuration (components/providers/Providers.tsx):
- Added custom logger to QueryClient
- Integrated with client-side logger for consistent formatting
- Configured mutation retry defaults

SSE Hook Logging (lib/hooks/useEventSource.ts):
- Connection lifecycle logging (connect/disconnect/reconnect)
- Heartbeat and process update event logging
- Error tracking with reconnection attempt details
- Exponential backoff logging for reconnections

Supervisor Hooks Logging (lib/hooks/useSupervisor.ts):
- Added logging to all critical mutation hooks:
  - Process control (start/stop/restart)
  - Batch operations (start-all/stop-all/restart-all)
  - Configuration reload
  - Signal operations
- Logs mutation start, success, and error states
- Includes contextual metadata (process names, signals, etc.)

All client-side logs:
- Use structured format with timestamps
- Include relevant context for debugging
- Respect environment (verbose in dev, minimal in prod)
- Compatible with browser devtools

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:57:24 +01:00
3d5e9e36d6 fix: resolve ThemeProvider SSR issue causing 500 error
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m6s
The app was crashing with "useTheme must be used within ThemeProvider"
error during server-side rendering.

Changes:
- Created AppLayout client component to wrap Navbar
- Modified useTheme hook to return default values during SSR
  instead of throwing an error
- Updated Navbar to safely handle theme context
- Moved Navbar rendering into client-side only AppLayout

This fixes the SSR hydration mismatch and allows the app
to render correctly on both server and client.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:27:44 +01:00
25d9029d14 feat: implement Phase 11 - Real-time Updates with SSE
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m11s
Features added:
- Created SSE (Server-Sent Events) endpoint at /api/supervisor/events
  - Polls supervisor every 2 seconds for state changes
  - Sends process-update events when state changes detected
  - Sends heartbeat events to keep connection alive
  - Includes error handling with error events
- Created useEventSource hook for managing SSE connections
  - Automatic reconnection with exponential backoff
  - Configurable max reconnection attempts (default 10)
  - Connection status tracking (connecting, connected, disconnected, error)
  - Clean event listener management with proper cleanup
  - Heartbeat monitoring for connection health
- Created ConnectionStatus component
  - Visual status indicator with icons (Wifi, WifiOff, Loader, AlertCircle)
  - Color-coded states (green=connected, yellow=connecting, red=error)
  - Shows reconnection attempt count
  - Manual reconnect button when disconnected/error
- Integrated real-time updates into dashboard and processes pages
  - Auto-refresh process data when state changes occur
  - Connection status indicator in page headers
  - No manual refresh needed for live updates
- Implemented proper cleanup on unmount
  - EventSource properly closed
  - Reconnection timeouts cleared
  - No memory leaks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:54:14 +01:00
961020d8ac feat: implement Phase 9 - Keyboard Shortcuts
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m11s
Features added:
- Created useKeyboardShortcuts hook for managing keyboard shortcuts
  - Supports modifier keys (Ctrl, Shift, Alt)
  - Automatically ignores shortcuts when input fields are focused
  - ESC key blurs input fields to enable shortcuts
- Added global keyboard shortcuts:
  - / : Focus search field
  - r : Refresh process list
  - a : Select all processes (flat view only)
  - ESC : Clear selection / unfocus
  - ? (Shift+/) : Show keyboard shortcuts help
- Added process navigation shortcuts:
  - j : Select next process
  - k : Select previous process
  - Space : Toggle selection of focused process
  - Auto-scroll to focused process
- Created KeyboardShortcutsHelp modal component:
  - Organized shortcuts by category
  - Visual kbd elements for keys
  - Info about input field behavior
- Added keyboard shortcuts button to processes page header
- Added isFocused prop to ProcessCard with accent ring styling
- Added data-process-id attributes for keyboard navigation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:50:17 +01:00
4aa0c49372 feat: implement Phase 8 - Process Stdin
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m10s
Features added:
- Created stdin API route for sending input to process stdin
- Added useSendProcessStdin React Query hook
- Created StdinInput modal component with:
  - Multi-line textarea for input
  - Ctrl+Enter keyboard shortcut
  - Optional newline append
  - Character count display
  - Info banner explaining stdin functionality
- Added stdin button to ProcessCard (Terminal icon)
- Button only enabled when process is running (state === 20)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:46:47 +01:00
68ec8dd3db feat: implement Phase 7 - Signal Operations
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m8s
Features added:
- Send Unix signals to processes via interactive modal
- Support for common signals (HUP, INT, TERM, KILL, USR1, USR2, QUIT)
- Custom signal input for advanced use cases
- Safety confirmations for dangerous signals (TERM, KILL, QUIT)
- Signal button added to each ProcessCard

Implementation details:
- Created signal API routes:
  - /api/supervisor/processes/[name]/signal - Send signal to process
  - /api/supervisor/groups/[name]/signal - Send signal to group
  - /api/supervisor/processes/signal-all - Send signal to all processes

- Added React Query hooks:
  - useSignalProcess() - Send signal to single process
  - useSignalProcessGroup() - Send signal to process group
  - useSignalAllProcesses() - Send signal to all processes

- Created SignalSender modal component:
  - Grid of common signal buttons with descriptions
  - Custom signal text input (auto-uppercase)
  - Two-step confirmation for dangerous signals
  - Visual warning with AlertTriangle icon
  - Destructive button variant for confirmed dangerous signals
  - Backdrop blur overlay

ProcessCard enhancements:
- Added Zap icon signal button
- Modal opens on signal button click
- Button disabled when process is stopped
- Modal integrates with useSignalProcess hook

Common signals with descriptions:
- HUP (1): Reload configuration
- INT (2): Interrupt - graceful shutdown
- QUIT (3): Quit
- TERM (15): Terminate - graceful shutdown (dangerous)
- KILL (9): Kill - immediate termination (dangerous)
- USR1 (10): User-defined signal 1
- USR2 (12): User-defined signal 2

Safety features:
- Dangerous signals require confirmation
- Warning message explains risks
- Button changes to destructive variant
- Custom signals also checked for danger
- Clear visual feedback during operation

Phase 7 complete (3-4 hours estimated)
2025-11-23 19:41:21 +01:00
9fd38aaacb feat: implement Phase 6 - Search and Filtering
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m6s
Features added:
- Advanced search and filtering for processes
- Real-time search by name, group, or description
- Filter by process state (All, Running, Stopped, Fatal, Starting, Stopping)
- Filter by process group
- Collapsible filter panel
- Clear all filters button
- Filter count indicator

Implementation details:
- Created ProcessFilters component with:
  - Search input with clear button and search icon
  - State filter buttons with color indicators
  - Group filter buttons (auto-generated from available groups)
  - Toggle filters panel button
  - Active filters detection and clear button

Processes page enhancements:
- Integrated ProcessFilters component
- Real-time filtering with useEffect
- Display count shows "X of Y processes (filtered)"
- Select All works on filtered results
- Empty state when no matches: "No processes match the current filters"
- Filters apply to both flat and grouped views

Filter features:
- Search: Live filtering as you type (name, group, description)
- State filter: 6 filter options with colored dots
- Group filter: Dynamic buttons for each unique group
- Clear filters: Single button to reset all filters
- Collapsible panel: Show/hide filters to save space
- Active filter indicator: Clear button appears when filters active

UX improvements:
- Search input with X button to clear
- Filter button toggles panel (highlighted when active)
- Color-coded state buttons matching process states
- Responsive layout with flex-wrap for many groups
- Maintains selection state across filter changes

Phase 6 complete (2-3 hours estimated)
2025-11-23 19:29:23 +01:00
a63f1923fb feat: implement Phase 5 - Charts and Statistics
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m8s
Features added:
- Visual analytics dashboard with interactive charts
- Process state distribution pie chart
- Process uptime bar chart (top 10 by uptime)
- Group statistics stacked bar chart
- Real-time data visualization using Recharts

Implementation details:
- Created chart components:
  - ProcessStateChart: Pie chart showing state distribution (Running, Stopped, Fatal, Starting, Stopping)
  - ProcessUptimeChart: Horizontal bar chart displaying top 10 processes by uptime in hours
  - GroupStatistics: Stacked bar chart showing process counts per group by state

Dashboard enhancements:
- Added "Analytics" section between statistics cards and quick actions
- Charts display only when processes are loaded and available
- Responsive grid layout (2 columns on large screens for state/group charts)
- Full-width uptime chart for better readability

Chart features:
- Interactive tooltips with formatted data
- Color-coded by state (success green, destructive red, muted gray)
- Proper legends and labels
- Uptime displayed in hours with minutes in tooltip
- Process names truncated to 15 chars for display
- Empty state messages when no data available

Data visualization:
- Pie chart: Percentage distribution of process states
- Bar chart: Top 10 processes sorted by uptime (descending)
- Stacked bar: Group overview with running/stopped/fatal breakdown

Phase 5 complete (3-4 hours estimated)
2025-11-23 19:24:48 +01:00
66495c1e1b feat: implement Phase 4 - Configuration Management
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 59s
Features added:
- View all process configurations in sortable table
- Reload supervisord configuration with confirmation
- Add new process groups dynamically
- Remove process groups with confirmation
- Configuration auto-refresh every 10 seconds

Implementation details:
- Created config API routes: /api/supervisor/config (GET), /api/supervisor/config/reload (POST), /api/supervisor/config/group (POST/DELETE)
- Added React Query hooks: useConfig, useReloadConfig, useAddProcessGroup, useRemoveProcessGroup
- Created components:
  - ConfigTable: Sortable table with columns for group, name, command, directory, autostart, priority, numprocs
  - ReloadConfigButton: Reload config with confirmation dialog
  - ProcessGroupForm: Add/remove groups with separate forms

Configuration page features:
- Displays all process configurations in sortable table
- Click column headers to sort (ascending/descending)
- Visual indicators for autostart (green dot = enabled)
- Shows command in monospace code blocks
- Process group management forms
- Reload configuration button in header

Data displayed per process:
- Group name
- Process name
- Command (with syntax highlighting)
- Working directory
- Autostart enabled/disabled
- Priority value
- Number of processes (numprocs)

Phase 4 complete (8-10 hours estimated)
2025-11-23 19:20:20 +01:00
236786cb31 feat: implement Phase 3 - Batch Operations
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 59s
Features added:
- Multi-select functionality for processes with checkboxes
- Floating BatchActions toolbar appears when processes are selected
- Batch operations: Start Selected, Stop Selected, Restart Selected
- Select All / Deselect All button in processes page
- Visual feedback with ring indicator on selected cards
- Click card to toggle selection, buttons prevent card selection

Implementation details:
- Created batch API routes: /api/supervisor/processes/{start-all,stop-all,restart-all}
- Added React Query hooks: useStartAllProcesses, useStopAllProcesses, useRestartAllProcesses
- Created BatchActions component with floating toolbar
- Enhanced ProcessCard with optional selection mode (isSelected, onSelectionChange props)
- Updated processes page with selection state management
- Checkbox prevents event bubbling to avoid conflicts with action buttons

UX improvements:
- Selected cards show primary ring with offset
- BatchActions toolbar slides up from bottom
- Selection count displayed in toolbar
- Clear selection with X button or after batch action completes

Phase 3 complete (4-6 hours estimated)
2025-11-23 19:14:04 +01:00
5c028cdc11 feat: implement Phase 2 - Process Groups Management
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 58s
Features added:
- Group-based process organization with collapsible cards
- Batch operations for groups (Start All, Stop All, Restart All)
- Group statistics display (running, stopped, fatal counts)
- Dedicated /groups page for group-centric management
- View toggle in /processes page (Flat view | Grouped view)

Implementation details:
- Created group API routes: /api/supervisor/groups/[name]/{start,stop,restart}
- Added React Query hooks: useStartProcessGroup, useStopProcessGroup, useRestartProcessGroup
- Created components: GroupCard, GroupView, GroupSelector
- Updated Navbar with Groups navigation link
- Integrated grouped view in processes page with toggle

Phase 2 complete (6-8 hours estimated)
2025-11-23 19:08:10 +01:00
5bda617339 feat: add log viewer components and fix build issues
Some checks failed
Build and Push Docker Image to Gitea / build-and-push (push) Failing after 53s
- Add LogViewer component with syntax highlighting and auto-scroll
- Add LogControls for play/pause, auto-scroll, refresh, download, clear
- Add LogSearch component with search highlighting
- Add Input UI component
- Fix TypeScript type issues in ProcessCard and types.ts
- Fix XML-RPC client type issues
- Add force-dynamic to layout to prevent SSR issues with client components
- Add mounted state to Navbar for theme toggle hydration
- Add custom 404 page

Components added:
- components/logs/LogViewer.tsx - Main log viewer with real-time display
- components/logs/LogControls.tsx - Control panel for log viewing
- components/logs/LogSearch.tsx - Search input for filtering logs
- components/ui/input.tsx - Reusable input component

Fixes:
- ProcessStateCode type casting in ProcessCard
- XML-RPC client options type (use any to avoid library type issues)
- canStartProcess/canStopProcess type assertions
- Dynamic rendering to prevent SSR hydration issues

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 18:43:55 +01:00
e0cfd371c0 feat: initial commit - Supervisor UI with Next.js 16 and Tailwind CSS 4
Some checks failed
Build and Push Docker Image to Gitea / build-and-push (push) Failing after 1m22s
- Modern web interface for Supervisor process management
- Built with Next.js 16 (App Router) and Tailwind CSS 4
- Full XML-RPC client implementation for Supervisor API
- Real-time process monitoring with auto-refresh
- Process control: start, stop, restart operations
- Modern dashboard with system status and statistics
- Dark/light theme with OKLCH color system
- Docker multi-stage build with runtime env var configuration
- Gitea CI/CD workflow for automated builds
- Comprehensive documentation (README, IMPLEMENTATION, DEPLOYMENT)

Features:
- Backend proxy pattern for secure API communication
- React Query for state management and caching
- TypeScript strict mode with Zod validation
- Responsive design with mobile support
- Health check endpoint for monitoring
- Non-root user security in Docker

Environment Variables:
- SUPERVISOR_HOST, SUPERVISOR_PORT
- SUPERVISOR_USERNAME, SUPERVISOR_PASSWORD (optional)
- Configurable at build-time and runtime

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 18:23:51 +01:00