Files
WLTBAgent 0bf1e53f65 Phase 4: Complete admin UI with TemplateResponse and configuration forms
- 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.
2026-02-13 22:49:20 +00:00

27 lines
593 B
PHP

<?php
declare(strict_types=1);
namespace OCA\AnalyticsHub\AppInfo;
use OCP\AppFramework\App;
use OCP\Util;
/**
* Application class for Mini-CMO Analytics Hub
*/
class Application extends App {
public const APP_NAME = 'analyticshub';
public const APP_ID = 'analyticshub';
public const APP_VERSION = '1.0.0';
public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
// Load scripts and styles for admin page
Util::addStyle(self::APP_ID, 'admin');
Util::addScript(self::APP_ID, 'admin');
}
}