Skip to content

Commit 2a77fcc

Browse files
committed
refactor(webui): drop redundant logout button next to settings
The 'Exit WebUI' action is already available inside the settings dialog — having a second one in the sidebar footer is duplicate UI.
1 parent ff3264a commit 2a77fcc

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

src/webui/FE/App.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,6 @@ function App() {
281281
collapsed={sidebarCollapsed}
282282
onToggleCollapse={() => setSidebarCollapsed(!sidebarCollapsed)}
283283
onOpenSettings={() => setShowSettingsDialog(true)}
284-
onLogout={() => {
285-
deleteCookie('webui_token')
286-
window.location.reload()
287-
}}
288284
/>
289285

290286
<main className={`flex-1 overflow-auto z-10 transition-all duration-300 ${sidebarCollapsed ? '' : 'md:ml-64'}`}>

src/webui/FE/components/layout/Sidebar.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ChevronLeft,
1313
ChevronRight,
1414
Settings,
15-
LogOut,
1615
} from 'lucide-react'
1716

1817
interface SidebarProps {
@@ -27,19 +26,17 @@ interface SidebarProps {
2726
collapsed?: boolean;
2827
onToggleCollapse?: () => void;
2928
onOpenSettings?: () => void;
30-
onLogout?: () => void;
3129
}
3230

33-
const Sidebar: React.FC<SidebarProps> = ({
34-
activeTab,
35-
onTabChange,
36-
accountInfo,
37-
isOpen = true,
31+
const Sidebar: React.FC<SidebarProps> = ({
32+
activeTab,
33+
onTabChange,
34+
accountInfo,
35+
isOpen = true,
3836
onClose,
3937
collapsed = false,
4038
onToggleCollapse,
4139
onOpenSettings,
42-
onLogout,
4340
}) => {
4441
const menuItems = [
4542
{ id: 'dashboard', icon: LayoutDashboard, label: 'Dashboard' },
@@ -168,13 +165,6 @@ const Sidebar: React.FC<SidebarProps> = ({
168165
>
169166
<Settings size={18} />
170167
</button>
171-
<button
172-
onClick={onLogout}
173-
className="p-2 rounded-lg transition-all duration-200 text-theme-muted hover:bg-red-100 hover:text-red-500 dark:hover:bg-red-900/30"
174-
title="退出 WebUI(不会退出QQ)"
175-
>
176-
<LogOut size={18} />
177-
</button>
178168
</div>
179169
</div>
180170
</div>

0 commit comments

Comments
 (0)