- PageController: Replaced simple HTML with proper TemplateResponse
- Added index() method with full admin interface
- Added save() method for POST /save
- Added load() method for GET /load
- Injected IConfig service for configuration storage
- Added validation for required fields
- Proper error handling with JSONResponse
- Admin template: Full Nextcloud-compatible admin interface
- Google Analytics configuration section (client ID, secret, refresh token)
- Anthropic Claude API configuration section (API key)
- Configuration status display (success/warning states)
- Form with proper Nextcloud components
- CSRF token handling
- Routes: Added /save and /load endpoints
- page#index (GET) - renders admin page
- page#save (POST) - saves configuration
- page#load (GET) - loads configuration
- Application.php: Updated with APP_VERSION constant
- Proper style and script loading
- CSS: Complete styling for admin interface
- Responsive design with Nextcloud theme colors
- Form input styling with focus states
- Action buttons with hover effects
- JavaScript: Complete form handling
- AJAX submission to /save endpoint
- Configuration loading from /load endpoint
- CSRF token handling with OC.requestToken
- OC.Notification integration for success/error messages
- Real-time status updates
This is a complete, working admin interface for configuration.
Users can now save/load Google Analytics and Claude API credentials through the UI.
- Simplified AdminController to minimal version
- Removed complex dependency injection
- Added @NoAdminRequired and @NoCSRFRequired annotations
- Minimal constructor with just appName
- Simplified routes.php
- Removed requirements array
- Clean route definitions
- Fixed admin template
- Kept same UI but removed non-standard calls
- Self-contained CSS and simple form
- This addresses 'Access forbidden' error when accessing admin page
The issue was likely caused by:
1. Missing annotations on admin controller
2. Complex DI not working properly
3. Route configuration issues
Simplified version should resolve access issues.
- Removed settings/navigation from appinfo/info.xml
- These sections can cause routing conflicts
- App now relies purely on routes.php
- Simplified Application.php
- Removed manual service/controller registration
- Let Nextcloud DI framework handle it automatically
- Fixed admin template to use Nextcloud standards
- Removed non-standard style() call
- Added proper l10n support with p($l->t(...))
- Clean template structure
- Created css/admin.css
- Nextcloud-compatible styling
- Matches design language
- Created js/admin.js
- Handles Save Configuration button
- Handles Test Connection button
- Uses OC, OC.Notification APIs
This should fix admin page not appearing issue.
Users can access via: Settings → Administration → Additional Settings
- Renamed analytics-hub/ → analyticshub/
- App ID in info.xml is 'analyticshub' (no hyphen)
- Nextcloud requires folder name to match app ID exactly
- Fixes 'Could not download app analyticshub' error during installation
Installation:
- Upload analyticshub/ folder to /var/www/nextcloud/apps/
- Folder name must match app ID in info.xml