Commit bf0b63cd0b
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/extrepo/ExtensionRepos.vue +16 −1
| @@ -2,6 +2,7 @@ | |||
| 2 | import { refDebounced } from '@vueuse/core' | 2 | import { refDebounced } from '@vueuse/core' |
| 3 | import { computed, nextTick, onUnmounted, ref, watch } from 'vue' | 3 | import { computed, nextTick, onUnmounted, ref, watch } from 'vue' |
| 4 | import { SEARCH_DEBOUNCE_MS, STATUS_TICK_MS } from './constants' | 4 | import { SEARCH_DEBOUNCE_MS, STATUS_TICK_MS } from './constants' |
| 5 | import { groupSites } from './groupSites' | ||
| 5 | import { escapeHtml, stripHtml } from './helpers' | 6 | import { escapeHtml, stripHtml } from './helpers' |
| 6 | import { mangayomiCopyValue } from './install' | 7 | import { mangayomiCopyValue } from './install' |
| 7 | import RepoRow from './RepoRow.vue' | 8 | import RepoRow from './RepoRow.vue' |
| @@ -197,6 +198,20 @@ const { facets, isFiltering, filteredSites } = useRepoFilter(allSites, { | |||
| 197 | contentTypeFilter, | 198 | contentTypeFilter, |
| 198 | showBroken | 199 | showBroken |
| 199 | }) | 200 | }) |
| 201 | |||
| 202 | const totalExtensions = computed(() => { | ||
| 203 | const visible = showBroken.value | ||
| 204 | ? allSites.value | ||
| 205 | : allSites.value.filter(site => !site.isBroken) | ||
| 206 | return groupSites(visible).length | ||
| 207 | }) | ||
| 208 | |||
| 209 | const searchPlaceholder = computed(() => { | ||
| 210 | const total = totalExtensions.value | ||
| 211 | return total | ||
| 212 | ? `Search all extensions (${total.toLocaleString()})…` | ||
| 213 | : 'Search all extensions…' | ||
| 214 | }) | ||
| 200 | </script> | 215 | </script> |
| 201 | 216 | ||
| 202 | <template> | 217 | <template> |
| @@ -204,7 +219,7 @@ const { facets, isFiltering, filteredSites } = useRepoFilter(allSites, { | |||
| 204 | <div class="ext-toolbar"> | 219 | <div class="ext-toolbar"> |
| 205 | <div class="ext-search"> | 220 | <div class="ext-search"> |
| 206 | <span class="i-lucide:search" /> | 221 | <span class="i-lucide:search" /> |
| 207 | <input v-model="query" type="text" placeholder="Search all sites…" /> | 222 | <input v-model="query" type="text" :placeholder="searchPlaceholder" /> |
| 208 | </div> | 223 | </div> |
| 209 | <button | 224 | <button |
| 210 | type="button" | 225 | type="button" |