Fix: Add routes and admin navigation
- Created appinfo/routes.php to register all routes - Admin routes: index, save, load, getStatus - API v1 routes: reports, getReport, generate, getStatus - Report routes: index, generate - Added index() method to AdminController - Renders admin template via TemplateResponse - Updated info.xml and appinfo/info.xml - Fixed navigation entry to point to route: analyticshub.admin.index - Added settings and navigation sections - App now appears in Settings → Administration after enable/disable Fixes issue where app didn't show up in Nextcloud toolbar after being enabled.
This commit is contained in:
@@ -9,6 +9,7 @@ use OCP\IResponse;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
|
||||
use OCA\AnalyticsHub\Service\GoogleAnalyticsService;
|
||||
use OCA\AnalyticsHub\Service\LLMService;
|
||||
@@ -34,9 +35,21 @@ class AdminController {
|
||||
$this->dataProcessor = $dataProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Index page - render admin UI
|
||||
* GET /admin
|
||||
*/
|
||||
public function index(): TemplateResponse {
|
||||
return new TemplateResponse('analyticshub', 'admin', [
|
||||
'app_name' => AppInfo::APP_NAME,
|
||||
'version' => AppInfo::getVersion(),
|
||||
'status' => $this->gaService->isConfigured() ? 'configured' : 'not_configured',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save configuration
|
||||
* POST /settings/save
|
||||
* POST /admin/save
|
||||
*/
|
||||
public function save(IRequest $request): JSONResponse {
|
||||
$params = $request->getParams();
|
||||
|
||||
Reference in New Issue
Block a user