Skip to content

Conversation

@michelroegl-brunner
Copy link
Member

🎨 Server Color Coding Feature

This PR implements a comprehensive server color coding system that allows users to visually distinguish between different servers throughout the application.

✨ Features Added

🎛️ General Settings

  • Toggle Control: Added server color coding enable/disable toggle in General Settings
  • Environment Storage: Setting saved in file as
  • API Endpoint: New route for managing the setting

🎨 Server Management

  • Color Picker: Added color selection in server settings modal (only visible when color coding is enabled)
  • Database Schema: Added [\e[m] column to servers table with migration support
  • Default Color: Servers get a default blue color () when created

🖥️ UI Color Application

  • Server Cards: Left border colored with server color
  • Installed Scripts Table:
    • Each row has colored left border
    • Server name displayed with background color and readable text
    • Fixed "Local" display issue (now shows "-" for null server names)
  • Script Installation Cards: Colored borders and server name backgrounds
  • Execution Modal: Custom color-coded dropdown for server selection

🔧 Technical Improvements

  • Color Utils: New function for readable text on colored backgrounds
  • Custom Dropdown: Created component for enhanced server selection
  • Type Safety: Updated TypeScript interfaces to include color field
  • Database Migration: Automatic migration for existing databases

🐛 Bug Fixes

  • Terminal Stability: Fixed WebSocket reconnection loops that caused blank terminal screens
  • Script Execution: Resolved "script already running" errors on subsequent runs
  • Execution ID Management: Proper unique execution ID generation for each script run
  • SSH Preselection: Execution modal now preselects SSH mode by default

🎯 User Experience

  • Visual Distinction: Easy identification of different servers at a glance
  • Consistent Theming: Color coding applied consistently across all server references
  • Accessibility: Automatic contrast calculation ensures readable text
  • Optional Feature: Can be disabled if not needed

🧪 Testing

  • ✅ Color coding toggle works correctly
  • ✅ Server color picker functions properly
  • ✅ Colors applied consistently across UI
  • ✅ Terminal execution stable for multiple runs
  • ✅ Database migration handles existing data
  • ✅ TypeScript compilation clean

📝 Database Changes

  • Added [\e[m] column to table
  • Migration script handles existing databases
  • Backward compatible with existing server data

This feature significantly improves the user experience by providing visual server identification throughout the application while maintaining full backward compatibility.

- Add color column to servers table with migration
- Add SERVER_COLOR_CODING_ENABLED environment variable
- Create API route for color coding toggle settings
- Add color field to Server and CreateServerData types
- Update database CRUD operations to handle color field
- Update server API routes to handle color field
- Create colorUtils.ts with contrast calculation function
- Add color coding toggle to GeneralSettingsModal
- Add color picker to ServerForm component (only shown when enabled)
- Apply colors to InstalledScriptsTab (borders and server column)
- Apply colors to ScriptInstallationCard component
- Apply colors to ServerList component
- Fix 'Local' display issue in installed scripts table
- Fix unsafe argument type errors in GeneralSettingsModal and ServerForm
- Remove unused import in ServerList component
- Create ColorCodedDropdown component with server color indicators
- Replace HTML select with custom dropdown in ExecutionModeModal
- Add color dots next to server names in dropdown options
- Maintain all existing functionality with improved visual design
- Change executionId from useState to allow updates
- Generate new execution ID in startScript function for each run
- Fixes issue where scripts couldn't be run multiple times without page reload
- Resolves 'Script execution already running' error on subsequent runs
- Remove premature terminal clearing for whiptail sessions
- Let whiptail handle its own display without interference
- Generate new execution ID for both initial and manual script runs
- Fix whiptail session state management
- Should resolve blank screen and script restart issues
- Remove complex whiptail session handling that caused blank screen
- Simplify output handling to just write data directly to terminal
- Keep execution ID generation fix for multiple script runs
- Remove unused inWhiptailSession state variable
- Terminal should now display output normally again
- Remove inWhiptailSession from useEffect dependency array
- Fixes ReferenceError: inWhiptailSession is not defined
- Terminal should now work without JavaScript errors
- Add debug logs to see what messages are being received
- Help diagnose why terminal shows blank screen
- Will remove debug logs once issue is identified
- Remove executionId from useEffect dependency arrays
- Fixes terminal constantly reconnecting and showing blank screen
- WebSocket now maintains stable connection during script execution
- Removes debug console logs
- Remove handleMessage from useEffect dependency array
- Fixes loop of START messages and connection blinking on subsequent runs
- WebSocket connection now stable for multiple script executions
- handleMessage recreation no longer triggers WebSocket reconnection
- Add console logs to useEffect and startScript
- Track what dependencies are changing
- Identify why WebSocket reconnects on second run
- isRunning state change was causing WebSocket reconnection loop
- Each script start changed isRunning from false to true
- This triggered useEffect to reconnect WebSocket
- Removing isRunning from dependencies breaks the loop
- WebSocket connection now stable during script execution
- Preselect SSH execution mode by default since it's the only available option
- Remove debug console logs from Terminal component
- Clean up code for production readiness
@michelroegl-brunner michelroegl-brunner requested a review from a team as a code owner October 10, 2025 12:20
@MickLesk
Copy link
Member

Whats that? Screenshot? ^^

- Add missing SettingsModal import to ExecutionModeModal
- Remove unused selectedMode and handleModeChange variables
- Add ESLint disable comments for intentional useEffect dependency exclusions
- Build now passes successfully with no errors or warnings
@michelroegl-brunner
Copy link
Member Author

Whats that? Screenshot? ^^

image image

you can choose in the settings if you want that, and the server get a color code to better differantiate them

@michelroegl-brunner michelroegl-brunner merged commit 4faa74b into main Oct 10, 2025
4 checks passed
@michelroegl-brunner michelroegl-brunner deleted the feature/server-color-coding branch October 14, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants