mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 02:06:37 +08:00
perf
This commit is contained in:
@@ -220,64 +220,6 @@ export function WebsiteDetailPageClient() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
|
||||||
<Card className="shadow-none">
|
|
||||||
<CardHeader className="pb-2">
|
|
||||||
<CardTitle className="text-sm">匹配类型</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="space-y-2">
|
|
||||||
<WebsiteStatusBadge label={matchType.label} tone={matchType.tone} />
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
{website.domain.startsWith('*.')
|
|
||||||
? '当前网站会覆盖该后缀下的子域名规则。'
|
|
||||||
: '当前网站只匹配同名精确域名。'}
|
|
||||||
</p>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<Card className="shadow-none">
|
|
||||||
<CardHeader className="pb-2">
|
|
||||||
<CardTitle className="text-sm">网站状态</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="space-y-2">
|
|
||||||
<WebsiteStatusBadge
|
|
||||||
label={website.enabled ? '启用' : '停用'}
|
|
||||||
tone={website.enabled ? 'success' : 'warning'}
|
|
||||||
/>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
更新时间:{formatDateTime(website.updated_at)}
|
|
||||||
</p>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<Card className="shadow-none">
|
|
||||||
<CardHeader className="pb-2">
|
|
||||||
<CardTitle className="text-sm">关联规则</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="space-y-1 text-xs text-muted-foreground">
|
|
||||||
<p>规则总数:{relatedRoutes.length}</p>
|
|
||||||
<p>已启用规则:{enabledRoutesCount}</p>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<Card className="shadow-none">
|
|
||||||
<CardHeader className="pb-2">
|
|
||||||
<CardTitle className="text-sm">绑定证书</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="space-y-2">
|
|
||||||
<WebsiteStatusBadge
|
|
||||||
label={certificate ? certificate.name : '未绑定证书'}
|
|
||||||
tone={certificate ? 'success' : 'warning'}
|
|
||||||
/>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
{certificateStatus
|
|
||||||
? `证书状态:${certificateStatus.label}`
|
|
||||||
: '当前网站未设置默认证书。'}
|
|
||||||
</p>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="grid gap-4 xl:grid-cols-2">
|
<div className="grid gap-4 xl:grid-cols-2">
|
||||||
<Card className="shadow-none">
|
<Card className="shadow-none">
|
||||||
<CardHeader className="pb-2">
|
<CardHeader className="pb-2">
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ import {
|
|||||||
AlertDialogTitle,
|
AlertDialogTitle,
|
||||||
} from "@/components/ui/alert-dialog"
|
} from "@/components/ui/alert-dialog"
|
||||||
import {
|
import {
|
||||||
ArrowUpRight,
|
|
||||||
Bell,
|
Bell,
|
||||||
ChevronDown,
|
ChevronDown,
|
||||||
Code,
|
Code,
|
||||||
@@ -164,13 +163,9 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|||||||
|
|
||||||
const adminFiltered = React.useMemo(() => {
|
const adminFiltered = React.useMemo(() => {
|
||||||
const displayConfig = parseMenuDisplayConfig(config?.menu_display_config)
|
const displayConfig = parseMenuDisplayConfig(config?.menu_display_config)
|
||||||
return data.admin.filter((item) => displayConfig[item.url] !== false)
|
return data.admin.filter((item) => displayConfig[item.url])
|
||||||
}, [config])
|
}, [config])
|
||||||
|
|
||||||
const documentFiltered = React.useMemo(() => {
|
|
||||||
const displayConfig = parseMenuDisplayConfig(config?.menu_display_config)
|
|
||||||
return data.document.filter((item) => displayConfig[item.url] !== false)
|
|
||||||
}, [config])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -329,40 +324,6 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|||||||
</SidebarGroup>
|
</SidebarGroup>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{documentFiltered.length > 0 && (
|
|
||||||
<SidebarGroup className="py-0 pt-4">
|
|
||||||
<SidebarGroupLabel className="text-xs font-normal text-muted-foreground">
|
|
||||||
文档库
|
|
||||||
</SidebarGroupLabel>
|
|
||||||
<SidebarGroupContent className="py-1">
|
|
||||||
<SidebarMenu className="gap-1">
|
|
||||||
{documentFiltered.map((item) => (
|
|
||||||
<SidebarMenuItem key={item.title}>
|
|
||||||
<SidebarMenuButton
|
|
||||||
tooltip={item.title}
|
|
||||||
isActive={pathname === item.url}
|
|
||||||
asChild
|
|
||||||
>
|
|
||||||
{item.external ? (
|
|
||||||
<Link href={item.url} target="_blank" rel="noopener noreferrer" onClick={handleCloseSidebar}>
|
|
||||||
{item.icon && <item.icon />}
|
|
||||||
<span className="flex-1">{item.title}</span>
|
|
||||||
<ArrowUpRight className="size-3 text-muted-foreground" />
|
|
||||||
</Link>
|
|
||||||
) : (
|
|
||||||
<Link href={item.url} onClick={handleCloseSidebar}>
|
|
||||||
{item.icon && <item.icon />}
|
|
||||||
<span className="flex-1">{item.title}</span>
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
</SidebarMenuButton>
|
|
||||||
</SidebarMenuItem>
|
|
||||||
))}
|
|
||||||
</SidebarMenu>
|
|
||||||
</SidebarGroupContent>
|
|
||||||
</SidebarGroup>
|
|
||||||
)}
|
|
||||||
|
|
||||||
</SidebarContent>
|
</SidebarContent>
|
||||||
<SidebarFooter className="mt-auto px-3 py-3 group-data-[collapsible=icon]:hidden">
|
<SidebarFooter className="mt-auto px-3 py-3 group-data-[collapsible=icon]:hidden">
|
||||||
<div className="border-t border-border/60 pt-3 text-[11px] leading-5 text-muted-foreground">
|
<div className="border-t border-border/60 pt-3 text-[11px] leading-5 text-muted-foreground">
|
||||||
|
|||||||
Reference in New Issue
Block a user