feat: only shows top level monitors on dashboard and children on dedicated page
This commit is contained in:
@@ -23,7 +23,12 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (null !== content && undefined !== content && "" !== content) {
|
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}}))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ final class MonitorList extends AbstractController
|
|||||||
return $this->asPaginator($this->monitorRepository->createQueryBuilder('m')
|
return $this->asPaginator($this->monitorRepository->createQueryBuilder('m')
|
||||||
->andWhere('m.status IN (:statuses)')
|
->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.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('statuses', ['New', 'In Progress', 'Active'])
|
||||||
->setParameter('term', '%'.$this->term.'%')
|
->setParameter('term', '%'.$this->term.'%')
|
||||||
->orderBy('m.id', 'DESC')
|
->orderBy('m.id', 'DESC')
|
||||||
|
|||||||
@@ -17,10 +17,17 @@
|
|||||||
class="px-6 py-3 text-start">
|
class="px-6 py-3 text-start">
|
||||||
ID
|
ID
|
||||||
</th>
|
</th>
|
||||||
|
{% if null != parentMonitorId %}
|
||||||
<th scope="col"
|
<th scope="col"
|
||||||
class="hidden md:table-cell px-6 py-3 text-start">
|
class="hidden md:table-cell px-6 py-3 text-start">
|
||||||
Search Count
|
Search Count
|
||||||
</th>
|
</th>
|
||||||
|
{% else %}
|
||||||
|
<th scope="col"
|
||||||
|
class="hidden md:table-cell px-6 py-3 text-start">
|
||||||
|
Episodes
|
||||||
|
</th>
|
||||||
|
{% endif %}
|
||||||
<th scope="col"
|
<th scope="col"
|
||||||
class="hidden md:table-cell px-6 py-3 text-start">
|
class="hidden md:table-cell px-6 py-3 text-start">
|
||||||
Created at
|
Created at
|
||||||
|
|||||||
@@ -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"
|
<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 }}"
|
monitor-id="{{ monitor.id }}"
|
||||||
|
parent-id="{{ monitor.parent.id ?? null }}"
|
||||||
imdb-id="{{ monitor.imdbId }}"
|
imdb-id="{{ monitor.imdbId }}"
|
||||||
media-title="{{ monitor.title }}"
|
media-title="{{ monitor.title }}"
|
||||||
season="{{ monitor.season }}"
|
season="{{ monitor.season }}"
|
||||||
@@ -26,9 +27,15 @@
|
|||||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||||
{{ monitor|monitor_media_id }}
|
{{ monitor|monitor_media_id }}
|
||||||
</td>
|
</td>
|
||||||
|
{% if null != monitor.parent %}
|
||||||
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
|
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
|
||||||
{{ monitor.searchCount }}
|
{{ monitor.searchCount }}
|
||||||
</td>
|
</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">
|
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
|
||||||
{{ monitor.createdAt|date('m/d/Y h:i a') }}
|
{{ monitor.createdAt|date('m/d/Y h:i a') }}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user