mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-13 01:30:57 +08:00
feat: 优化文案
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { usePromptStore } from '@/stores/prompt'
|
||||
|
||||
// Store
|
||||
const promptStore = usePromptStore()
|
||||
const { aiGlobalSettings } = storeToRefs(promptStore)
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits<{
|
||||
'config-changed': []
|
||||
}>()
|
||||
|
||||
// 发送条数限制
|
||||
const globalMaxMessages = computed({
|
||||
get: () => aiGlobalSettings.value.maxMessagesPerRequest,
|
||||
set: (val: number) => {
|
||||
const clampedVal = Math.max(100, Math.min(5000, val || 100))
|
||||
promptStore.updateAIGlobalSettings({ maxMessagesPerRequest: clampedVal })
|
||||
emit('config-changed')
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-6">
|
||||
<!-- 发送条数限制 -->
|
||||
<div>
|
||||
<h4 class="mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white">
|
||||
<UIcon name="i-heroicons-chat-bubble-left-right" class="h-4 w-4 text-violet-500" />
|
||||
对话设置
|
||||
</h4>
|
||||
<div class="rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex-1 pr-4">
|
||||
<p class="text-sm font-medium text-gray-900 dark:text-white">发送条数限制</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400">
|
||||
每次发送给 AI 的最大消息条数,用于控制上下文长度(100-5000)
|
||||
</p>
|
||||
</div>
|
||||
<UInput v-model.number="globalMaxMessages" type="number" min="10" max="5000" class="w-24" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 更多设置占位 -->
|
||||
<div>
|
||||
<h4 class="mb-3 flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-white">
|
||||
<UIcon name="i-heroicons-adjustments-horizontal" class="h-4 w-4 text-blue-500" />
|
||||
更多设置
|
||||
</h4>
|
||||
<div class="rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50">
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">更多聊天相关设置即将推出...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -412,7 +412,7 @@ watch(
|
||||
>
|
||||
本地服务
|
||||
</p>
|
||||
<p class="mt-0.5 text-[10px] text-gray-500">Ollama、Parallax 等</p>
|
||||
<p class="mt-0.5 text-[10px] text-gray-500">Ollama 等</p>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
|
||||
@@ -135,12 +135,9 @@ onMounted(() => {
|
||||
|
||||
<!-- 配置列表视图 -->
|
||||
<div v-else class="space-y-4">
|
||||
<UAlert v-if="configs.length === 0" color="warning" variant="outline" icon="i-lucide-terminal" class="p-2">
|
||||
<UAlert v-if="configs.length === 0" color="error" variant="outline" icon="i-lucide-terminal" class="p-2">
|
||||
<template #title>
|
||||
<p>
|
||||
强烈建议配置本地模型,分析聊天记录更加安全,个人实测8B小模型也能满足分析需求,而且可以无限量分析,本地模型部署参考
|
||||
<a href="https://github.com/GradientHQ/parallax" class="text-pink-500" target="_blank">GradientHQ/parallax</a>
|
||||
</p>
|
||||
<p>建议优先配置本地模型,分析聊天记录更加安全,个人实测qwen3-8B小模型也能满足分析需求</p>
|
||||
</template>
|
||||
</UAlert>
|
||||
<!-- 配置列表 -->
|
||||
|
||||
@@ -95,10 +95,10 @@ function isActivePreset(presetId: string, chatType: 'group' | 'private'): boolea
|
||||
<div class="flex-1 pr-4">
|
||||
<p class="text-sm font-medium text-gray-900 dark:text-white">发送条数限制</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400">
|
||||
每次发送给 AI 的最大消息条数,用于控制上下文长度(100-5000)
|
||||
每次发送给 AI 的最大消息条数,用于控制上下文长度(建议在500以上)
|
||||
</p>
|
||||
</div>
|
||||
<UInput v-model.number="globalMaxMessages" type="number" min="100" max="5000" class="w-24" />
|
||||
<UInput v-model.number="globalMaxMessages" type="number" min="1" max="5000" class="w-24" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,7 +125,7 @@ function isActivePreset(presetId: string, chatType: 'group' | 'private'): boolea
|
||||
class="group flex cursor-pointer items-center justify-between rounded-lg border p-3 transition-colors"
|
||||
:class="[
|
||||
isActivePreset(preset.id, 'group')
|
||||
? 'border-violet-300 bg-violet-50 dark:border-violet-700 dark:bg-violet-900/20'
|
||||
? 'border-primary-300 bg-primary-50 dark:border-primary-700 dark:bg-primary-900/20'
|
||||
: 'border-gray-200 bg-white hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-900 dark:hover:bg-gray-800',
|
||||
]"
|
||||
@click="setActivePreset(preset.id, 'group')"
|
||||
@@ -136,7 +136,7 @@ function isActivePreset(presetId: string, chatType: 'group' | 'private'): boolea
|
||||
class="flex h-7 w-7 shrink-0 items-center justify-center rounded-full"
|
||||
:class="[
|
||||
isActivePreset(preset.id, 'group')
|
||||
? 'bg-violet-500 text-white'
|
||||
? 'bg-primary-500 text-white'
|
||||
: 'bg-gray-200 text-gray-500 dark:bg-gray-700 dark:text-gray-400',
|
||||
]"
|
||||
>
|
||||
@@ -187,7 +187,7 @@ function isActivePreset(presetId: string, chatType: 'group' | 'private'): boolea
|
||||
class="group flex cursor-pointer items-center justify-between rounded-lg border p-3 transition-colors"
|
||||
:class="[
|
||||
isActivePreset(preset.id, 'private')
|
||||
? 'border-blue-300 bg-blue-50 dark:border-blue-700 dark:bg-blue-900/20'
|
||||
? 'border-primary-300 bg-primary-50 dark:border-primary-700 dark:bg-primary-900/20'
|
||||
: 'border-gray-200 bg-white hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-900 dark:hover:bg-gray-800',
|
||||
]"
|
||||
@click="setActivePreset(preset.id, 'private')"
|
||||
@@ -198,7 +198,7 @@ function isActivePreset(presetId: string, chatType: 'group' | 'private'): boolea
|
||||
class="flex h-7 w-7 shrink-0 items-center justify-center rounded-full"
|
||||
:class="[
|
||||
isActivePreset(preset.id, 'private')
|
||||
? 'bg-blue-500 text-white'
|
||||
? 'bg-primary-500 text-white'
|
||||
: 'bg-gray-200 text-gray-500 dark:bg-gray-700 dark:text-gray-400',
|
||||
]"
|
||||
>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export { default as AIConfigTab } from './AIConfigTab.vue'
|
||||
export { default as AIChatConfigTab } from './AIChatConfigTab.vue'
|
||||
export { default as AIConfigEditModal } from './AIConfigEditModal.vue'
|
||||
export { default as AIPromptConfigTab } from './AIPromptConfigTab.vue'
|
||||
export { default as AIPromptEditModal } from './AIPromptEditModal.vue'
|
||||
|
||||
Reference in New Issue
Block a user