More WebUI updates.

This commit is contained in:
Abdulmhsen B. A. A
2024-05-03 11:55:50 +03:00
parent 2fe54a7cba
commit 488596dede
15 changed files with 285 additions and 93 deletions

View File

@@ -58,7 +58,7 @@ final class Ignore
'db' => $db,
'id' => $id,
'scoped' => null === $scope ? 'No' : 'Yes',
'created' => makeDate($date)->format('Y-m-d H:i:s T'),
'created' => makeDate($date),
];
}
$apiUrl = $request->getUri()->withHost('')->withPort(0)->withScheme('');

View File

@@ -303,8 +303,8 @@ final class Index
}
$item['full_title'] = $entity->getName();
$item['progress'] = $entity->hasPlayProgress() ? $entity->getPlayProgress() : 'None';
$item['event'] = ag($entity->getExtra($entity->via), iState::COLUMN_EXTRA_EVENT, '-');
$item['progress'] = $entity->hasPlayProgress() ? $entity->getPlayProgress() : null;
$item['event'] = ag($entity->getExtra($entity->via), iState::COLUMN_EXTRA_EVENT, null);
$item = [
...$item,

View File

@@ -41,10 +41,11 @@ final class Index
$url = $apiUrl->withPath(parseConfigValue(self::URL . "/" . basename($file)));
$builder = [
'filename' => basename($file),
'type' => $matches[1] ?? '??',
'date' => $matches[2] ?? '??',
'size' => filesize($file),
'modified' => makeDate(filemtime($file))->format('Y-m-d H:i:s T'),
'modified' => makeDate(filemtime($file)),
'urls' => [
'self' => (string)$url,
'stream' => (string)$url->withQuery($query),

View File

@@ -58,7 +58,7 @@ final class Queue
'title' => $entity->getName(),
'played' => $entity->isWatched() ? 'Yes' : 'No',
'via' => $entity->via ?? '??',
'date' => makeDate($entity->updated)->format('Y-m-d H:i:s T'),
'date' => makeDate($entity->updated),
'event' => ag($entity->getExtra($entity->via), iState::COLUMN_EXTRA_EVENT),
];
}

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\API\System;
use App\Libs\Attributes\Route\Get;
use App\Libs\HTTP_STATUS;
use Psr\Http\Message\ResponseInterface as iResponse;
use Psr\Http\Message\ServerRequestInterface as iRequest;
final class Version
{
public const string URL = '%{api.prefix}/system/version';
#[Get(self::URL . '[/]', name: 'system.version')]
public function __invoke(iRequest $request): iResponse
{
return api_response(HTTP_STATUS::HTTP_OK, ['version' => getAppVersion()]);
}
}