Merge branch 'dev' of https://gitee.com/justop/hxops into dev

This commit is contained in:
runny committed 2026-05-26 11:39:37 +08:00
commit bacff38ef7
3 files changed
+427 -143

No files matched your search

+15 -15
View File
@@ -13,7 +13,7 @@
import { ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import { useChat } from '../composables/useChat';
import { Send, Loader2, Plus, Copy, Edit2, RotateCw, Check, X, PanelLeftClose, PanelLeftOpen, Mail, Settings, ChevronDown, Sparkles, Database, Mic, LogOut, MessageSquareText, Globe, ExternalLink, Search, LayoutGrid, History, Sun, Moon } from 'lucide-vue-next';
import { Send, Loader2, Plus, Copy, Edit2, RotateCw, Check, X, PanelLeftClose, PanelLeftOpen, ChevronDown, Sparkles, Database, Mic, LogOut, MessageSquareText, Globe, ExternalLink, Search, LayoutGrid, Briefcase, History, Sun, Moon } from 'lucide-vue-next';
import { marked } from 'marked';
import { useRoute, useRouter } from 'vue-router';
import { config } from '../config';
@@ -1731,16 +1731,16 @@ const confirmLeaveSubmission = async (msg: any) => {
}
};
const getMessageCopyText = (msg: { role?: string; content?: string; type?: string }) => {
const content = String(msg?.content ?? '').trim();
const getMessageCopyText = (message: { role?: string; content?: string; type?: string }) => {
const content = String(message?.content ?? '').trim();
if (content) return content;
return '';
};
const copyToClipboard = async (msg: { role?: string; content?: string; type?: string }, index: number) => {
const text = getMessageCopyText(msg);
const copyToClipboard = async (message: { role?: string; content?: string; type?: string }, index: number) => {
const text = getMessageCopyText(message);
if (!text) {
showMessageDialog('warning', t('chat.actions.copyEmpty'));
msg.warning(t('chat.actions.copyEmpty'));
return;
}
@@ -1753,7 +1753,7 @@ const copyToClipboard = async (msg: { role?: string; content?: string; type?: st
return;
}
showMessageDialog('error', t('chat.actions.copyFailed'));
msg.warning(t('chat.actions.copyFailed'));
};
const regenerate = () => {
@@ -1979,8 +1979,8 @@ const showChatRating = ref(false);
<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="$t('chat.generalFeedback')"><Mail class="h-5 w-5" /></button>
<button @click="router.push('/workspace?no_redirect=1')" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200"><Settings class="h-5 w-5" /></button>
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="$t('chat.generalFeedback')"><MessageSquareText class="h-5 w-5" /></button>
<button @click="router.push('/workspace?no_redirect=1')" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="$t('workspace.title')"><Briefcase class="h-5 w-5" /></button>
</div>
</div>
</template>
@@ -2076,9 +2076,9 @@ const showChatRating = ref(false);
</div>
</div>
<div class="px-4 pt-3 pb-1 text-xs font-medium text-slate-500 dark:text-slate-400">{{ $t('chat.language') }}</div>
<div class="px-4 pb-2">
<select v-model="locale" class="w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-700 outline-none transition focus:border-brand-400 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200">
<div class="flex items-center gap-2 px-4 py-2">
<span class="shrink-0 text-xs font-medium text-slate-500 dark:text-slate-400">{{ $t('chat.language') }}</span>
<select v-model="locale" class="min-w-0 flex-1 rounded-lg border border-slate-200 bg-slate-50 px-2 py-1 text-xs text-slate-700 outline-none transition focus:border-brand-400 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200">
<option value="zh-CN">简体中文</option>
<option value="en">English</option>
<option value="zh-TW">繁體中文</option>
@@ -2086,7 +2086,7 @@ const showChatRating = ref(false);
</select>
</div>
<button @click="handleLogout" class="w-full text-left px-4 py-2 text-sm text-red-600 hover:bg-red-50 flex items-center gap-2 transition-colors mt-1">
<button @click="handleLogout" class="flex w-full items-center gap-2 border-t border-slate-50 px-4 py-2 text-left text-sm text-red-600 transition-colors hover:bg-red-50 dark:border-slate-700/50 dark:hover:bg-red-950/30">
<LogOut class="w-4 h-4" />
{{ $t('chat.logout') }}
</button>
@@ -2100,8 +2100,8 @@ const showChatRating = ref(false);
<Sun v-if="appliedTheme === 'dark'" class="h-4 w-4" />
<Moon v-else class="h-4 w-4" />
</button>
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="$t('chat.generalFeedback')"><Mail class="h-4 w-4" /></button>
<button @click="router.push('/workspace?no_redirect=1')" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200"><Settings class="h-4 w-4" /></button>
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="$t('chat.generalFeedback')"><MessageSquareText class="h-4 w-4" /></button>
<button @click="router.push('/workspace?no_redirect=1')" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="$t('workspace.title')"><Briefcase class="h-4 w-4" /></button>
</div>
</div>
</div>