mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-26 18:24:36 +02:00
refactor(frontend): MkRadiosの指定をpropsから行うように (#16597)
* refactor(frontend): MkRadiosの指定をpropsから行うように * spdx * fix lint * fix: mkradiosを動的slotsに対応させる * fix: remove comment [ci skip] * fix lint * fix lint * migrate * rename * fix * fix * fix types * remove unused imports * fix * wip --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
@@ -19,11 +19,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #header>{{ i18n.ts.options }}</template>
|
||||
|
||||
<div class="_gaps_m">
|
||||
<MkRadios v-model="searchScope">
|
||||
<option v-if="instance.federation !== 'none' && noteSearchableScope === 'global'" value="all">{{ i18n.ts._search.searchScopeAll }}</option>
|
||||
<option value="local">{{ instance.federation === 'none' ? i18n.ts._search.searchScopeAll : i18n.ts._search.searchScopeLocal }}</option>
|
||||
<option v-if="instance.federation !== 'none' && noteSearchableScope === 'global'" value="server">{{ i18n.ts._search.searchScopeServer }}</option>
|
||||
<option value="user">{{ i18n.ts._search.searchScopeUser }}</option>
|
||||
<MkRadios
|
||||
v-model="searchScope"
|
||||
:options="searchScopeDef"
|
||||
>
|
||||
</MkRadios>
|
||||
|
||||
<div v-if="instance.federation !== 'none' && searchScope === 'server'" :class="$style.subOptionRoot">
|
||||
@@ -127,6 +126,7 @@ import MkNotesTimeline from '@/components/MkNotesTimeline.vue';
|
||||
import MkRadios from '@/components/MkRadios.vue';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
import { Paginator } from '@/utility/paginator.js';
|
||||
import type { MkRadiosOption } from '@/components/MkRadios.vue';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
query?: string;
|
||||
@@ -183,6 +183,24 @@ const searchScope = ref<'all' | 'local' | 'server' | 'user'>((() => {
|
||||
return 'all';
|
||||
})());
|
||||
|
||||
const searchScopeDef = computed<MkRadiosOption[]>(() => {
|
||||
const options: MkRadiosOption[] = [];
|
||||
|
||||
if (instance.federation !== 'none' && noteSearchableScope === 'global') {
|
||||
options.push({ value: 'all', label: i18n.ts._search.searchScopeAll });
|
||||
}
|
||||
|
||||
options.push({ value: 'local', label: instance.federation === 'none' ? i18n.ts._search.searchScopeAll : i18n.ts._search.searchScopeLocal });
|
||||
|
||||
if (instance.federation !== 'none' && noteSearchableScope === 'global') {
|
||||
options.push({ value: 'server', label: i18n.ts._search.searchScopeServer });
|
||||
}
|
||||
|
||||
options.push({ value: 'user', label: i18n.ts._search.searchScopeUser });
|
||||
|
||||
return options;
|
||||
});
|
||||
|
||||
type SearchParams = {
|
||||
readonly query: string;
|
||||
readonly host?: string;
|
||||
|
||||
Reference in New Issue
Block a user