个人管理后台样式调整、风格统一
This commit is contained in:
1 parent
7eed474125
commit
3062ade15f
4 files changed
+612
-180
No files matched your search
@@ -69,6 +69,10 @@ const handleLogout = () => {
|
||||
router.push('/');
|
||||
};
|
||||
|
||||
const handleVoiceFeatureClick = () => {
|
||||
showMessageDialog('info', '该功能正在开发中');
|
||||
};
|
||||
|
||||
const stripReasoningPrelude = (text: string) => {
|
||||
if (!text) return '';
|
||||
let cleaned = text
|
||||
@@ -1008,7 +1012,7 @@ const showChatRating = ref(false);
|
||||
<PanelLeftOpen class="h-5 w-5" />
|
||||
</button>
|
||||
|
||||
<div class="mb-4 flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-purple-500 to-indigo-500 text-white shadow-sm">
|
||||
<div class="mb-4 flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 text-white shadow-sm shadow-brand-500/25">
|
||||
<Sparkles class="h-5 w-5" />
|
||||
</div>
|
||||
|
||||
@@ -1018,7 +1022,7 @@ const showChatRating = ref(false);
|
||||
|
||||
<div class="mt-auto flex flex-col items-center gap-6 pb-2 text-slate-400">
|
||||
<button class="transition-colors hover:text-slate-600 dark:hover:text-slate-200"><Sparkles class="h-5 w-5" /></button>
|
||||
<div class="flex h-8 w-8 items-center justify-center rounded-full bg-purple-600 text-sm font-bold text-white shadow-sm">
|
||||
<div class="flex h-8 w-8 items-center justify-center rounded-full bg-brand-600 text-sm font-bold text-white shadow-sm shadow-brand-500/20">
|
||||
{{ (currentUser?.username || 'I').charAt(0).toUpperCase() }}
|
||||
</div>
|
||||
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" title="意见反馈"><Mail class="h-5 w-5" /></button>
|
||||
@@ -1030,7 +1034,7 @@ const showChatRating = ref(false);
|
||||
<template v-else>
|
||||
<div class="flex items-center justify-between p-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="flex h-8 w-8 items-center justify-center rounded bg-gradient-to-br from-purple-500 to-indigo-500 text-sm font-bold text-white shadow-sm">AI</div>
|
||||
<div class="flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 text-sm font-bold text-white shadow-sm shadow-brand-500/25">AI</div>
|
||||
<span class="font-bold text-slate-800 dark:text-slate-100">Hxops Alagent</span>
|
||||
</div>
|
||||
<button @click="isSidebarCollapsed = true" class="text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-200">
|
||||
@@ -1058,12 +1062,12 @@ const showChatRating = ref(false);
|
||||
v-for="item in history"
|
||||
:key="item.conversation_id"
|
||||
class="group relative flex w-full items-center justify-between rounded-lg transition-colors"
|
||||
:class="conversationId === item.conversation_id ? 'bg-blue-50 dark:bg-blue-900/20' : 'hover:bg-slate-50 dark:hover:bg-slate-800/50'"
|
||||
:class="conversationId === item.conversation_id ? 'bg-brand-50 dark:bg-brand-900/20' : 'hover:bg-slate-50 dark:hover:bg-slate-800/50'"
|
||||
>
|
||||
<button
|
||||
class="flex-1 truncate px-3 py-2.5 text-left text-sm pr-8"
|
||||
:class="conversationId === item.conversation_id
|
||||
? 'font-medium text-blue-600 dark:text-blue-400'
|
||||
? 'font-medium text-brand-700 dark:text-brand-300'
|
||||
: 'text-slate-600 dark:text-slate-300'"
|
||||
@click="loadConversation(item.conversation_id); isSidebarOpen = false;"
|
||||
>
|
||||
@@ -1082,30 +1086,30 @@ const showChatRating = ref(false);
|
||||
|
||||
<div class="mt-auto flex flex-col p-4">
|
||||
<!-- Ad Card -->
|
||||
<div class="mb-4 rounded-2xl bg-purple-50 p-4 dark:bg-purple-900/20">
|
||||
<div class="mb-2 flex items-center gap-1 font-bold text-purple-700 dark:text-purple-400">
|
||||
<div class="mb-4 rounded-2xl border border-brand-100 bg-brand-50/70 p-4 dark:border-brand-500/20 dark:bg-brand-900/10">
|
||||
<div class="mb-2 flex items-center gap-1 font-bold text-brand-700 dark:text-brand-300">
|
||||
<Crown class="h-4 w-4" /> 专业版
|
||||
</div>
|
||||
<ul class="mb-3 space-y-1 text-[11px] text-slate-600 dark:text-slate-300">
|
||||
<li class="flex items-center gap-1.5"><div class="h-1 w-1 rounded-full bg-purple-400"></div> 统一Agent知识库入口</li>
|
||||
<li class="flex items-center gap-1.5"><div class="h-1 w-1 rounded-full bg-purple-400"></div> 优化Chat界面及交互</li>
|
||||
<li class="flex items-center gap-1.5"><div class="h-1 w-1 rounded-full bg-purple-400"></div> 修改文档预览bug等</li>
|
||||
<li class="flex items-center gap-1.5"><div class="h-1 w-1 rounded-full bg-brand-400"></div> 统一Agent知识库入口</li>
|
||||
<li class="flex items-center gap-1.5"><div class="h-1 w-1 rounded-full bg-brand-400"></div> 优化Chat界面及交互</li>
|
||||
<li class="flex items-center gap-1.5"><div class="h-1 w-1 rounded-full bg-brand-400"></div> 修改文档预览bug等</li>
|
||||
</ul>
|
||||
<button class="w-full rounded-xl bg-slate-900 py-2 text-xs font-medium text-white shadow-md transition-colors hover:bg-slate-800 dark:bg-white dark:text-slate-900 dark:hover:bg-slate-200">
|
||||
<button class="w-full rounded-xl bg-brand-600 py-2 text-xs font-medium text-white shadow-md shadow-brand-500/20 transition-colors hover:bg-brand-700 dark:bg-brand-500 dark:hover:bg-brand-400">
|
||||
🚀 升级说明
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Bottom Icons -->
|
||||
<div class="flex items-center justify-between text-slate-400 relative" ref="userMenuRef">
|
||||
<button @click="showUserDropdown = !showUserDropdown" class="flex h-8 w-8 items-center justify-center rounded-full bg-purple-600 text-sm font-bold text-white shadow-sm hover:bg-purple-700 transition-colors">
|
||||
<button @click="showUserDropdown = !showUserDropdown" class="flex h-8 w-8 items-center justify-center rounded-full bg-brand-600 text-sm font-bold text-white shadow-sm shadow-brand-500/20 hover:bg-brand-700 transition-colors">
|
||||
{{ (currentUser?.username || 'I').charAt(0).toUpperCase() }}
|
||||
</button>
|
||||
|
||||
<!-- User Dropdown Menu -->
|
||||
<div v-if="showUserDropdown" class="absolute bottom-full left-0 mb-2 w-56 bg-white dark:bg-slate-900 rounded-xl shadow-xl border border-slate-100 dark:border-slate-700 py-1 z-50 animate-fade-in">
|
||||
<div class="px-4 py-3 border-b border-slate-50 dark:border-slate-700 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-purple-600 rounded-full flex items-center justify-center text-white font-bold text-lg shrink-0 shadow-sm">
|
||||
<div class="w-10 h-10 bg-brand-600 rounded-full flex items-center justify-center text-white font-bold text-lg shrink-0 shadow-sm shadow-brand-500/20">
|
||||
{{ (currentUser?.username || 'U').charAt(0).toUpperCase() }}
|
||||
</div>
|
||||
<div class="overflow-hidden">
|
||||
@@ -1135,7 +1139,7 @@ const showChatRating = ref(false);
|
||||
<div class="relative z-10 flex h-full w-full flex-1 flex-col overflow-hidden bg-white dark:bg-slate-950">
|
||||
|
||||
<div v-if="!currentAgent" class="flex flex-1 flex-col items-center justify-center space-y-4">
|
||||
<Loader2 class="h-10 w-10 animate-spin text-cyan-500" />
|
||||
<Loader2 class="h-10 w-10 animate-spin text-brand-500" />
|
||||
<p class="text-sm animate-pulse text-slate-500 dark:text-slate-300">{{ $t('chat.loadingAgent') }}</p>
|
||||
</div>
|
||||
|
||||
@@ -1155,7 +1159,7 @@ const showChatRating = ref(false);
|
||||
:class="messages.length === 0 ? 'overflow-hidden md:overflow-y-auto' : 'space-y-2 overflow-y-auto scrollbar-thin md:space-y-6'"
|
||||
>
|
||||
<div v-if="messages.length === 0" class="flex h-full flex-col items-center justify-center py-2 md:pb-16">
|
||||
<div class="mb-6 flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-purple-400 to-indigo-500 text-2xl font-bold text-white shadow-lg shadow-purple-500/20">
|
||||
<div class="mb-6 flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 text-2xl font-bold text-white shadow-lg shadow-brand-500/20">
|
||||
AI
|
||||
</div>
|
||||
<h2 class="text-center text-xl font-medium text-slate-800 dark:text-slate-100 md:text-2xl">我今天可以怎么帮助你?</h2>
|
||||
@@ -1168,7 +1172,7 @@ const showChatRating = ref(false);
|
||||
:class="msg.role === 'user' ? 'justify-end' : 'justify-start'"
|
||||
>
|
||||
<!-- AI Avatar -->
|
||||
<div v-if="msg.role === 'assistant'" class="mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-purple-400 to-indigo-500 text-white shadow-sm">
|
||||
<div v-if="msg.role === 'assistant'" class="mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 text-white shadow-sm shadow-brand-500/20">
|
||||
<Sparkles class="h-4 w-4" />
|
||||
</div>
|
||||
|
||||
@@ -1179,8 +1183,8 @@ const showChatRating = ref(false);
|
||||
<div
|
||||
class="text-[15px] leading-relaxed"
|
||||
:class="msg.role === 'user'
|
||||
? 'rounded-2xl rounded-tr-sm bg-[#165DFF] px-5 py-2.5 text-white shadow-sm'
|
||||
: 'w-full rounded-2xl border border-slate-100 bg-white px-6 py-4 shadow-sm dark:border-slate-800 dark:bg-slate-900 dark:text-slate-100'"
|
||||
? 'rounded-2xl rounded-tr-sm bg-brand-600 px-5 py-2.5 text-white shadow-sm shadow-brand-500/15'
|
||||
: 'w-full rounded-2xl border border-slate-200 bg-white px-6 py-4 shadow-sm dark:border-slate-800 dark:bg-slate-900 dark:text-slate-100'"
|
||||
>
|
||||
<div
|
||||
v-if="msg.role === 'user'"
|
||||
@@ -1287,7 +1291,7 @@ const showChatRating = ref(false);
|
||||
<button
|
||||
@click="submitLeaveForm(msg)"
|
||||
:disabled="getLeaveFormPayload(msg)?.submitting || getLeaveFormPayload(msg)?.confirmationGenerated"
|
||||
class="rounded-xl bg-[#165DFF] px-4 py-2 text-sm font-medium text-white transition hover:bg-[#0E4FD2] disabled:cursor-not-allowed disabled:opacity-60"
|
||||
class="rounded-xl bg-brand-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
{{ getLeaveFormPayload(msg)?.submitting ? '提交中...' : '提交' }}
|
||||
</button>
|
||||
@@ -1355,7 +1359,7 @@ const showChatRating = ref(false);
|
||||
v-for="(file, linkIndex) in getMessageLinks(msg)"
|
||||
:key="`src-link-top-${linkIndex}-${file.url}`"
|
||||
@click="openPreview(file)"
|
||||
class="break-all rounded-lg border border-cyan-200 bg-cyan-50 px-2.5 py-1.5 text-xs text-cyan-700 transition-colors hover:bg-cyan-100 dark:border-cyan-500/30 dark:bg-cyan-500/10 dark:text-cyan-200 dark:hover:bg-cyan-500/20"
|
||||
class="break-all rounded-lg border border-brand-200 bg-brand-50 px-2.5 py-1.5 text-xs text-brand-700 transition-colors hover:bg-brand-100 dark:border-brand-500/30 dark:bg-brand-500/10 dark:text-brand-200 dark:hover:bg-brand-500/20"
|
||||
>
|
||||
{{ file.name }}
|
||||
</button>
|
||||
@@ -1455,7 +1459,7 @@ const showChatRating = ref(false);
|
||||
</div>
|
||||
|
||||
<!-- User Avatar -->
|
||||
<div v-if="msg.role === 'user'" class="mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-purple-600 text-white shadow-sm">
|
||||
<div v-if="msg.role === 'user'" class="mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-brand-600 text-white shadow-sm shadow-brand-500/20">
|
||||
<User class="h-4 w-4" />
|
||||
</div>
|
||||
|
||||
@@ -1463,14 +1467,14 @@ const showChatRating = ref(false);
|
||||
</template>
|
||||
|
||||
<div v-if="shouldShowThinkingBubble" class="mx-auto flex max-w-5xl gap-4">
|
||||
<div class="mt-1 flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-cyan-500 to-blue-600 shadow-md shadow-cyan-500/30">
|
||||
<div class="mt-1 flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 shadow-md shadow-brand-500/25">
|
||||
<Bot class="h-5 w-5 text-white" />
|
||||
</div>
|
||||
<div class="flex items-center gap-3 rounded-2xl rounded-tl-md border border-slate-200 bg-white/95 px-5 py-3 shadow-md dark:border-slate-700 dark:bg-slate-900/85">
|
||||
<div class="flex gap-1">
|
||||
<span class="h-2 w-2 animate-bounce rounded-full bg-cyan-400"></span>
|
||||
<span class="h-2 w-2 animate-bounce rounded-full bg-cyan-400 delay-75"></span>
|
||||
<span class="h-2 w-2 animate-bounce rounded-full bg-cyan-400 delay-150"></span>
|
||||
<span class="h-2 w-2 animate-bounce rounded-full bg-brand-400"></span>
|
||||
<span class="h-2 w-2 animate-bounce rounded-full bg-brand-400 delay-75"></span>
|
||||
<span class="h-2 w-2 animate-bounce rounded-full bg-brand-400 delay-150"></span>
|
||||
</div>
|
||||
<span class="text-sm font-medium text-slate-500 dark:text-slate-300">{{ $t('chat.thinking') }}</span>
|
||||
</div>
|
||||
@@ -1496,7 +1500,12 @@ const showChatRating = ref(false);
|
||||
|
||||
<div class="mt-2 flex items-center justify-between px-2 pb-1">
|
||||
<div class="flex items-center gap-3">
|
||||
<button class="text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-200">
|
||||
<button
|
||||
@click="handleVoiceFeatureClick"
|
||||
type="button"
|
||||
title="语音功能"
|
||||
class="text-slate-400 transition-colors hover:text-brand-600 dark:hover:text-brand-300"
|
||||
>
|
||||
<Mic class="h-5 w-5" />
|
||||
</button>
|
||||
<div class="relative" ref="kbMenuRef">
|
||||
@@ -1504,7 +1513,7 @@ const showChatRating = ref(false);
|
||||
@click="showKbDropdown = !showKbDropdown"
|
||||
class="flex items-center gap-1 rounded-lg border border-slate-200 px-3 py-1.5 text-xs font-medium text-slate-600 transition-colors hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
||||
>
|
||||
<Database class="h-3.5 w-3.5 text-blue-500" />
|
||||
<Database class="h-3.5 w-3.5 text-brand-500" />
|
||||
{{ selectedKb }} <ChevronDown class="h-3 w-3" />
|
||||
</button>
|
||||
<div
|
||||
@@ -1516,7 +1525,7 @@ const showChatRating = ref(false);
|
||||
:key="option"
|
||||
@click="selectedKb = option; showKbDropdown = false"
|
||||
class="flex w-full items-center justify-between px-3 py-2 text-xs text-slate-700 transition-colors hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800"
|
||||
:class="{ 'font-bold text-blue-600 dark:text-blue-400': selectedKb === option }"
|
||||
:class="{ 'font-bold text-brand-700 dark:text-brand-300': selectedKb === option }"
|
||||
>
|
||||
{{ option }}
|
||||
<Check v-if="selectedKb === option" class="h-3.5 w-3.5" />
|
||||
@@ -1527,14 +1536,17 @@ const showChatRating = ref(false);
|
||||
@click="toggleBrowserPanel"
|
||||
class="flex items-center gap-1 rounded-lg border border-slate-200 px-3 py-1.5 text-xs font-medium text-slate-600 transition-colors hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
||||
>
|
||||
<Globe class="h-3.5 w-3.5 text-emerald-500" />
|
||||
<Globe class="h-3.5 w-3.5 text-brand-500" />
|
||||
{{ browserPanelOpen ? '收起浏览器' : '打开浏览器' }}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
@click="handleSend"
|
||||
:disabled="!input.trim() || isThinking"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-600 disabled:opacity-50 dark:bg-slate-800 dark:hover:bg-slate-700"
|
||||
class="flex h-10 w-10 items-center justify-center rounded-full border shadow-sm transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
:class="!input.trim() || isThinking
|
||||
? 'border-slate-200 bg-slate-100 text-slate-400 dark:border-slate-700 dark:bg-slate-800'
|
||||
: 'border-brand-500 bg-brand-500 text-white shadow-[0_0_0_4px_rgba(59,130,246,0.18)] hover:scale-105 hover:bg-brand-600 hover:shadow-[0_0_0_6px_rgba(59,130,246,0.24)] active:scale-95'"
|
||||
>
|
||||
<Send class="h-4 w-4" />
|
||||
</button>
|
||||
@@ -1560,7 +1572,7 @@ const showChatRating = ref(false);
|
||||
>
|
||||
<div
|
||||
class="absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors"
|
||||
:class="isBrowserResizing ? 'bg-emerald-500' : 'bg-slate-200 dark:bg-slate-800'"
|
||||
:class="isBrowserResizing ? 'bg-brand-500' : 'bg-slate-200 dark:bg-slate-800'"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@@ -1571,7 +1583,7 @@ const showChatRating = ref(false);
|
||||
>
|
||||
<div class="flex items-center justify-between border-b border-slate-200 px-4 py-3 dark:border-slate-800">
|
||||
<div class="flex items-center gap-2 text-sm font-semibold text-slate-700 dark:text-slate-100">
|
||||
<Globe class="h-4 w-4 text-emerald-500" />
|
||||
<Globe class="h-4 w-4 text-brand-500" />
|
||||
浏览器
|
||||
</div>
|
||||
<button
|
||||
@@ -1588,12 +1600,12 @@ const showChatRating = ref(false);
|
||||
v-model="browserDraftUrl"
|
||||
type="text"
|
||||
placeholder="输入网址,例如 https://example.com"
|
||||
class="flex-1 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2 text-sm text-slate-800 outline-none transition focus:border-emerald-400 focus:bg-white dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100 dark:focus:bg-slate-950"
|
||||
class="flex-1 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2 text-sm text-slate-800 outline-none transition focus:border-brand-400 focus:bg-white dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100 dark:focus:bg-slate-950"
|
||||
@keydown="handleBrowserUrlEnter"
|
||||
/>
|
||||
<button
|
||||
@click="loadBrowserPage"
|
||||
class="rounded-xl bg-emerald-600 px-3 py-2 text-xs font-medium text-white transition-colors hover:bg-emerald-500"
|
||||
class="rounded-xl bg-brand-600 px-3 py-2 text-xs font-medium text-white transition-colors hover:bg-brand-500"
|
||||
>
|
||||
打开
|
||||
</button>
|
||||
@@ -1618,7 +1630,7 @@ const showChatRating = ref(false);
|
||||
v-if="!browserCurrentUrl"
|
||||
class="flex h-full flex-col items-center justify-center gap-3 px-8 text-center text-sm text-slate-500 dark:text-slate-400"
|
||||
>
|
||||
<Globe class="h-8 w-8 text-emerald-500" />
|
||||
<Globe class="h-8 w-8 text-brand-500" />
|
||||
<div>在这里直接打开网页,边聊天边查看内容。</div>
|
||||
<div class="text-xs">支持输入 `https://`、`localhost` 或内网 IP 地址。</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user