Tasks, Env, Logs are ready for beta testing.

This commit is contained in:
abdulmohsen
2024-05-04 10:12:59 +03:00
parent df7e72839e
commit f1417a554b
5 changed files with 44 additions and 54 deletions

View File

@@ -31,21 +31,18 @@ final class Index
$apiUrl = $request->getUri()->withHost('')->withPort(0)->withScheme('');
$urlPath = rtrim($request->getUri()->getPath(), '/');
$queuedTasks = $this->cache->get('queued_tasks', []);
$response = [
'tasks' => [],
'queued' => $queuedTasks,
'links' => [
'self' => (string)$apiUrl,
],
];
$queuedTasks = $this->cache->get('queued_tasks', []);
foreach (TasksCommand::getTasks() as $task) {
$task = array_filter(
self::formatTask($task),
fn($k) => false === in_array($k, ['command', 'args']),
ARRAY_FILTER_USE_KEY
);
$task = self::formatTask($task);
$task['links'] = [
'self' => (string)$apiUrl->withPath($urlPath . '/' . ag($task, 'name')),