feat: import Sea vHost single-server testing release

This commit is contained in:
canglan committed 2026-10-30 08:39:10 +08:00
commit 248badd33e
441 files changed
+63221

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
import { Building2, ChevronDown, Menu, UserRound,LogOut } from 'lucide-react';
import { useState, type ReactNode } from 'react';
import { Brand } from './Brand';
import { Sidebar } from './Sidebar';
import {useNavigationOverlay} from './overlay';
export function AppShell({ page, tenantName, displayName, hostScoped = false, onNavigate, onSecurity,onLogout, children }: { page: string; tenantName: string; displayName: string; hostScoped?: boolean; onNavigate: (page: string) => void; onSecurity: () => void;onLogout?:()=>void; children: ReactNode }) {
const [mobileNavOpen, setMobileNavOpen] = useState(false);
useNavigationOverlay(mobileNavOpen,setMobileNavOpen);
function navigate(pageName: string) {
onNavigate(pageName);
setMobileNavOpen(false);
}
return (
<div className="app-shell">
<header className="topbar">
<button className="mobile-menu" aria-label={mobileNavOpen ? '关闭导航' : '打开导航'} aria-expanded={mobileNavOpen} onClick={() => setMobileNavOpen((value) => !value)}><Menu size={21} /></button>
<Brand />
<div className="tenant-switch"><Building2 size={17} /><span>{tenantName}</span></div>
<div className="top-actions">
{onLogout?<button className="icon-button" aria-label="退出登录" onClick={onLogout}><LogOut size={18}/></button>:null}
<button className="user-menu" onClick={onSecurity} aria-label="账号安全"><span className="avatar"><UserRound size={17} /></span><span>{displayName}</span><ChevronDown size={15} /></button>
</div>
</header>
{mobileNavOpen ? <button className="mobile-nav-backdrop" aria-label="关闭导航" onClick={() => setMobileNavOpen(false)} /> : null}
<div className={mobileNavOpen ? 'mobile-sidebar open' : 'mobile-sidebar'}><Sidebar page={page} hostScoped={hostScoped} onNavigate={navigate} /></div>
<main className="main-content">{children}</main>
</div>
);
}