fix: 优化暗黑主题下相关背景色
This commit is contained in:
1 parent
bacff38ef7
commit
041c2d033f
4 files changed
+59
-45
No files matched your search
@@ -98,7 +98,7 @@
|
||||
}
|
||||
|
||||
.card {
|
||||
@apply bg-white rounded-2xl border border-slate-100 shadow-soft hover:shadow-lg transition-all duration-300;
|
||||
@apply bg-white rounded-2xl border border-slate-100 shadow-soft hover:shadow-lg transition-all duration-300 dark:bg-slate-800 dark:border-slate-700;
|
||||
}
|
||||
|
||||
/* Mobile-first layout tokens for consistent spacing and density. */
|
||||
|
||||
@@ -241,6 +241,10 @@ const route = useRoute();
|
||||
|
||||
// 当前左侧菜单激活的模块:dashboard / agents / permissions
|
||||
const activeModule = ref<'dashboard' | 'agents' | 'announcements' | 'permissions' | 'requests' | 'reports' | 'approvals' | 'users' | 'departments' | 'questions' | 'wecom' | 'schedules' | 'knowledge_base'>('dashboard');
|
||||
const adminSidebarNavActive =
|
||||
'bg-brand-50 text-brand-700 shadow-sm dark:bg-brand-500/15 dark:text-brand-300 dark:shadow-none dark:ring-1 dark:ring-inset dark:ring-brand-500/25';
|
||||
const adminSidebarNavInactive =
|
||||
'text-slate-600 hover:bg-slate-50 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/80 dark:hover:text-slate-200';
|
||||
const expandedReports = ref(true);
|
||||
|
||||
// agents:管理员视角下的所有 Agent 列表
|
||||
@@ -3463,28 +3467,29 @@ const handlePermissionImport = async (event: Event) => {
|
||||
v-for="item in sidebarItems"
|
||||
:key="item.id"
|
||||
class="group px-4 py-3 text-left text-sm font-medium rounded-xl transition-all flex items-center gap-3 relative overflow-hidden whitespace-nowrap flex-shrink-0"
|
||||
:class="activeModule === item.id ? 'bg-brand-50 text-brand-700' : 'text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-slate-100'"
|
||||
:class="activeModule === item.id ? adminSidebarNavActive : adminSidebarNavInactive"
|
||||
@click="activeModule = item.id as any; activeReportTabId = null"
|
||||
:title="isSidebarCollapsed ? item.label : ''"
|
||||
>
|
||||
<component :is="item.icon" class="w-5 h-5 transition-transform group-hover:scale-110 flex-shrink-0" :class="activeModule === item.id ? 'text-brand-600' : 'text-slate-400 dark:text-slate-500 group-hover:text-slate-600 dark:group-hover:text-slate-300'" />
|
||||
<component :is="item.icon" class="w-5 h-5 transition-transform group-hover:scale-110 flex-shrink-0" :class="activeModule === item.id ? 'text-brand-600 dark:text-brand-300' : 'text-slate-400 dark:text-slate-500 group-hover:text-slate-600 dark:group-hover:text-slate-300'" />
|
||||
<span :class="isSidebarCollapsed ? 'md:hidden' : ''">{{ item.label }}</span>
|
||||
<span v-if="item.badge && !isSidebarCollapsed" class="ml-auto bg-red-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full shadow-sm">
|
||||
{{ item.badge }}
|
||||
</span>
|
||||
<span v-if="item.badge && isSidebarCollapsed" class="absolute top-2 right-2 w-2 h-2 bg-red-500 rounded-full"></span>
|
||||
<div v-if="activeModule === item.id" class="absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 bg-brand-600 rounded-r-full"></div>
|
||||
<div v-if="activeModule === item.id" class="absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 bg-brand-600 dark:bg-brand-400 rounded-r-full"></div>
|
||||
</button>
|
||||
|
||||
<!-- Reports Submenu -->
|
||||
<div v-if="config.admin.modules.reports !== false" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
@click="expandedReports = !expandedReports"
|
||||
class="group px-4 py-3 text-left text-sm font-medium rounded-xl transition-all flex items-center justify-between gap-3 relative overflow-hidden whitespace-nowrap text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-slate-100"
|
||||
class="group px-4 py-3 text-left text-sm font-medium rounded-xl transition-all flex items-center justify-between gap-3 relative overflow-hidden whitespace-nowrap"
|
||||
:class="activeModule === 'reports' ? adminSidebarNavActive : adminSidebarNavInactive"
|
||||
:title="isSidebarCollapsed ? t('admin.nav.reports') : ''"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<BarChart2 class="w-5 h-5 text-slate-400 dark:text-slate-500 group-hover:text-slate-600 dark:group-hover:text-slate-300 flex-shrink-0" />
|
||||
<BarChart2 class="w-5 h-5 flex-shrink-0 transition-colors" :class="activeModule === 'reports' ? 'text-brand-600 dark:text-brand-300' : 'text-slate-400 dark:text-slate-500 group-hover:text-slate-600 dark:group-hover:text-slate-300'" />
|
||||
<span :class="isSidebarCollapsed ? 'md:hidden' : ''">{{ t('admin.nav.reports') }}</span>
|
||||
</div>
|
||||
<svg v-if="!isSidebarCollapsed" :class="expandedReports ? 'rotate-180' : ''" class="w-4 h-4 transition-transform text-slate-400 dark:text-slate-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
@@ -3498,9 +3503,9 @@ const handlePermissionImport = async (event: Event) => {
|
||||
:key="table"
|
||||
@click="openReportTab(table)"
|
||||
class="w-full text-left px-4 py-2 text-xs font-medium rounded-lg transition-colors flex items-center gap-2"
|
||||
:class="(activeModule === 'reports' && currentTable === table) ? 'bg-brand-50 text-brand-700' : 'text-slate-500 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-slate-100'"
|
||||
:class="(activeModule === 'reports' && currentTable === table) ? adminSidebarNavActive : adminSidebarNavInactive"
|
||||
>
|
||||
<div class="w-1.5 h-1.5 rounded-full" :class="(activeModule === 'reports' && currentTable === table) ? 'bg-brand-600' : 'bg-slate-300'"></div>
|
||||
<div class="w-1.5 h-1.5 rounded-full" :class="(activeModule === 'reports' && currentTable === table) ? 'bg-brand-600 dark:bg-brand-400' : 'bg-slate-300 dark:bg-slate-600'"></div>
|
||||
{{ getReportTableLabel(table) }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -972,8 +972,11 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null
|
||||
|
||||
const parseDateStr = (m: RegExpMatchArray | null, groupOffset: number): Date | null => {
|
||||
if (!m) return null;
|
||||
const mo = parseInt(m[groupOffset], 10);
|
||||
const da = parseInt(m[groupOffset + 1], 10);
|
||||
const rawMo = m[groupOffset];
|
||||
const rawDa = m[groupOffset + 1];
|
||||
if (!rawMo || !rawDa) return null;
|
||||
const mo = parseInt(rawMo, 10);
|
||||
const da = parseInt(rawDa, 10);
|
||||
if (Number.isNaN(mo) || Number.isNaN(da) || mo < 1 || mo > 12 || da < 1 || da > 31) return null;
|
||||
return new Date(thisYear, mo - 1, da, 9, 0);
|
||||
};
|
||||
@@ -996,8 +999,8 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null
|
||||
if (rangeM) {
|
||||
const s = parseDateStr(rangeM, 1);
|
||||
if (rangeM[3] && rangeM[3].length <= 2 && rangeM[4] && rangeM[4].length <= 2) {
|
||||
const eMo = parseInt(rangeM[3], 10);
|
||||
const eDa = parseInt(rangeM[4], 10);
|
||||
const eMo = parseInt(rangeM[3]!, 10);
|
||||
const eDa = parseInt(rangeM[4]!, 10);
|
||||
if (!Number.isNaN(eMo) && eMo >= 1 && eMo <= 12 && !Number.isNaN(eDa) && eDa >= 1 && eDa <= 31) {
|
||||
endDay = new Date(thisYear, eMo - 1, eDa, 18, 0);
|
||||
} else if (!Number.isNaN(eDa) && eDa >= 1 && eDa <= 31 && s) {
|
||||
@@ -1014,7 +1017,7 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null
|
||||
if (s) {
|
||||
startDay = s;
|
||||
const dayUnitM = normalized.match(/(\d+\.?\d*)\s*[天日]/);
|
||||
if (dayUnitM) {
|
||||
if (dayUnitM?.[1]) {
|
||||
const days = parseFloat(dayUnitM[1]);
|
||||
if (days > 1) endDay = new Date(s.getFullYear(), s.getMonth(), s.getDate() + Math.ceil(days) - 1, 18, 0);
|
||||
else endDay = new Date(s.getFullYear(), s.getMonth(), s.getDate(), 18, 0);
|
||||
@@ -1026,7 +1029,7 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null
|
||||
}
|
||||
|
||||
const hourM = normalized.match(/(\d+\.?\d*)\s*小时/);
|
||||
if (hourM) {
|
||||
if (hourM?.[1]) {
|
||||
durationHours = parseFloat(hourM[1]);
|
||||
if (startDay && !endDay) {
|
||||
endDay = new Date(startDay.getTime() + durationHours * 3600000);
|
||||
@@ -1034,7 +1037,7 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null
|
||||
}
|
||||
|
||||
const dayM = normalized.match(/(\d+\.?\d*)\s*[天日]/);
|
||||
if (dayM && !hourM) {
|
||||
if (dayM?.[1] && !hourM) {
|
||||
const days = parseFloat(dayM[1]);
|
||||
durationHours = days * 8;
|
||||
if (startDay && !endDay) {
|
||||
|
||||
@@ -773,6 +773,10 @@ const handleRegister = async () => {
|
||||
};
|
||||
|
||||
const activeSidebarItem = ref<'profile' | 'applications' | 'feedback' | 'updates' | 'knowledge_base' | 'schedule_runs' | 'history'>('applications');
|
||||
const workspaceSidebarNavActive =
|
||||
'bg-brand-50 text-brand-700 shadow-sm dark:bg-brand-500/15 dark:text-brand-300 dark:shadow-none dark:ring-1 dark:ring-inset dark:ring-brand-500/25';
|
||||
const workspaceSidebarNavInactive =
|
||||
'text-slate-600 hover:bg-slate-50 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/80 dark:hover:text-slate-200';
|
||||
const isProfileLoading = ref(false);
|
||||
const isProfileSaving = ref(false);
|
||||
const isProfileEditing = ref(false);
|
||||
@@ -1553,15 +1557,15 @@ onMounted(async () => {
|
||||
</header>
|
||||
<div class="grid min-h-screen gap-0 lg:grid-cols-[232px_minmax(0,1fr)]">
|
||||
<aside v-if="!isMobile" class="lg:sticky lg:top-0 lg:h-screen">
|
||||
<div class="flex h-full flex-col border-r border-slate-200 bg-white px-5 py-6 shadow-sm">
|
||||
<div class="border-b border-slate-100 pb-6">
|
||||
<div class="flex h-full flex-col border-r border-slate-200 bg-white px-5 py-6 shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<div class="border-b border-slate-100 pb-6 dark:border-slate-800">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-500 via-brand-600 to-purple-600 text-white shadow-lg shadow-brand-500/25">
|
||||
<Bot class="h-6 w-6" />
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
<div class="text-2xl font-extrabold tracking-tight text-[#14213d]">{{ $t('workspace.brandTitle') }}</div>
|
||||
<div class="truncate text-xs font-medium text-slate-400">
|
||||
<div class="text-2xl font-extrabold tracking-tight text-[#14213d] dark:text-slate-100">{{ $t('workspace.brandTitle') }}</div>
|
||||
<div class="truncate text-xs font-medium text-slate-400 dark:text-slate-500">
|
||||
{{ currentUser?.username }} / {{ currentUser?.role }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1573,7 +1577,7 @@ onMounted(async () => {
|
||||
<button
|
||||
@click="navigateToProfile"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="activeSidebarItem === 'profile' ? 'bg-brand-50 text-brand-700 shadow-sm' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'"
|
||||
:class="activeSidebarItem === 'profile' ? workspaceSidebarNavActive : workspaceSidebarNavInactive"
|
||||
>
|
||||
<User class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.profile') }}</span>
|
||||
@@ -1581,7 +1585,8 @@ onMounted(async () => {
|
||||
<button
|
||||
v-if="currentUser?.role === 'admin'"
|
||||
@click="openAdminPanel"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium text-slate-600 transition-all hover:bg-slate-50 hover:text-slate-900"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="workspaceSidebarNavInactive"
|
||||
>
|
||||
<Settings class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.admin') }}</span>
|
||||
@@ -1589,7 +1594,7 @@ onMounted(async () => {
|
||||
<button
|
||||
@click="navigateToApplications"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="activeSidebarItem === 'applications' ? 'bg-brand-50 text-brand-700 shadow-sm' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'"
|
||||
:class="activeSidebarItem === 'applications' ? workspaceSidebarNavActive : workspaceSidebarNavInactive"
|
||||
>
|
||||
<LayoutGrid class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.applications') }}</span>
|
||||
@@ -1597,7 +1602,7 @@ onMounted(async () => {
|
||||
<button
|
||||
@click="navigateToKnowledgeBase"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="activeSidebarItem === 'knowledge_base' ? 'bg-brand-50 text-brand-700 shadow-sm' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'"
|
||||
:class="activeSidebarItem === 'knowledge_base' ? workspaceSidebarNavActive : workspaceSidebarNavInactive"
|
||||
>
|
||||
<FileText class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.knowledgeBase') }}</span>
|
||||
@@ -1605,7 +1610,7 @@ onMounted(async () => {
|
||||
<button
|
||||
@click="navigateToScheduleRuns"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="activeSidebarItem === 'schedule_runs' ? 'bg-brand-50 text-brand-700 shadow-sm' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'"
|
||||
:class="activeSidebarItem === 'schedule_runs' ? workspaceSidebarNavActive : workspaceSidebarNavInactive"
|
||||
>
|
||||
<Clock class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.scheduleRuns') }}</span>
|
||||
@@ -1613,7 +1618,7 @@ onMounted(async () => {
|
||||
<button
|
||||
@click="openGeneralFeedback"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="activeSidebarItem === 'feedback' ? 'bg-brand-50 text-brand-700 shadow-sm' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'"
|
||||
:class="activeSidebarItem === 'feedback' ? workspaceSidebarNavActive : workspaceSidebarNavInactive"
|
||||
>
|
||||
<Edit class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.feedback') }}</span>
|
||||
@@ -1621,7 +1626,7 @@ onMounted(async () => {
|
||||
<button
|
||||
@click="navigateToUpdates"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="activeSidebarItem === 'updates' ? 'bg-brand-50 text-brand-700 shadow-sm' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'"
|
||||
:class="activeSidebarItem === 'updates' ? workspaceSidebarNavActive : workspaceSidebarNavInactive"
|
||||
>
|
||||
<Megaphone class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.updates') }}</span>
|
||||
@@ -1629,18 +1634,19 @@ onMounted(async () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border-t border-slate-100 pt-6">
|
||||
<div class="border-t border-slate-100 pt-6 dark:border-slate-800">
|
||||
<div class="space-y-2">
|
||||
<button
|
||||
@click="navigateToGeneralChat"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium text-slate-600 transition-all hover:bg-slate-50 hover:text-slate-900"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
:class="workspaceSidebarNavInactive"
|
||||
>
|
||||
<Bot class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.backToChat') }}</span>
|
||||
</button>
|
||||
<button
|
||||
@click="handleLogout"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium text-red-500 transition-all hover:bg-red-50 hover:text-red-600"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium text-red-500 transition-all hover:bg-red-50 hover:text-red-600 dark:text-red-400 dark:hover:bg-red-950/40 dark:hover:text-red-300"
|
||||
>
|
||||
<LogOut class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.logout') }}</span>
|
||||
@@ -1650,7 +1656,7 @@ onMounted(async () => {
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<section class="min-w-0 space-y-6 bg-gray-50 px-4 py-6 md:px-6 md:py-8 lg:px-8" :class="isMobile ? 'pb-20' : ''">
|
||||
<section class="min-w-0 space-y-6 bg-gray-50 px-4 py-6 dark:bg-slate-950 md:px-6 md:py-8 lg:px-8" :class="isMobile ? 'pb-20' : ''">
|
||||
<template v-if="activeSidebarItem === 'history'">
|
||||
<div class="space-y-3">
|
||||
<div v-if="isLoadingHistories" class="flex justify-center py-20">
|
||||
@@ -2002,18 +2008,18 @@ onMounted(async () => {
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-lg md:text-xl font-semibold text-[#1b2b49] dark:text-slate-100 flex items-center gap-2.5 cursor-pointer select-none" @click="toggleSectionCollapse(section)">
|
||||
<div class="p-2 rounded-lg" :class="{
|
||||
'bg-emerald-50 text-emerald-600': section.id === 'announcements',
|
||||
'bg-yellow-50 text-yellow-600': section.id === 'favorites',
|
||||
'bg-brand-50 text-brand-600': section.id === 'quick_questions',
|
||||
'bg-purple-50 text-purple-600': section.id === 'embedded',
|
||||
'bg-slate-100 text-slate-600': section.id === 'all_agents'
|
||||
'bg-emerald-50 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-400': section.id === 'announcements',
|
||||
'bg-yellow-50 text-yellow-600 dark:bg-yellow-500/15 dark:text-yellow-400': section.id === 'favorites',
|
||||
'bg-brand-50 text-brand-600 dark:bg-brand-500/15 dark:text-brand-300': section.id === 'quick_questions',
|
||||
'bg-purple-50 text-purple-600 dark:bg-purple-500/15 dark:text-purple-400': section.id === 'embedded',
|
||||
'bg-slate-100 text-slate-600 dark:bg-slate-700/80 dark:text-slate-300': section.id === 'all_agents'
|
||||
}">
|
||||
<component :is="section.id === 'announcements' ? Megaphone : (section.id === 'favorites' ? Star : (section.id === 'embedded' ? Bot : LayoutGrid))" class="w-5 h-5" />
|
||||
</div>
|
||||
{{ $t(getSectionTitleKey(section.id)) }}
|
||||
<component :is="section.collapsed ? ChevronDown : ChevronUp" class="w-4 h-4 text-slate-400" />
|
||||
</h2>
|
||||
<button v-if="section.id === 'quick_questions' && !isAddingQuestion && !section.collapsed" @click="openAddQuestionForm" class="btn-ghost text-sm text-brand-600 hover:text-brand-700 hover:bg-brand-50">
|
||||
<button v-if="section.id === 'quick_questions' && !isAddingQuestion && !section.collapsed" @click="openAddQuestionForm" class="btn-ghost text-sm text-brand-600 hover:text-brand-700 hover:bg-brand-50 dark:text-brand-300 dark:hover:bg-brand-500/15">
|
||||
<Plus class="w-4 h-4" /> {{ $t('workspace.quickQuestions.add') }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -2030,21 +2036,21 @@ onMounted(async () => {
|
||||
@click="openAnnouncement(ann)"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-3 mb-2">
|
||||
<h4 class="font-bold text-slate-900 line-clamp-2 group-hover:text-emerald-700 transition-colors">{{ ann.title }}</h4>
|
||||
<span class="text-[10px] font-semibold text-emerald-700 bg-emerald-50 px-2 py-0.5 rounded-full whitespace-nowrap">{{ new Date(ann.created_at).toLocaleDateString() }}</span>
|
||||
<h4 class="font-bold text-slate-900 dark:text-slate-100 line-clamp-2 group-hover:text-emerald-700 dark:group-hover:text-emerald-400 transition-colors">{{ ann.title }}</h4>
|
||||
<span class="text-[10px] font-semibold text-emerald-700 bg-emerald-50 dark:text-emerald-300 dark:bg-emerald-500/15 px-2 py-0.5 rounded-full whitespace-nowrap">{{ new Date(ann.created_at).toLocaleDateString() }}</span>
|
||||
</div>
|
||||
<p class="text-sm text-slate-600 line-clamp-3">{{ ann.content }}</p>
|
||||
<p class="text-sm text-slate-600 dark:text-slate-400 line-clamp-3">{{ ann.content }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content: Favorites -->
|
||||
<div v-if="section.id === 'favorites'">
|
||||
<div v-if="favoriteAgents.length === 0" class="text-slate-400 text-sm italic py-4 bg-slate-50 rounded-xl text-center border border-dashed border-slate-200">{{ $t('workspace.noFavorites') }}</div>
|
||||
<div v-if="favoriteAgents.length === 0" class="text-slate-400 text-sm italic py-4 bg-slate-50 rounded-xl text-center border border-dashed border-slate-200 dark:bg-slate-800/50 dark:border-slate-700">{{ $t('workspace.noFavorites') }}</div>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-6">
|
||||
<div v-for="agent in favoriteAgents" :key="agent.id" @click="navigateToChat(agent.id)"
|
||||
class="card p-4 sm:p-5 cursor-pointer relative group/card hover:-translate-y-1 hover:shadow-lg hover:border-brand-200 bg-gradient-to-br from-white to-slate-50/50">
|
||||
<div class="w-8 h-8 sm:w-12 sm:h-12 bg-brand-100 rounded-xl flex items-center justify-center text-brand-600 mb-3 sm:mb-4 shadow-sm group-hover/card:scale-110 transition-transform duration-300">
|
||||
class="card p-4 sm:p-5 cursor-pointer relative group/card hover:-translate-y-1 hover:shadow-lg hover:border-brand-200 dark:hover:border-brand-600 bg-gradient-to-br from-white to-slate-50/50 dark:from-slate-800 dark:to-slate-800/90">
|
||||
<div class="w-8 h-8 sm:w-12 sm:h-12 bg-brand-100 dark:bg-brand-500/15 rounded-xl flex items-center justify-center text-brand-600 dark:text-brand-300 mb-3 sm:mb-4 shadow-sm dark:shadow-none group-hover/card:scale-110 transition-transform duration-300">
|
||||
<img v-if="agent.icon_url" :src="agent.icon_url" class="w-5 h-5 sm:w-7 sm:h-7" />
|
||||
<Bot v-else class="w-5 h-5 sm:w-7 sm:h-7" />
|
||||
</div>
|
||||
@@ -2120,7 +2126,7 @@ onMounted(async () => {
|
||||
<div v-for="agent in embeddedAgents" :key="agent.id" class="border border-slate-200 dark:border-slate-700 rounded-2xl overflow-hidden bg-white dark:bg-slate-900 shadow-sm hover:shadow-md transition-shadow h-[500px] flex flex-col">
|
||||
<div class="bg-slate-50 dark:bg-slate-800 px-4 py-3 text-sm font-bold text-slate-700 dark:text-slate-200 flex justify-between items-center border-b border-slate-100 dark:border-slate-700">
|
||||
<span>{{ agent.name }}</span>
|
||||
<a :href="`/chat/${agent.id}`" target="_blank" class="text-brand-600 hover:text-brand-700 hover:bg-brand-50 p-1.5 rounded-lg transition-colors"><ExternalLink class="w-4 h-4"/></a>
|
||||
<a :href="`/chat/${agent.id}`" target="_blank" class="text-brand-600 hover:text-brand-700 hover:bg-brand-50 dark:text-brand-300 dark:hover:bg-brand-500/15 p-1.5 rounded-lg transition-colors"><ExternalLink class="w-4 h-4"/></a>
|
||||
</div>
|
||||
<iframe v-if="agent.iframe_url" :src="agent.iframe_url" class="w-full flex-1 border-none bg-white dark:bg-slate-900"></iframe>
|
||||
<div v-else class="flex items-center justify-center flex-1 text-slate-400 bg-slate-50/50">{{ $t('workspace.embedded.noUrl') }}</div>
|
||||
@@ -2136,9 +2142,9 @@ onMounted(async () => {
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-6">
|
||||
<div v-for="agent in otherAgents" :key="agent.id"
|
||||
@click="navigateToChat(agent.id)"
|
||||
class="card card-mobile-compact cursor-pointer relative group/card hover:-translate-y-1 hover:border-brand-200">
|
||||
class="card card-mobile-compact cursor-pointer relative group/card hover:-translate-y-1 hover:border-brand-200 dark:hover:border-brand-600">
|
||||
<div class="flex items-start justify-between mb-2 sm:mb-4">
|
||||
<div class="w-8 h-8 sm:w-10 sm:h-10 bg-slate-50 rounded-xl flex items-center justify-center text-slate-500 group-hover/card:bg-brand-50 group-hover/card:text-brand-600 transition-colors">
|
||||
<div class="w-8 h-8 sm:w-10 sm:h-10 bg-slate-50 dark:bg-slate-700/80 rounded-xl flex items-center justify-center text-slate-500 dark:text-slate-300 group-hover/card:bg-brand-50 group-hover/card:text-brand-600 dark:group-hover/card:bg-brand-500/15 dark:group-hover/card:text-brand-300 transition-colors">
|
||||
<img v-if="agent.icon_url" :src="agent.icon_url" class="w-4 h-4 sm:w-6 sm:h-6" />
|
||||
<Bot v-else class="w-4 h-4 sm:w-6 sm:h-6" />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user