feat: 后台语言包合并默认中文、日夜主题切换、官方侧栏收缩、追溯码分组与批量

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nixevol
2026-06-28 18:37:57 +08:00
co-authored by Cursor
parent 6578007c9e
commit b5170fe84b
21 changed files with 873 additions and 666 deletions
+22
View File
@@ -0,0 +1,22 @@
<template>
<n-dropdown trigger="click" :options="options" @select="onSelect">
<n-button quaternary :title="t('common.lang.zh')">
<template #icon><n-icon :component="LanguageOutline" /></template>
{{ marker }}
</n-button>
</n-dropdown>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { LanguageOutline } from '@vicons/ionicons5';
import { SUPPORTED_LOCALES, setLocale } from '@/locales';
const { t, locale } = useI18n();
const marker = computed(() => locale.value);
const options = SUPPORTED_LOCALES.map((l) => ({ label: `${l.label}(${l.value})`, key: l.value }));
function onSelect(key: string) {
setLocale(key);
}
</script>
+36
View File
@@ -0,0 +1,36 @@
<template>
<n-dropdown trigger="click" :options="options" :value="mode" @select="setMode">
<n-button quaternary circle :title="t('common.theme.title')">
<template #icon><n-icon :component="currentIcon" /></template>
</n-button>
</n-dropdown>
</template>
<script setup lang="ts">
import { computed, h } from 'vue';
import { useI18n } from 'vue-i18n';
import { NIcon } from 'naive-ui';
import { SunnyOutline, MoonOutline, ContrastOutline } from '@vicons/ionicons5';
import { useTheme, type ThemeMode } from '@/composables/useTheme';
const { t } = useI18n();
const { mode, isDark, setMode } = useTheme();
const ICONS: Record<ThemeMode, unknown> = {
light: SunnyOutline,
dark: MoonOutline,
auto: ContrastOutline,
};
const currentIcon = computed(() => (mode.value === 'auto' ? ContrastOutline : isDark.value ? MoonOutline : SunnyOutline));
function renderIcon(icon: unknown) {
return () => h(NIcon, null, { default: () => h(icon as never) });
}
const options = computed(() => [
{ label: t('common.theme.light'), key: 'light', icon: renderIcon(ICONS.light) },
{ label: t('common.theme.dark'), key: 'dark', icon: renderIcon(ICONS.dark) },
{ label: t('common.theme.auto'), key: 'auto', icon: renderIcon(ICONS.auto) },
]);
</script>