Commit Graph

36 Commits

Author SHA1 Message Date
glenneth 356c6fbb49 feat: Add password change UI to admin dashboard
NEW FEATURE: Password Change Form on Admin Dashboard

TEMPLATE CHANGES (admin.ctml):
- Added 'Account Security' section after System Status
- Password change form with:
  - Current password field
  - New password field (min 8 characters)
  - Confirm password field
  - Submit button
  - Message display area for feedback

JAVASCRIPT CHANGES (admin.js):
- changeAdminPassword(event) function
  - Validates passwords match
  - Validates minimum length (8 chars)
  - Calls /api/asteroid/user/change-password
  - Shows success/error messages
  - Clears form on success

- showPasswordMessage(message, type) helper
  - Displays success/error messages
  - Auto-hides success messages after 5 seconds

USER EXPERIENCE:
1. Admin logs in with default password (asteroid123)
2. Sees 'Account Security' section at top of dashboard
3. Fills in current password and new password
4. Clicks 'Change Password'
5. Gets immediate feedback
6. Password is changed - use new password on next login

This makes it easy for admins to change the default password
without needing REPL access or curl commands.

Ref: TODO.org Problem 4 - Security improvements
2025-11-03 20:18:17 +03:00
glenneth a795680e99 feat: Add hybrid player with frameset and pop-out options
- Add frameset mode with persistent audio player in bottom frame
- Add localStorage preference system for user choice
- Update all page navigation to work in both regular and frameset modes
- Add enable/disable buttons for frameset mode
- Fix redirect loops and template parameter issues
2025-10-22 18:01:48 -04:00
glenneth d8abd9661d feat: Add pop-out player and queue management improvements
- Add pop-out player window (400x300px) with auto-reconnect on stream errors
- Add queue reordering with up/down buttons in admin panel
- Add 'Load Queue from M3U' functionality
- Remove Play/Stream buttons from track management
- Fix Liquidsoap audio quality issues:
  - Remove ReplayGain and compression to prevent pulsing
  - Change reload_mode to 'seconds' to prevent playlist exhaustion
  - Reduce crossfade to 3 seconds
  - Add audio buffering settings for stability
- Add auto-reconnect logic for both front page and pop-out players
2025-10-22 18:01:48 -04:00
glenneth 9721fbbc8a fix: track search missing query variable
- Add missing query variable in filterTracks() function
- Reads value from track-search input field
- Bug was pre-existing, not introduced by refactoring
2025-10-17 21:38:18 -04:00
glenneth b3fd00cb4d refactor: improve code consistency and maintainability
- Add /api/asteroid/partial/now-playing-inline endpoint for inline text
- Refactor admin.js to use server-side partial (removes 23 lines of JSON/XML parsing)
- Fix hardcoded path in convert-to-docker-path to use *music-library-path* variable
- Consistent with front-page and player refactoring from upstream
- Improves portability and reduces client-side JavaScript complexity
2025-10-17 21:38:18 -04:00
Luis Pereira 4d0b54f7d6 feat: move player to use now-playing partial 2025-10-16 19:02:00 -04:00
Luis Pereira f3d012cbc6 feat: move front-page to use now-playing partial 2025-10-16 19:02:00 -04:00
Luis Pereira 6506f7d153 fix: playlist create button wrap on small screens 2025-10-15 06:40:20 -04:00
Luis Pereira a7fe6a73c7 fix: srollbars only visible when required on chrome browsers 2025-10-15 06:40:20 -04:00
glenneth fd7707eb74 Improve player UI and reduce buffering
- Remove aggressive stream reconnect
- Reduce live stream buffering delay
- Clean up debug logging
- Fix playlist loading errors
2025-10-15 06:38:53 -04:00
glenneth d4edb8bfec Add admin UI for stream queue management
- Queue management section with add/remove/clear controls
- Add to Queue button on each track in library browser
- Search tracks and add to queue
- Add 10 random tracks button
- Live stream monitor with Now Playing display
- Toast notifications for user feedback
- Real-time queue updates
2025-10-15 06:38:53 -04:00
Luis Pereira 70263fbfbc feat: stream base url as variable on templates 2025-10-12 09:56:08 -04:00
glenneth 5362c86f9f fix: Complete UI fixes for page flow feature
- Fix api-output wrapper handling in all JavaScript files
- Add profile page API endpoints (profile, listening-stats, recent-tracks, top-artists)
- Fix session persistence - auth-ui.js now correctly detects login status
- Fix user stats display - now shows correct counts (3 users, 1 admin)
- Fix View All Users table - properly displays all users
- Handle empty arrays gracefully in profile.js (no errors for missing data)

All UI issues resolved:
✓ User management page fully functional
✓ Session persists across navigation
✓ Profile page loads without errors
✓ Correct nav links shown based on role
✓ Admin sees Admin link, regular users don't
2025-10-12 09:47:38 -04:00
glenneth 4b8a3a064c feat: Implement role-based page flow and user management APIs
Core Features:
- Login redirects based on user role (admin -> /admin, users -> /profile)
- User registration redirects to /profile page
- Convert user management APIs to use define-api (Radiance standard)
- Add user statistics API endpoint
- Add create user API endpoint
- Add list users API endpoint

Authentication & Authorization:
- Update require-role to return proper JSON for API requests
- Fix password verification with debug logging
- Add reset-user-password function for admin use

API Endpoints (using define-api):
- /api/asteroid/users - Get all users (admin only)
- /api/asteroid/user-stats - Get user statistics (admin only)
- /api/asteroid/users/create - Create new user (admin only)

Bug Fixes:
- Fix JavaScript API path for user-stats endpoint
- Remove dependency on non-existent radiance:api-output
- Use api-output for proper JSON responses

Testing:
- Admin login redirects to /asteroid/admin ✓
- Regular user login redirects to /asteroid/profile ✓
- User creation working (testuser created successfully) ✓
- User statistics loading correctly ✓

Known Issues (non-blocking):
- User table display needs UI fixes
- Profile page needs additional API endpoints
- Session persistence on navigation needs investigation
2025-10-12 09:47:38 -04:00
Brian O'Reilly 26c516c25d this is kind of a dead patch. clean up working set. 2025-10-11 13:21:38 -04:00
Luis Pereira 2b6bad3348 feat: improved nav styling 2025-10-10 07:26:39 -04:00
Glenn Thompson 5bc6f27840 Fix frontend JavaScript to work with define-api endpoints
- Update API paths from /asteroid/api/ to /api/asteroid/ in users.js and profile.js
- Add RADIANCE API wrapper handling for icecast-status responses
- Improve error handling in player.js loadTracks function
- All frontend code now properly handles define-api response format
2025-10-08 22:56:54 -04:00
glenneth e0c1eac408 Refactor API endpoints to use Radiance's define-api macro
- Converted 15 API endpoints from define-page to define-api
- Added JSON API format configuration for proper JSON responses
- Updated all frontend JavaScript files to use new API URLs
- Maintained define-page for HTML pages and static file serving
- Added comprehensive documentation of changes

Benefits:
- Framework compliance with Radiance best practices
- Automatic routing at /api/asteroid/<name>
- Clean lambda-list parameter handling
- Built-in browser/API dual usage support
- Proper HTTP status codes for errors

All API endpoints tested and working correctly.
2025-10-08 22:56:54 -04:00
glenneth efb96f950e Fix auth form styling: wider forms (600px) and hidden message boxes
- Increased auth-form max-width from 400px to 600px to match site styling
- Reduced form-group margin-bottom from 3rem to 1.5rem for better spacing
- Added display:none to error/success message boxes by default
- Message boxes now only show when server sets display-error/display-success
2025-10-07 18:39:49 -04:00
glenneth 5d31763e85 Add user registration and authentication UI improvements
- Add registration page with form validation
- Add login/register/logout navigation with conditional display
- Add auth-status API endpoint for session checking
- Add auth-ui.js for dynamic nav based on login state
- Update navigation across all pages (front, admin, profile, player)
- Style logout button with subtle red color
- Auto-login after successful registration
2025-10-07 18:39:49 -04:00
glenneth fa1de1c874 Update profile page to match site-wide layout and styling
- Remove narrow profile-container (600px) in favor of standard container (1200px)
- Replace profile-card divs with admin-section to match admin page styling
- Add consistent h1 header matching other pages
- Remove unused profile-container and profile-card CSS classes
- Keep profile-specific utility styles (profile-info, artist-stats, etc.)
2025-10-07 18:39:49 -04:00
glenneth 1b1445e25f Add user profile page with clip template styling
- Created profile.chtml template with listening statistics, recent tracks, and top artists
- Added profile.js for dynamic data loading and user interactions
- Extended LASS styles for profile-specific elements (artist stats, track items, activity charts)
- Implemented /profile route with authentication and template rendering
- Added profile API endpoints for user data, stats, recent tracks, and top artists
- Added profile link to main navigation
- Includes placeholder functionality for future listening metrics implementation
2025-10-07 18:39:49 -04:00
Luis Pereira 82071bb18d fix: pseudo selectors on lass are now working 2025-10-05 20:48:58 -04:00
Luis Pereira d87c1be373 fix: lass rules moved up one level
Some rules were one level deeper and being created inside the btn rule
2025-10-05 20:48:58 -04:00
Luis Pereira d0649a611e fix: move font import to lass file 2025-10-05 20:48:58 -04:00
Luis Pereira c2e7cfe943 feat: move users javascript code to own file 2025-10-04 16:10:50 -04:00
Luis Pereira bd1b993a03 feat: move player javascript code to own file 2025-10-04 16:10:50 -04:00
Luis Pereira 6edbb5754b feat: move frontpage javascript code to own file 2025-10-04 16:10:50 -04:00
Luis Pereira 35f4c6516b feat: move admin javascript code to own file
Some html element ids and api routes are also fixed here.
2025-10-04 16:10:50 -04:00
Glenn Thompson 62a1a94daa feat: Update color scheme from green to blue theme
- Change color palette: black→grey→green→red to black→bluegrey→cyan→blue
- Primary text: #00ff00 → #00ffff (green to cyan)
- Headers/accents: #ff6600 → #4488ff (orange to blue)
- Panels/borders: #1a1a1a/#333 → #1a2332/#2a3441 (grey to blue-grey)
- Buttons: #333/#555 → #2a3441/#3a4551 (grey to blue-grey)
- Maintains terminal/hacker aesthetic with cooler color palette
- Requested by Fade for improved visual appeal
2025-10-02 23:24:53 -04:00
Glenn Thompson e61a5a51df Complete Docker streaming infrastructure and user management fixes
## Docker Infrastructure Improvements
- **Liquidsoap Upgrade**: Updated to latest savonet/liquidsoap:792d8bf tag
- **Port Configuration**: Resolved port conflicts, standardized on port 8000 for streaming
- **Service Integration**: Docker Icecast (8000) + Asteroid web app (8080) architecture
- **Script Updates**: Fixed docker-compose commands for legacy compatibility
- **Documentation**: Comprehensive updates to setup-complete.org with correct URLs

## User Management System Fixes
- **Database Field Handling**: Fixed list vs string format inconsistencies in RADIANCE i-lambdalite
- **Authentication Flow**: Resolved "string designator" errors in user initialization
- **Admin Creation**: Fixed default admin user detection and creation logic
- **Session Management**: Proper handling of user ID storage and retrieval

## Web Interface Improvements
- **Navigation Routes**: Fixed /player/ → /player route mismatch
- **Link Consistency**: All navigation links now match defined routes
- **Template Integration**: Proper CLIP template processing with corrected data types

## Configuration Management
- **RADIANCE Config**: Fixed r-simple-wsessions typo in startup modules
- **Domain Setup**: Added "asteroid" domain to RADIANCE configuration
- **Service Dependencies**: Proper module loading order and error handling

## System Integration
- **Dual-Port Architecture**: Streaming (8000) + Web Interface (8080) separation
- **Service Status**: Integration points for Docker service monitoring
- **Audio Pipeline**: Liquidsoap → Icecast → Web Player workflow established

## Testing & Validation
- **Stream Verification**: Confirmed http://localhost:8000/asteroid.mp3 streaming
- **Web Access**: Validated http://localhost:8080/asteroid/ interface
- **User Authentication**: Tested login/logout and admin panel access
- **Database Operations**: Verified track metadata and user management

This commit establishes a fully functional internet radio streaming platform
with containerized audio services and integrated web management interface.
2025-10-02 16:50:06 +03:00
Brian O'Reilly 919e2f491b courier gives me a headache...
and this is kind of a throw-back 8bit computer style font. The colours
are still kind of aggressively unpleasant (to me), but I'm hesitant to
change due to fear of comitting visual violence to people with normal
colour vision. :)
2025-09-30 21:24:47 -04:00
Glenn Thompson 84d0bc4ce4 Fix Asteroid Radio authentication system
- Fix database query syntax for RADIANCE hash table returns
- Handle RADIANCE field storage format (lists instead of strings)
- Configure r-simple-sessions module for session management
- Update login page styling to match main site theme
- Implement working authentication with admin/asteroid123
- Add proper error handling and debug logging
- Ensure session persistence and redirects work correctly
2025-09-30 14:11:46 -04:00
Brian O'Reilly 873b2903cc refactor glenn's database feature into discrete files. 2025-09-11 10:33:26 -04:00
Glenn Thompson cb1d6e5596 Implement complete internet radio streaming system
- Add live streaming with Icecast2 and Liquidsoap integration
- Fix track streaming endpoints with proper RADIANCE database queries
- Implement music library management with metadata extraction
- Add web player interface with HTML5 audio controls
- Fix admin panel functionality for file management
- Create playlist system for continuous radio broadcasting
- Add live stream URL to web interface
- Support MP3 streaming at 128kbps with proper audio processing
- Enable network access for internal radio broadcasting
- Add comprehensive README.org documentation
- Create start/stop scripts for service management
- Use secure random password for streaming authentication
2025-09-11 15:30:01 +03:00
Glenn Thompson 25f558c8e0 Fix LASS implementation: Enable dynamic CSS generation
- Fixed compile-styles function to properly use lass:compile-and-write
- LASS now generates CSS dynamically on server startup
- Removed dependency on static CSS files
- Added LASS-IMPLEMENTATION-NOTES.org documenting the fix
- Server now compiles LASS to CSS automatically on startup
- All styling preserved with proper LASS integration
2025-09-04 05:43:55 +03:00