mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
refactor(settings): move session index to AI settings and reorder tabs
Move SessionIndexSection from StorageTab to AISettingsTab (placed above export settings), rename label from "会话管理" to "会话索引" across all locales, swap automation tab before data management tab, and simplify StorageTab by removing its now-unnecessary SubTabs navigation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
10a2677d74
commit
e05016c512
8 files changed
+15
-49
No files matched your search
File renamed without changes.
@@ -6,6 +6,7 @@ import AIDefaultModelTab from './AI/AIDefaultModelTab.vue'
|
||||
import AIPromptConfigTab from './AI/AIPromptConfigTab.vue'
|
||||
import AIPreprocessTab from './AI/AIPreprocessTab.vue'
|
||||
import AIExportSettingsTab from './AI/AIExportSettingsTab.vue'
|
||||
import SessionIndexSection from './AI/SessionIndexSection.vue'
|
||||
import SubTabs from '@/components/UI/SubTabs.vue'
|
||||
import { useSubTabsScroll } from '@/composables/useSubTabsScroll'
|
||||
|
||||
@@ -24,6 +25,7 @@ const navItems = computed(() => [
|
||||
{ id: 'skill', label: t('settings.aiPrompt.skillSettings.title') },
|
||||
{ id: 'compression', label: t('settings.aiPrompt.compression.title') },
|
||||
{ id: 'preprocess', label: t('settings.tabs.aiPreprocess') },
|
||||
{ id: 'sessionIndex', label: t('settings.tabs.sessionManage') },
|
||||
{ id: 'export', label: t('settings.aiPrompt.exportSettings.title') },
|
||||
])
|
||||
|
||||
@@ -81,6 +83,11 @@ void aiModelConfigRef.value
|
||||
<AIPreprocessTab />
|
||||
</div>
|
||||
|
||||
<!-- 会话索引 -->
|
||||
<div :ref="(el) => setSectionRef('sessionIndex', el as HTMLElement)">
|
||||
<SessionIndexSection />
|
||||
</div>
|
||||
|
||||
<!-- 导出设置 -->
|
||||
<div :ref="(el) => setSectionRef('export', el as HTMLElement)">
|
||||
<AIExportSettingsTab @config-changed="handleAIConfigChanged" />
|
||||
|
||||
@@ -1,26 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 数据和存储设置 Tab
|
||||
* 包含存储管理和会话管理两个子 Tab
|
||||
*/
|
||||
import { ref, computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ref } from 'vue'
|
||||
import StorageManageSection from './DataStorage/StorageManageSection.vue'
|
||||
import SessionIndexSection from './DataStorage/SessionIndexSection.vue'
|
||||
import SubTabs from '@/components/UI/SubTabs.vue'
|
||||
import { useSubTabsScroll } from '@/composables/useSubTabsScroll'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
// 导航配置
|
||||
const navItems = computed(() => [
|
||||
{ id: 'storage', label: t('settings.tabs.storageManage') },
|
||||
{ id: 'session', label: t('settings.tabs.sessionManage') },
|
||||
])
|
||||
|
||||
// 使用二级导航滚动联动 composable
|
||||
const { activeNav, scrollContainerRef, setSectionRef, handleNavChange } = useSubTabsScroll(navItems)
|
||||
void scrollContainerRef // 在模板中通过 ref="scrollContainerRef" 使用
|
||||
|
||||
// Template refs
|
||||
const storageManageRef = ref<InstanceType<typeof StorageManageSection> | null>(null)
|
||||
@@ -32,28 +12,7 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex h-full gap-6">
|
||||
<!-- 左侧锚点导航 -->
|
||||
<div class="w-28 shrink-0">
|
||||
<SubTabs v-model="activeNav" :items="navItems" orientation="vertical" @change="handleNavChange" />
|
||||
</div>
|
||||
|
||||
<!-- 右侧内容区域 -->
|
||||
<div ref="scrollContainerRef" class="min-w-0 flex-1 overflow-y-auto">
|
||||
<div class="space-y-8">
|
||||
<!-- 存储管理 -->
|
||||
<div :ref="(el) => setSectionRef('storage', el as HTMLElement)">
|
||||
<StorageManageSection ref="storageManageRef" />
|
||||
</div>
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<div class="border-t border-gray-200 dark:border-gray-700" />
|
||||
|
||||
<!-- 会话管理 -->
|
||||
<div :ref="(el) => setSectionRef('session', el as HTMLElement)">
|
||||
<SessionIndexSection />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-full overflow-y-auto">
|
||||
<StorageManageSection ref="storageManageRef" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -24,8 +24,8 @@ interface ScrollableTab {
|
||||
const tabs = computed(() => [
|
||||
{ id: 'settings', label: t('settings.tabs.basic'), icon: 'i-heroicons-cog-6-tooth' },
|
||||
{ id: 'ai', label: t('settings.tabs.ai'), icon: 'i-heroicons-sparkles' },
|
||||
{ id: 'data', label: t('settings.tabs.dataManage'), icon: 'i-heroicons-rectangle-stack' },
|
||||
{ id: 'api', label: t('settings.tabs.api'), icon: 'i-heroicons-server-stack' },
|
||||
{ id: 'data', label: t('settings.tabs.dataManage'), icon: 'i-heroicons-rectangle-stack' },
|
||||
{ id: 'storage', label: t('settings.tabs.storage'), icon: 'i-heroicons-folder-open' },
|
||||
{ id: 'about', label: t('settings.tabs.about'), icon: 'i-heroicons-information-circle' },
|
||||
])
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"dataManage": "Data Management",
|
||||
"storage": "Storage",
|
||||
"storageManage": "Storage",
|
||||
"sessionManage": "Sessions",
|
||||
"sessionManage": "Session Index",
|
||||
"about": "About",
|
||||
"api": "Automation",
|
||||
"apiSubTabs": {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"dataManage": "データ管理",
|
||||
"storage": "ストレージ管理",
|
||||
"storageManage": "ストレージ管理",
|
||||
"sessionManage": "セッション管理",
|
||||
"sessionManage": "セッションインデックス",
|
||||
"about": "ChatLabについて",
|
||||
"api": "オートメーション",
|
||||
"apiSubTabs": {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"dataManage": "数据管理",
|
||||
"storage": "存储管理",
|
||||
"storageManage": "存储管理",
|
||||
"sessionManage": "会话管理",
|
||||
"sessionManage": "会话索引",
|
||||
"about": "关于",
|
||||
"api": "自动化",
|
||||
"apiSubTabs": {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"dataManage": "資料管理",
|
||||
"storage": "儲存管理",
|
||||
"storageManage": "儲存管理",
|
||||
"sessionManage": "會話管理",
|
||||
"sessionManage": "會話索引",
|
||||
"about": "關於 ChatLab",
|
||||
"api": "自動化",
|
||||
"apiSubTabs": {
|
||||
|
||||
Reference in new issue
Block a user