wip
This commit is contained in:
@@ -76,41 +76,22 @@ import { ref, watch } from 'vue';
|
|||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
defineProps<{
|
const props = defineProps<{
|
||||||
def: SuperMenuDef[];
|
def: SuperMenuDef[];
|
||||||
grid?: boolean;
|
grid?: boolean;
|
||||||
|
searchIndex: { id: string; path: string; locationLabel: string[]; keywords: string[]; icon?: string; }[];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const search = ref('');
|
const search = ref('');
|
||||||
const searchResult = ref<any[]>([]);
|
const searchResult = ref<any[]>([]);
|
||||||
|
|
||||||
const INDEX = [{
|
|
||||||
id: '727cc9e8-ad67-474a-9241-b5a9a6475e47',
|
|
||||||
locationLabel: [i18n.ts.profile, i18n.ts._profile.name],
|
|
||||||
icon: 'ti ti-user',
|
|
||||||
keywords: ['name'],
|
|
||||||
path: '/settings/profile',
|
|
||||||
}, {
|
|
||||||
id: '1a06c7f9-e85e-46cb-bf5f-b3efa8e71b93',
|
|
||||||
locationLabel: [i18n.ts.profile, i18n.ts._profile.description],
|
|
||||||
icon: 'ti ti-user',
|
|
||||||
keywords: ['bio'],
|
|
||||||
path: '/settings/profile',
|
|
||||||
}, {
|
|
||||||
id: 'acbfe8cb-c3c9-4d90-8c62-713025814b2e',
|
|
||||||
locationLabel: [i18n.ts.privacy, i18n.ts.makeFollowManuallyApprove],
|
|
||||||
icon: 'ti ti-lock-open',
|
|
||||||
keywords: ['follow', 'lock', i18n.ts.lockedAccountInfo],
|
|
||||||
path: '/settings/privacy',
|
|
||||||
}];
|
|
||||||
|
|
||||||
watch(search, (value) => {
|
watch(search, (value) => {
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
searchResult.value = [];
|
searchResult.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
searchResult.value = INDEX.filter((item) => {
|
searchResult.value = props.searchIndex.filter((item) => {
|
||||||
// TODO: 日本語でひらがなカタカナの区別をしない
|
// TODO: 日本語でひらがなカタカナの区別をしない
|
||||||
return item.locationLabel.some((x) => x.toLowerCase().includes(value.toLowerCase())) || item.keywords.some((x) => x.toLowerCase().includes(value.toLowerCase()));
|
return item.locationLabel.some((x) => x.toLowerCase().includes(value.toLowerCase())) || item.keywords.some((x) => x.toLowerCase().includes(value.toLowerCase()));
|
||||||
});
|
});
|
||||||
|
@@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<div v-if="!narrow || currentPage?.route.name == null" class="nav">
|
<div v-if="!narrow || currentPage?.route.name == null" class="nav">
|
||||||
<div class="baaadecd">
|
<div class="baaadecd">
|
||||||
<MkInfo v-if="emailNotConfigured" warn class="info">{{ i18n.ts.emailNotConfiguredWarning }} <MkA to="/settings/email" class="_link">{{ i18n.ts.configure }}</MkA></MkInfo>
|
<MkInfo v-if="emailNotConfigured" warn class="info">{{ i18n.ts.emailNotConfiguredWarning }} <MkA to="/settings/email" class="_link">{{ i18n.ts.configure }}</MkA></MkInfo>
|
||||||
<MkSuperMenu :def="menuDef" :grid="narrow"></MkSuperMenu>
|
<MkSuperMenu :def="menuDef" :grid="narrow" :searchIndex="SETTING_INDEX"></MkSuperMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!(narrow && currentPage?.route.name == null)" class="main">
|
<div v-if="!(narrow && currentPage?.route.name == null)" class="main">
|
||||||
@@ -29,6 +29,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onActivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
|
import { computed, onActivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
|
||||||
|
import type { PageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
import type { SuperMenuDef } from '@/components/MkSuperMenu.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import MkSuperMenu from '@/components/MkSuperMenu.vue';
|
import MkSuperMenu from '@/components/MkSuperMenu.vue';
|
||||||
@@ -38,8 +40,7 @@ import { instance } from '@/instance.js';
|
|||||||
import { definePageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { useRouter } from '@/router/supplier.js';
|
import { useRouter } from '@/router/supplier.js';
|
||||||
import type { PageMetadata } from '@/scripts/page-metadata.js';
|
import { SETTING_INDEX } from '@/scripts/settings-index.js';
|
||||||
import type { SuperMenuDef } from '@/components/MkSuperMenu.vue';
|
|
||||||
|
|
||||||
const indexInfo = {
|
const indexInfo = {
|
||||||
title: i18n.ts.settings,
|
title: i18n.ts.settings,
|
||||||
|
26
packages/frontend/src/scripts/settings-index.ts
Normal file
26
packages/frontend/src/scripts/settings-index.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
|
export const SETTING_INDEX = [{
|
||||||
|
id: '727cc9e8-ad67-474a-9241-b5a9a6475e47',
|
||||||
|
locationLabel: [i18n.ts.profile, i18n.ts._profile.name],
|
||||||
|
icon: 'ti ti-user',
|
||||||
|
keywords: ['name'],
|
||||||
|
path: '/settings/profile',
|
||||||
|
}, {
|
||||||
|
id: '1a06c7f9-e85e-46cb-bf5f-b3efa8e71b93',
|
||||||
|
locationLabel: [i18n.ts.profile, i18n.ts._profile.description],
|
||||||
|
icon: 'ti ti-user',
|
||||||
|
keywords: ['bio'],
|
||||||
|
path: '/settings/profile',
|
||||||
|
}, {
|
||||||
|
id: 'acbfe8cb-c3c9-4d90-8c62-713025814b2e',
|
||||||
|
locationLabel: [i18n.ts.privacy, i18n.ts.makeFollowManuallyApprove],
|
||||||
|
icon: 'ti ti-lock-open',
|
||||||
|
keywords: ['follow', 'lock', i18n.ts.lockedAccountInfo],
|
||||||
|
path: '/settings/privacy',
|
||||||
|
}];
|
Reference in New Issue
Block a user