- Add user management system with all CRUD operations - Add promotion statistics dashboard with export - Simplify Trading & Market settings UI - Fix promotion schema (dates now optional) - Add missing API endpoints and PATCH support - Add comprehensive documentation - Fix critical bugs (deletePromotion, duplicate endpoints) All features tested and production-ready.
7.3 KiB
7.3 KiB
Maintenance Mode Improvements
🎯 What Was Fixed
The maintenance mode scheduling interface was confusing and poorly designed. Users couldn't properly select dates/times, and the scheduling feature wasn't necessary for simple on/off maintenance mode.
✅ Changes Made
1. Made Scheduling Optional
- Added a checkbox to enable/disable scheduling
- By default, scheduling is hidden
- Users can now simply toggle maintenance on/off without dates
- Scheduling only shows if you check "Schedule Maintenance (Optional)"
2. Clearer Interface
Before:
- Two datetime-local fields always visible
- Confusing "Optional" labels
- No clear explanation
After:
- Clean toggle for maintenance mode
- Clear help text explaining what maintenance mode does
- Scheduling is collapsed by default
- Only shows when you want to schedule maintenance
3. Better Labels and Help Text
Maintenance Toggle:
- Clear description: "When enabled, only admins and whitelisted Steam IDs can access the site"
Maintenance Message:
- Helpful placeholder: "We're performing scheduled maintenance. We'll be back soon!"
- Explanation: "This message will be shown to users when they try to access the site"
Allowed Steam IDs:
- Now labeled as "Optional"
- Clear explanation: "Add Steam IDs of users who can access during maintenance (admins can always access)"
- Better placeholder: "76561198XXXXXXXXX"
Scheduling:
- Hidden by default
- Checkbox to enable: "Schedule Maintenance (Optional)"
- Help text: "Leave unchecked to manually control maintenance mode"
4. Smart Behavior
- When scheduling checkbox is unchecked, dates are automatically cleared
- When loading config, scheduling section auto-expands if dates exist
- Prevents confusion about scheduled vs manual maintenance
🎨 New UI Layout
┌─────────────────────────────────────────────┐
│ Maintenance Mode │
├─────────────────────────────────────────────┤
│ │
│ [🟢 ON] Enable Maintenance Mode │
│ When enabled, only admins and whitelisted │
│ Steam IDs can access the site │
│ │
│ Maintenance Message │
│ ┌─────────────────────────────────────────┐ │
│ │ We're performing scheduled maintenance. │ │
│ │ We'll be back soon! │ │
│ └─────────────────────────────────────────┘ │
│ This message will be shown to users │
│ │
│ [ ] Schedule Maintenance (Optional) │
│ Leave unchecked to manually control │
│ │
│ Allowed Steam IDs (Optional) │
│ Add Steam IDs of users who can access │
│ during maintenance │
│ ┌─────────────────────────────────────┐ │
│ │ 76561198027608071 [X] │ │
│ └─────────────────────────────────────┘ │
│ [+ Add Steam ID] │
│ │
│ [💾 Save Maintenance Settings] │
└─────────────────────────────────────────────┘
📋 Usage Guide
Simple On/Off (Recommended)
- Toggle "Enable Maintenance Mode" ON 🟢
- Enter a message for users
- (Optional) Add Steam IDs of users who can access
- Click "Save Maintenance Settings"
- Site is now in maintenance mode!
To disable:
- Toggle "Enable Maintenance Mode" OFF 🔴
- Click "Save"
- Site is back online!
Scheduled Maintenance (Advanced)
- Check "Schedule Maintenance (Optional)"
- Set Scheduled Start date/time
- Set Scheduled End date/time
- Enter maintenance message
- Click "Save Maintenance Settings"
The site will automatically:
- Enter maintenance mode at the scheduled start time
- Exit maintenance mode at the scheduled end time
🔧 Technical Details
Files Modified
frontend/src/components/AdminConfigPanel.vue
Changes
- Added
showSchedulingref to control scheduling visibility - Added watcher to clear dates when scheduling is disabled
- Added logic to auto-show scheduling if dates exist in config
- Improved labels and help text throughout
- Made Steam IDs section clearer with better descriptions
API Unchanged
- Backend API remains the same
- Dates are simply set to
nullwhen not scheduling - Fully backward compatible
✅ Benefits
- Simpler UX - No confusing date fields for simple on/off
- Clearer Labels - Users understand what each option does
- Better Defaults - Scheduling hidden unless needed
- Smart Behavior - Auto-clears dates when disabled
- Helpful Text - Explanations for every option
- Progressive Disclosure - Advanced features hidden until needed
🎯 Use Cases
Use Case 1: Emergency Maintenance
Need: Site has an issue, need to take it down NOW
Solution:
- Toggle maintenance ON
- Enter message: "We're fixing a critical issue. Be back soon!"
- Save
- Done in 10 seconds ✅
Use Case 2: Scheduled Maintenance
Need: Plan maintenance window for next Tuesday 2am-4am
Solution:
- Check "Schedule Maintenance"
- Set start: Tuesday 2:00 AM
- Set end: Tuesday 4:00 AM
- Enter message about scheduled maintenance
- Save
- System automatically handles it ✅
Use Case 3: VIP Access During Maintenance
Need: Site is down but VIPs should still access
Solution:
- Enable maintenance mode
- Add VIP Steam IDs to "Allowed Steam IDs"
- Save
- VIPs can access, everyone else sees maintenance page ✅
📊 Before vs After
| Aspect | Before | After |
|---|---|---|
| Scheduling Fields | Always visible | Hidden by default |
| Clarity | Confusing | Clear with help text |
| Simple Mode | Required dates | Just toggle on/off |
| Help Text | Minimal | Comprehensive |
| Steam IDs | Unclear purpose | Clearly labeled optional |
| User Flow | Confusing | Intuitive |
🚀 Testing
After updating:
- Hard refresh browser (Ctrl+Shift+R)
- Navigate to
/admin→ Config tab - You should see:
- ✅ Clean toggle for maintenance
- ✅ No date fields (unless checkbox enabled)
- ✅ Clear help text for each field
- ✅ Better organized layout
📝 Notes
- Scheduling is completely optional
- Most users will just use the simple toggle
- Advanced users can still schedule if needed
- All existing maintenance configs will load correctly
- If existing config has dates, scheduling auto-expands
Status: ✅ Complete and Tested
Impact: Greatly improved UX
Breaking Changes: None
Migration Required: No