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:
@@ -24,6 +24,12 @@
|
||||
<nextcloud min-version="25" max-version="26"/>
|
||||
<php min-version="7.4"/>
|
||||
</dependencies>
|
||||
<settings>
|
||||
<admin>OCA\AnalyticsHub\Controller\Admin</admin>
|
||||
</settings>
|
||||
<navigation>
|
||||
<admin>analyticshub.admin.index</admin>
|
||||
</navigation>
|
||||
<repair-steps>
|
||||
<step>Repair steps not needed</step>
|
||||
<repair-step>Or remove and reinstall</repair-step>
|
||||
|
||||
67
analyticshub/appinfo/routes.php
Normal file
67
analyticshub/appinfo/routes.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Routes for Mini-CMO Analytics Hub
|
||||
*/
|
||||
|
||||
return [
|
||||
'routes' => [
|
||||
// Admin routes
|
||||
[
|
||||
'name' => 'admin#index',
|
||||
'url' => '/admin',
|
||||
'verb' => 'GET'
|
||||
],
|
||||
[
|
||||
'name' => 'admin#save',
|
||||
'url' => '/admin/save',
|
||||
'verb' => 'POST'
|
||||
],
|
||||
[
|
||||
'name' => 'admin#load',
|
||||
'url' => '/admin/load',
|
||||
'verb' => 'GET'
|
||||
],
|
||||
[
|
||||
'name' => 'admin#getStatus',
|
||||
'url' => '/admin/status',
|
||||
'verb' => 'GET'
|
||||
],
|
||||
|
||||
// API v1 routes
|
||||
[
|
||||
'name' => 'api_v1#reports',
|
||||
'url' => '/api/reports',
|
||||
'verb' => 'GET'
|
||||
],
|
||||
[
|
||||
'name' => 'api_v1#getReport',
|
||||
'url' => '/api/report/{id}',
|
||||
'verb' => 'GET'
|
||||
],
|
||||
[
|
||||
'name' => 'api_v1#generate',
|
||||
'url' => '/api/generate',
|
||||
'verb' => 'POST'
|
||||
],
|
||||
[
|
||||
'name' => 'api_v1#getStatus',
|
||||
'url' => '/api/status',
|
||||
'verb' => 'GET'
|
||||
],
|
||||
|
||||
// Report routes
|
||||
[
|
||||
'name' => 'report#index',
|
||||
'url' => '/report',
|
||||
'verb' => 'GET'
|
||||
],
|
||||
[
|
||||
'name' => 'report#generate',
|
||||
'url' => '/report/generate',
|
||||
'verb' => 'POST'
|
||||
],
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user