public function indexAction(Request $request)
    {
        $jobManager = $this->get('phlexible_queue.job_manager');

        $limit = $request->get('limit', 25);
        $offset = $request->get('start', 0);

        $data = [];
        foreach ($jobManager->findBy([], ['createdAt' => 'DESC'], $limit, $offset) as $queueItem) {
            $data[] = [
                'id' => $queueItem->getId(),
                'command' => $queueItem->getCommand(),
                'priority' => $queueItem->getPriority(),
                'status' => $queueItem->getState(),
                'create_time' => $queueItem->getCreatedAt()->format('Y-m-d H:i:s'),
                'start_time' => $queueItem->getStartedAt() ? $queueItem->getStartedAt()->format('Y-m-d H:i:s') : null,
                'end_time' => $queueItem->getFinishedAt() ? $queueItem->getFinishedAt()->format('Y-m-d H:i:s') : null,
                'output' => nl2br($queueItem->getOutput()),
            ];
        }

        $total = $jobManager->countBy([]);

        return new JsonResponse(['data' => $data, 'total' => $total]);
    }