fix: исправлен синтаксис index.php и добавлен API маршрут дашборда
- Восстановлен корректный index.php из чистого коммита - Добавлен маршрут /api/dashboard/stats для бесшовного обновления - Исправлена ошибка парсинга PHP
This commit is contained in:
parent
8d4a789e00
commit
9a4106a201
|
|
@ -141,9 +141,6 @@ $dashboardGroup = $app->group('', function ($group) use ($twig) {
|
||||||
return $twig->render($response, 'dashboard.twig', $templateData);
|
return $twig->render($response, 'dashboard.twig', $templateData);
|
||||||
});
|
});
|
||||||
})->add($csrfMiddleware)->add(AuthMiddleware::class);
|
})->add($csrfMiddleware)->add(AuthMiddleware::class);
|
||||||
n// API для дашборда
|
|
||||||
= new DashboardController();
|
|
||||||
->get('/api/dashboard/stats', [, 'getDashboardData']);
|
|
||||||
|
|
||||||
// Create controllers BEFORE routes
|
// Create controllers BEFORE routes
|
||||||
$groupController = new GroupController($twig);
|
$groupController = new GroupController($twig);
|
||||||
|
|
@ -154,6 +151,11 @@ $adminController = new AdminController($twig);
|
||||||
$metricsController = new MetricsController();
|
$metricsController = new MetricsController();
|
||||||
$agentController = new AgentController();
|
$agentController = new AgentController();
|
||||||
|
|
||||||
|
|
||||||
|
// API для дашборда
|
||||||
|
$dashboardApiController = new DashboardController($twig);
|
||||||
|
$app->get('/api/dashboard/stats', [$dashboardApiController, 'getDashboardData'])->add(AuthMiddleware::class);
|
||||||
|
|
||||||
// Routes for groups (protected with auth middleware and csrf)
|
// Routes for groups (protected with auth middleware and csrf)
|
||||||
$groupsGroup = $app->group('/groups', function ($group) use ($groupController) {
|
$groupsGroup = $app->group('/groups', function ($group) use ($groupController) {
|
||||||
$group->get('', [$groupController, 'index']);
|
$group->get('', [$groupController, 'index']);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue