Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ee338e397 | |||
| 08d28d9a4f | |||
| b17313c8fb | |||
| f2b50b4f60 | |||
| 393e3ef41f |
@@ -23,28 +23,28 @@
|
|||||||
"php-tmdb/api": "^4.1",
|
"php-tmdb/api": "^4.1",
|
||||||
"predis/predis": "^2.4",
|
"predis/predis": "^2.4",
|
||||||
"runtime/frankenphp-symfony": "^0.2.0",
|
"runtime/frankenphp-symfony": "^0.2.0",
|
||||||
"symfony/asset": "7.2.*",
|
"symfony/asset": "7.3.*",
|
||||||
"symfony/console": "7.2.*",
|
"symfony/console": "7.3.*",
|
||||||
"symfony/doctrine-messenger": "7.2.*",
|
"symfony/doctrine-messenger": "7.3.*",
|
||||||
"symfony/dotenv": "7.2.*",
|
"symfony/dotenv": "7.3.*",
|
||||||
"symfony/filesystem": "7.2.*",
|
"symfony/filesystem": "7.3.*",
|
||||||
"symfony/finder": "7.2.*",
|
"symfony/finder": "7.3.*",
|
||||||
"symfony/flex": "^2",
|
"symfony/flex": "^2",
|
||||||
"symfony/form": "7.2.*",
|
"symfony/form": "7.3.*",
|
||||||
"symfony/framework-bundle": "7.2.*",
|
"symfony/framework-bundle": "7.3.*",
|
||||||
"symfony/ldap": "7.2.*",
|
"symfony/ldap": "7.3.*",
|
||||||
"symfony/mercure-bundle": "^0.3.9",
|
"symfony/mercure-bundle": "^0.3.9",
|
||||||
"symfony/messenger": "7.2.*",
|
"symfony/messenger": "7.3.*",
|
||||||
"symfony/runtime": "7.2.*",
|
"symfony/runtime": "7.3.*",
|
||||||
"symfony/scheduler": "7.2.*",
|
"symfony/scheduler": "7.3.*",
|
||||||
"symfony/security-bundle": "7.2.*",
|
"symfony/security-bundle": "7.3.*",
|
||||||
"symfony/stimulus-bundle": "^2.24",
|
"symfony/stimulus-bundle": "^2.24",
|
||||||
"symfony/twig-bundle": "7.2.*",
|
"symfony/twig-bundle": "7.3.*",
|
||||||
"symfony/ux-icons": "^2.24",
|
"symfony/ux-icons": "^2.24",
|
||||||
"symfony/ux-live-component": "^2.24",
|
"symfony/ux-live-component": "^2.24",
|
||||||
"symfony/ux-turbo": "^2.24",
|
"symfony/ux-turbo": "^2.24",
|
||||||
"symfony/ux-twig-component": "^2.24",
|
"symfony/ux-twig-component": "^2.24",
|
||||||
"symfony/yaml": "7.2.*",
|
"symfony/yaml": "7.3.*",
|
||||||
"symfonycasts/tailwind-bundle": "^0.10.0",
|
"symfonycasts/tailwind-bundle": "^0.10.0",
|
||||||
"twig/extra-bundle": "^2.12|^3.0",
|
"twig/extra-bundle": "^2.12|^3.0",
|
||||||
"twig/twig": "^2.12|^3.0"
|
"twig/twig": "^2.12|^3.0"
|
||||||
@@ -98,13 +98,13 @@
|
|||||||
"extra": {
|
"extra": {
|
||||||
"symfony": {
|
"symfony": {
|
||||||
"allow-contrib": false,
|
"allow-contrib": false,
|
||||||
"require": "7.2.*"
|
"require": "7.3.*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpstan/phpstan": "^2.1",
|
"phpstan/phpstan": "^2.1",
|
||||||
"symfony/maker-bundle": "^1.62",
|
"symfony/maker-bundle": "^1.62",
|
||||||
"symfony/stopwatch": "7.2.*",
|
"symfony/stopwatch": "7.3.*",
|
||||||
"symfony/web-profiler-bundle": "7.2.*"
|
"symfony/web-profiler-bundle": "7.3.*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
769
composer.lock
generated
769
composer.lock
generated
File diff suppressed because it is too large
Load Diff
3
config/packages/property_info.yaml
Normal file
3
config/packages/property_info.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
framework:
|
||||||
|
property_info:
|
||||||
|
with_constructor_extractor: true
|
||||||
@@ -25,7 +25,7 @@ class DownloadRepository extends ServiceEntityRepository
|
|||||||
$this->paginator = $paginator;
|
$this->paginator = $paginator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompletePaginated(UserInterface $user, int $pageNumber = 1, int $perPage = 10)
|
public function getCompletePaginated(UserInterface $user, int $pageNumber = 1, int $perPage = 10): Paginator
|
||||||
{
|
{
|
||||||
$query = $this->createQueryBuilder('d')
|
$query = $this->createQueryBuilder('d')
|
||||||
->andWhere('d.status IN (:statuses)')
|
->andWhere('d.status IN (:statuses)')
|
||||||
@@ -38,7 +38,7 @@ class DownloadRepository extends ServiceEntityRepository
|
|||||||
return $this->paginator->paginate($query, $pageNumber, $perPage);
|
return $this->paginator->paginate($query, $pageNumber, $perPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActivePaginated(UserInterface $user, int $pageNumber = 1, int $perPage = 5)
|
public function getActivePaginated(UserInterface $user, int $pageNumber = 1, int $perPage = 5): Paginator
|
||||||
{
|
{
|
||||||
$query = $this->createQueryBuilder('d')
|
$query = $this->createQueryBuilder('d')
|
||||||
->andWhere('d.status IN (:statuses)')
|
->andWhere('d.status IN (:statuses)')
|
||||||
|
|||||||
31
src/Monitor/Framework/Controller/WebController.php
Normal file
31
src/Monitor/Framework/Controller/WebController.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Monitor\Framework\Controller;
|
||||||
|
|
||||||
|
use App\Download\Action\Input\DeleteDownloadInput;
|
||||||
|
use App\Monitor\Action\Handler\AddMonitorHandler;
|
||||||
|
use App\Monitor\Action\Handler\DeleteMonitorHandler;
|
||||||
|
use App\Monitor\Action\Input\AddMonitorInput;
|
||||||
|
use App\Monitor\Action\Input\DeleteMonitorInput;
|
||||||
|
use App\Monitor\Framework\Repository\MonitorRepository;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Bundle\SecurityBundle\Security;
|
||||||
|
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||||
|
use Symfony\Component\Mercure\HubInterface;
|
||||||
|
use Symfony\Component\Mercure\Update;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
use Twig\Environment;
|
||||||
|
|
||||||
|
class WebController extends AbstractController
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
#[Autowire(service: 'twig')]
|
||||||
|
private readonly Environment $renderer,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
#[Route('/monitors', name: 'app_monitors', methods: ['GET'])]
|
||||||
|
public function addMonitor()
|
||||||
|
{
|
||||||
|
return $this->render('monitor/index.html.twig');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ class MonitorRepository extends ServiceEntityRepository
|
|||||||
$this->paginator = $paginator;
|
$this->paginator = $paginator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserMonitorsPaginated(UserInterface $user, int $page, int $perPage)
|
public function getUserMonitorsPaginated(UserInterface $user, int $page, int $perPage): Paginator
|
||||||
{
|
{
|
||||||
$query = $this->createQueryBuilder('m')
|
$query = $this->createQueryBuilder('m')
|
||||||
->andWhere('m.status IN (:statuses)')
|
->andWhere('m.status IN (:statuses)')
|
||||||
|
|||||||
@@ -16,15 +16,11 @@ final class DownloadList extends AbstractController
|
|||||||
{
|
{
|
||||||
use DefaultActionTrait;
|
use DefaultActionTrait;
|
||||||
|
|
||||||
|
use PaginateTrait;
|
||||||
|
|
||||||
#[LiveProp(writable: true)]
|
#[LiveProp(writable: true)]
|
||||||
public string $type;
|
public string $type;
|
||||||
|
|
||||||
#[LiveProp(writable: true)]
|
|
||||||
public int $pageNumber = 1;
|
|
||||||
|
|
||||||
#[LiveProp(writable: true)]
|
|
||||||
public int $perPage = 5;
|
|
||||||
|
|
||||||
#[LiveProp(writable: true)]
|
#[LiveProp(writable: true)]
|
||||||
public bool $isWidget = true;
|
public bool $isWidget = true;
|
||||||
|
|
||||||
@@ -42,10 +38,4 @@ final class DownloadList extends AbstractController
|
|||||||
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[LiveAction]
|
|
||||||
public function paginate(#[LiveArg] int $page)
|
|
||||||
{
|
|
||||||
$this->pageNumber = $page;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,22 @@ namespace App\Twig\Components;
|
|||||||
|
|
||||||
use App\Monitor\Framework\Repository\MonitorRepository;
|
use App\Monitor\Framework\Repository\MonitorRepository;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
|
||||||
use Symfony\UX\LiveComponent\Attribute\LiveAction;
|
use Symfony\UX\LiveComponent\Attribute\LiveAction;
|
||||||
use Symfony\UX\LiveComponent\Attribute\LiveArg;
|
use Symfony\UX\LiveComponent\Attribute\LiveProp;
|
||||||
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
|
use Symfony\UX\LiveComponent\DefaultActionTrait;
|
||||||
|
|
||||||
#[AsTwigComponent]
|
#[AsLiveComponent]
|
||||||
final class MonitorList extends AbstractController
|
final class MonitorList extends AbstractController
|
||||||
{
|
{
|
||||||
|
use DefaultActionTrait;
|
||||||
|
|
||||||
|
use PaginateTrait;
|
||||||
|
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
|
public string $type;
|
||||||
|
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
public bool $isWidget = true;
|
public bool $isWidget = true;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
@@ -18,8 +27,34 @@ final class MonitorList extends AbstractController
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[LiveAction]
|
#[LiveAction]
|
||||||
public function getUserMonitors(#[LiveArg] int $page = 1, #[LiveArg] int $perPage = 5)
|
public function getMonitors()
|
||||||
{
|
{
|
||||||
return $this->monitorRepository->getUserMonitorsPaginated($this->getUser(), $page, $perPage);
|
if ($this->type === "active") {
|
||||||
|
return $this->getActiveUserMonitors();
|
||||||
|
} elseif ($this->type === "complete") {
|
||||||
|
return $this->getCompleteUserMonitors();
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
#[LiveAction]
|
||||||
|
public function getActiveUserMonitors()
|
||||||
|
{
|
||||||
|
return $this->asPaginator($this->monitorRepository->createQueryBuilder('m')
|
||||||
|
->andWhere('m.status IN (:statuses)')
|
||||||
|
->setParameter('statuses', ['New', 'In Progress'])
|
||||||
|
->getQuery()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[LiveAction]
|
||||||
|
public function getCompleteUserMonitors()
|
||||||
|
{
|
||||||
|
return $this->asPaginator($this->monitorRepository->createQueryBuilder('m')
|
||||||
|
->andWhere('m.status = :status')
|
||||||
|
->setParameter('status', 'Complete')
|
||||||
|
->getQuery()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
src/Twig/Components/PaginateTrait.php
Normal file
30
src/Twig/Components/PaginateTrait.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Twig\Components;
|
||||||
|
|
||||||
|
use App\Util\Paginator;
|
||||||
|
use Doctrine\ORM\Query;
|
||||||
|
use Symfony\UX\LiveComponent\Attribute\LiveAction;
|
||||||
|
use Symfony\UX\LiveComponent\Attribute\LiveArg;
|
||||||
|
use Symfony\UX\LiveComponent\Attribute\LiveProp;
|
||||||
|
|
||||||
|
trait PaginateTrait
|
||||||
|
{
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
|
public int $pageNumber = 1;
|
||||||
|
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
|
public int $perPage = 5;
|
||||||
|
|
||||||
|
#[LiveAction]
|
||||||
|
public function paginate(#[LiveArg] int $page)
|
||||||
|
{
|
||||||
|
$this->pageNumber = $page;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function asPaginator(Query $query): Paginator
|
||||||
|
{
|
||||||
|
return (new Paginator())
|
||||||
|
->paginate($query, $this->pageNumber, $this->perPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
36
src/Twig/Extensions/MonitorExtension.php
Normal file
36
src/Twig/Extensions/MonitorExtension.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Twig\Extensions;
|
||||||
|
|
||||||
|
use App\Monitor\Framework\Entity\Monitor;
|
||||||
|
use Twig\Attribute\AsTwigFilter;
|
||||||
|
|
||||||
|
class MonitorExtension
|
||||||
|
{
|
||||||
|
#[AsTwigFilter('monitor_type')]
|
||||||
|
public function type(string $type)
|
||||||
|
{
|
||||||
|
$types = [
|
||||||
|
'tvshows' => 'Show',
|
||||||
|
'tvseason' => 'Season',
|
||||||
|
'tvepisode' => 'Episode',
|
||||||
|
];
|
||||||
|
|
||||||
|
return $types[$type] ?? '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
#[AsTwigFilter('monitor_media_id')]
|
||||||
|
public function mediaId(Monitor $monitor)
|
||||||
|
{
|
||||||
|
if ($monitor->getMonitorType() === "tvseason") {
|
||||||
|
return "S". str_pad($monitor->getSeason(), 2, "0", STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($monitor->getMonitorType() === "tvepisode") {
|
||||||
|
return "S". str_pad($monitor->getSeason(), 2, "0", STR_PAD_LEFT) .
|
||||||
|
"E". str_pad($monitor->getEpisode(), 2, "0", STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
}
|
||||||
21
symfony.lock
21
symfony.lock
@@ -2,6 +2,15 @@
|
|||||||
"1tomany/rich-bundle": {
|
"1tomany/rich-bundle": {
|
||||||
"version": "v1.8.3"
|
"version": "v1.8.3"
|
||||||
},
|
},
|
||||||
|
"doctrine/deprecations": {
|
||||||
|
"version": "1.1",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "1.0",
|
||||||
|
"ref": "87424683adc81d7dc305eefec1fced883084aab9"
|
||||||
|
}
|
||||||
|
},
|
||||||
"doctrine/doctrine-bundle": {
|
"doctrine/doctrine-bundle": {
|
||||||
"version": "2.14",
|
"version": "2.14",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
@@ -169,6 +178,18 @@
|
|||||||
"config/packages/messenger.yaml"
|
"config/packages/messenger.yaml"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"symfony/property-info": {
|
||||||
|
"version": "7.3",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "7.3",
|
||||||
|
"ref": "dae70df71978ae9226ae915ffd5fad817f5ca1f7"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/property_info.yaml"
|
||||||
|
]
|
||||||
|
},
|
||||||
"symfony/routing": {
|
"symfony/routing": {
|
||||||
"version": "7.2",
|
"version": "7.2",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
|
|||||||
@@ -4,6 +4,14 @@ module.exports = {
|
|||||||
"./assets/**/*.js",
|
"./assets/**/*.js",
|
||||||
"./templates/**/*.html.twig",
|
"./templates/**/*.html.twig",
|
||||||
],
|
],
|
||||||
|
safelist: [
|
||||||
|
"bg-blue-300",
|
||||||
|
"bg-orange-300",
|
||||||
|
"bg-rose-300",
|
||||||
|
"bg-green-400",
|
||||||
|
"bg-purple-400",
|
||||||
|
"bg-orange-400",
|
||||||
|
],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if this.isWidget == true and this.downloads.items|length > this.perPage %}
|
{% if this.isWidget == true and this.downloads.items|length > this.perPage %}
|
||||||
<tr id="download_view_all">
|
<tr id="download_view_all">
|
||||||
<td class="py-2 whitespace-nowrap bg-orange-500 uppercase text-sm font-medium text-center text-white truncate" colspan="100%">
|
<td class="py-2 whitespace-nowrap bg-orange-300 uppercase text-xs font-medium text-center text-black truncate" colspan="100%">
|
||||||
<a href="{{ path('app_downloads') }}">View All Downloads</a>
|
<a href="{{ path('app_downloads') }}">View All Downloads</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -3,9 +3,13 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr class="bg-orange-500 bg-filter bg-blur-lg bg-opacity-80 text-gray-950">
|
<tr class="bg-orange-500 bg-filter bg-blur-lg bg-opacity-80 text-gray-950">
|
||||||
<th scope="col"
|
<th scope="col"
|
||||||
class="px-6 py-3 text-start text-xs font-medium uppercase min-w-[45ch] max-w-[45ch] truncate">
|
class="px-6 py-3 text-start text-xs font-medium uppercase truncate">
|
||||||
Title
|
Title
|
||||||
</th>
|
</th>
|
||||||
|
<th scope="col"
|
||||||
|
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
||||||
|
ID
|
||||||
|
</th>
|
||||||
<th scope="col"
|
<th scope="col"
|
||||||
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
||||||
Search Count
|
Search Count
|
||||||
@@ -18,6 +22,10 @@
|
|||||||
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
||||||
Last Search Date
|
Last Search Date
|
||||||
</th>
|
</th>
|
||||||
|
<th scope="col"
|
||||||
|
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
||||||
|
Type
|
||||||
|
</th>
|
||||||
<th scope="col"
|
<th scope="col"
|
||||||
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
class="px-6 py-3 text-start text-xs font-medium uppercase">
|
||||||
Status
|
Status
|
||||||
@@ -26,12 +34,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="monitors" class="divide-y divide-gray-50">
|
<tbody id="monitors" class="divide-y divide-gray-50">
|
||||||
{% if this.userMonitors.items|length > 0 %}
|
{% if this.monitors.items|length > 0 %}
|
||||||
{% for monitor in this.userMonitors.items %}
|
{% for monitor in this.monitors.items %}
|
||||||
<tr id="monitor_{{ monitor.id }}">
|
<tr id="monitor_{{ monitor.id }}">
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 min-w-[50ch] max-w-[50ch] truncate">
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 truncate">
|
||||||
{{ monitor.title }}
|
{{ monitor.title }}
|
||||||
</td>
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
||||||
|
{{ monitor|monitor_media_id }}
|
||||||
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
||||||
{{ monitor.searchCount }}
|
{{ monitor.searchCount }}
|
||||||
</td>
|
</td>
|
||||||
@@ -41,6 +52,15 @@
|
|||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
||||||
{{ monitor.lastSearch|date('m/d/Y h:i a') }}
|
{{ monitor.lastSearch|date('m/d/Y h:i a') }}
|
||||||
</td>
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
||||||
|
{% if monitor.monitorType == "tvshow" %}
|
||||||
|
<twig:StatusBadge color="blue" number="300" text="black" status="{{ monitor.monitorType|monitor_type }}" />
|
||||||
|
{% elseif monitor.monitorType == "tvseason" %}
|
||||||
|
<twig:StatusBadge color="orange" number="300" text="black" status="{{ monitor.monitorType|monitor_type }}" />
|
||||||
|
{% else %}
|
||||||
|
<twig:StatusBadge color="rose" number="300" text="black" status="{{ monitor.monitorType|monitor_type }}" />
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800">
|
||||||
{% if monitor.status == "New" %}
|
{% if monitor.status == "New" %}
|
||||||
<twig:StatusBadge color="orange" status="{{ monitor.status }}" />
|
<twig:StatusBadge color="orange" status="{{ monitor.status }}" />
|
||||||
@@ -61,10 +81,10 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if this.userMonitors.items|length > 5 %}
|
{% if this.isWidget and this.monitors.items|length > 5 %}
|
||||||
<tr id="monitor_view_all">
|
<tr id="monitor_view_all">
|
||||||
<td colspan="100%" class="py-2 whitespace-nowrap bg-orange-500 uppercase text-sm font-medium text-center text-white min-w-[50ch] max-w-[50ch] truncate">
|
<td colspan="100%" class="py-2 whitespace-nowrap bg-orange-300 uppercase text-xs font-medium text-center text-black min-w-[50ch] max-w-[50ch] truncate">
|
||||||
<a href="#">View All Monitors</a>
|
<a href="{{ path('app_monitors') }}">View All Monitors</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -79,8 +99,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% if this.isWidget == false %}
|
{% if this.isWidget == false %}
|
||||||
{% if this.userMonitors.items|length > 0 %}
|
{% if this.monitors.items|length > 0 %}
|
||||||
{% set paginator = this.userMonitors %}
|
{% set paginator = this.monitors %}
|
||||||
{% include 'partial/paginator.html.twig' %}
|
{% include 'partial/paginator.html.twig' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -20,6 +20,15 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('app_monitors') }}"
|
||||||
|
class="block rounded-lg
|
||||||
|
bg-orange-500 hover:bg-opacity-80 bg-clip-padding backdrop-filter backdrop-blur-md bg-opacity-60
|
||||||
|
px-4 py-2 text-sm font-medium text-gray-50">
|
||||||
|
Monitors
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('app_user_preferences') }}"
|
<a href="{{ path('app_user_preferences') }}"
|
||||||
class="block rounded-lg px-4 py-2 text-sm font-medium text-gray-50 hover:bg-gray-100 hover:text-stone-700">
|
class="block rounded-lg px-4 py-2 text-sm font-medium text-gray-50 hover:bg-gray-100 hover:text-stone-700">
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
<span {{ attributes }} class="py-[3px] px-[7px] bg-{{ color|default('green') }}-600 rounded-lg inline-block text-center text-xs text-white">
|
<span {{ attributes }}
|
||||||
|
class="py-[3px] px-[7px]
|
||||||
|
bg-{{ color|default('green') }}-{{ number|default(400) }}
|
||||||
|
text-{{ text|default('black') }}
|
||||||
|
rounded-lg inline-block text-center text-xs"
|
||||||
|
>
|
||||||
{{ status }}
|
{{ status }}
|
||||||
</span>
|
</span>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row gap-4">
|
<div class="flex flex-row gap-4">
|
||||||
<twig:Card title="Monitors" class="w-full">
|
<twig:Card title="Monitors" class="w-full">
|
||||||
<twig:MonitorList />
|
<twig:MonitorList :type="'active'" :isWidget="true" />
|
||||||
</twig:Card>
|
</twig:Card>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
|
|||||||
18
templates/monitor/index.html.twig
Normal file
18
templates/monitor/index.html.twig
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Monitors — Torsearch{% endblock %}
|
||||||
|
{% block h2 %}Monitors{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<div class="p-4">
|
||||||
|
<twig:Card title="Active Monitors">
|
||||||
|
<twig:MonitorList :type="'active'" :isWidget="false" :perPage="10"></twig:MonitorList>
|
||||||
|
</twig:Card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="p-4">
|
||||||
|
<twig:Card title="Complete Monitors">
|
||||||
|
<twig:MonitorList :type="'complete'" :isWidget="false" :perPage="10"></twig:MonitorList>
|
||||||
|
</twig:Card>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user