Sorting aggregated actors by scene count back-end, showing disclaimer when limit is reached.

This commit is contained in:
2024-02-29 01:40:11 +01:00
parent 2125a91524
commit 92c2b1866b
10 changed files with 172 additions and 130 deletions

View File

@@ -1,36 +1,36 @@
<template>
<div class="filter channels-container">
<div class="filters-sort">
<input
v-model="search"
type="search"
:placeholder="`Filter ${channels.length} channels`"
class="input input-inline filters-search"
>
<div
v-show="order === 'name'"
class="filter-sort order noselect"
@click="order = 'count'"
>
<Icon icon="sort-alpha-asc" />
</div>
<div
v-show="order === 'count'"
class="filter-sort order noselect"
@click="order = 'name'"
>
<Icon icon="sort-numeric-desc" />
</div>
</div>
<div
v-if="entities.length === 0"
class="filter-empty"
>No channels</div>
<template v-else>
<div class="filters-sort">
<input
v-model="search"
type="search"
:placeholder="`Filter ${channels.length} channels`"
class="input input-inline filters-search"
>
<div
v-show="order === 'name'"
class="filter-sort order noselect"
@click="order = 'count'"
>
<Icon icon="sort-alpha-asc" />
</div>
<div
v-show="order === 'count'"
class="filter-sort order noselect"
@click="order = 'name'"
>
<Icon icon="sort-numeric-desc" />
</div>
</div>
<ul
class="filter-items nolist"
>
@@ -128,14 +128,14 @@ const entities = computed(() => {
return acc;
}
if (!acc[channel.parent.id] && channel.type === 'channel') {
if (channel.parent && !acc[channel.parent.id] && channel.type === 'channel') {
acc[channel.parent.id] = {
...channel.parent,
children: [],
};
}
if (channel.type === 'channel') {
if (channel.parent && channel.type === 'channel') {
acc[channel.parent.id].children.push(channel);
}