I'll update the UI to add a switch between using Docker volumes and host directories for data storage.
I've updated the Homebox configuration UI to add a switch between using Docker volumes and host directories for data storage. Here are the key improvements:
1. Added a New "Storage" Tab
- Created a dedicated tab for all storage-related configurations
- Moved storage options from other tabs to this centralized location
- This provides a clearer organization of the configuration options
2. Storage Type Selection for Each Service
3. Two Storage Options for Each Service
Docker Volume: Managed by Docker, better for performance and backups
- User can specify a custom volume name
- Volumes are automatically created and managed by Docker
Host Directory: Direct access to files from the host system
- User can specify an absolute path on the host system
- Better for direct file access and management
4. Improved Docker Compose Generation
- Updated the Docker Compose generation logic to handle both storage types
For Docker volumes:
- Creates proper volume definitions in the Docker Compose file
- Maps the volumes to the appropriate container paths
For host directories:
- Creates bind mounts from the host directory to the container
- No volume definitions needed in the Docker Compose file
5. Enhanced UI Components
- Added custom
StorageTypeSelector component for consistent UI - Included helpful icons to distinguish between volume and directory options
- Added tooltips and helper text to guide users
6. Reorganized Basic Settings
- Moved some settings from the Advanced tab to the Basic tab for better usability
- Improved the layout and grouping of related settings
This update provides users with more flexibility in how they want to store their data, catering to different deployment scenarios and preferences. Users can now easily choose between Docker-managed volumes and host directories for each service independently.