Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions src/webui/FE/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
AnimatedBackground,
HostSelector,
} from './components';
import { WebQQPage } from './components/WebQQ';
import { WebQQPage, WebQQFullscreen } from './components/WebQQ';
import { Config, ResConfig } from './types';
import { apiFetch, setPasswordPromptHandler } from './utils/api';
import { Save, Loader2, Settings, Eye, EyeOff, Plus, Trash2, Menu } from 'lucide-react';
Expand All @@ -25,13 +25,13 @@ function App() {
// 从 URL hash 读取初始 tab,默认 dashboard
const getInitialTab = () => {
const hash = window.location.hash.slice(1) // 去掉 #
const validTabs = ['dashboard', 'onebot', 'satori', 'milky', 'logs', 'other', 'webqq', 'about']
const validTabs = ['dashboard', 'onebot', 'satori', 'milky', 'logs', 'other', 'webqq', 'webqq-fullscreen', 'about']
return validTabs.includes(hash) ? hash : 'dashboard'
}

const [activeTab, setActiveTab] = useState(getInitialTab);
const [config, setConfig] = useState<Config>(defaultConfig);

const [loading, setLoading] = useState(false);
const [isLoggedIn, setIsLoggedIn] = useState(false);
const [checkingLogin, setCheckingLogin] = useState(true);
Expand Down Expand Up @@ -66,7 +66,7 @@ function App() {
useEffect(() => {
const handleHashChange = () => {
const hash = window.location.hash.slice(1)
const validTabs = ['dashboard', 'onebot', 'satori', 'milky', 'logs', 'other', 'webqq', 'about']
const validTabs = ['dashboard', 'onebot', 'satori', 'milky', 'logs', 'other', 'webqq', 'webqq-fullscreen', 'about']
if (validTabs.includes(hash)) {
setActiveTab(hash)
}
Expand Down Expand Up @@ -194,15 +194,37 @@ function App() {
);
}

// webqq-fullscreen 路由:独立的全屏页面
if (activeTab === 'webqq-fullscreen') {
return (
<>
{/* Animated Background */}
<AnimatedBackground />

<WebQQFullscreen />

{/* Password Dialog */}
<TokenDialog
visible={showPasswordDialog}
onConfirm={handlePasswordConfirm}
error={passwordError}
/>

{/* Toast Container */}
<ToastContainer />
</>
)
}

// 已登录,显示主页面
return (
<div className="flex min-h-screen">
{/* Animated Background */}
<AnimatedBackground />

<Sidebar
activeTab={activeTab}
onTabChange={setActiveTab}
<Sidebar
activeTab={activeTab}
onTabChange={setActiveTab}
accountInfo={accountInfo || undefined}
isOpen={sidebarOpen}
onClose={() => setSidebarOpen(false)}
Expand All @@ -211,7 +233,7 @@ function App() {
<main className="flex-1 overflow-auto z-10">
{/* 移动端顶部导航栏 */}
<div className="md:hidden sticky top-0 z-30 bg-theme-card/95 backdrop-blur-xl border-b border-theme-divider px-4 py-3 flex items-center gap-3">
<button
<button
onClick={() => setSidebarOpen(true)}
className="p-2 text-theme-muted hover:text-theme hover:bg-theme-item rounded-lg transition-colors"
>
Expand All @@ -222,7 +244,7 @@ function App() {
<span className="font-semibold text-theme">LLBot</span>
</div>
</div>

<div className="p-4 md:p-8 max-w-6xl mx-auto">
{/* Header - 桌面端显示 */}
<div className="mb-8 hidden md:block">
Expand Down
16 changes: 16 additions & 0 deletions src/webui/FE/components/WebQQ/WebQQFullscreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'
import WebQQPage from './WebQQPage'

/**
* WebQQ 全屏版本
* 用于 #webqq-fullscreen 路由
*/
const WebQQFullscreen: React.FC = () => {
return (
<div className="h-screen bg-theme p-4 md:p-8">
<WebQQPage />
</div>
)
}

export default WebQQFullscreen
1 change: 1 addition & 0 deletions src/webui/FE/components/WebQQ/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Main page
export { default as WebQQPage } from './WebQQPage'
export { default as WebQQFullscreen } from './WebQQFullscreen'

// Chat components
export { ChatInput, RichInput, MuteDialog, KickConfirmDialog, TitleDialog } from './chat'
Expand Down