feat: only shows top level monitors on dashboard and children on dedicated page

This commit is contained in:
Brock H Caldwell
2025-11-05 22:35:12 -06:00
parent 55ab9d840e
commit a9031df3c3
4 changed files with 21 additions and 1 deletions

View File

@@ -23,7 +23,12 @@ export default class extends Controller {
}
if (null !== content && undefined !== content && "" !== content) {
document.dispatchEvent(new CustomEvent('showPreviewContentModal', {detail: {heading: heading, content: content}}))
if (['', null, undefined].includes(monitor.getAttribute('parent-id'))) {
window.location.href = `/monitors/${monitor.getAttribute('monitor-id')}`;
} else {
document.dispatchEvent(new CustomEvent('showPreviewContentModal', {detail: {heading: heading, content: content}}))
}
}
})
})

View File

@@ -53,6 +53,7 @@ final class MonitorList extends AbstractController
return $this->asPaginator($this->monitorRepository->createQueryBuilder('m')
->andWhere('m.status IN (:statuses)')
->andWhere('(m.title LIKE :term OR m.imdbId LIKE :term OR m.monitorType LIKE :term OR m.status LIKE :term)')
->andWhere('m.parent IS NULL')
->setParameter('statuses', ['New', 'In Progress', 'Active'])
->setParameter('term', '%'.$this->term.'%')
->orderBy('m.id', 'DESC')

View File

@@ -17,10 +17,17 @@
class="px-6 py-3 text-start">
ID
</th>
{% if null != parentMonitorId %}
<th scope="col"
class="hidden md:table-cell px-6 py-3 text-start">
Search Count
</th>
{% else %}
<th scope="col"
class="hidden md:table-cell px-6 py-3 text-start">
Episodes
</th>
{% endif %}
<th scope="col"
class="hidden md:table-cell px-6 py-3 text-start">
Created at

View File

@@ -1,5 +1,6 @@
<tr{{ attributes }} is="monitor-list-row" id="monitor_{{ monitor.id }}" class="dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-900"
monitor-id="{{ monitor.id }}"
parent-id="{{ monitor.parent.id ?? null }}"
imdb-id="{{ monitor.imdbId }}"
media-title="{{ monitor.title }}"
season="{{ monitor.season }}"
@@ -26,9 +27,15 @@
<td class="px-6 py-4 whitespace-nowrap text-sm">
{{ monitor|monitor_media_id }}
</td>
{% if null != monitor.parent %}
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
{{ monitor.searchCount }}
</td>
{% else %}
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
{{ monitor.children|length }}
</td>
{% endif %}
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
{{ monitor.createdAt|date('m/d/Y h:i a') }}
</td>