mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-28 05:46:36 +08:00
feat(wavelet): 侧栏新增安全性折叠组收纳 WAF 与 IP 组
移除 WAF / IP 组页面右上角交叉导航,改由侧栏统一入口。
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query';
|
||||
import {ArrowLeft, Loader2, Network, Plus, RefreshCw} from 'lucide-react';
|
||||
import {Loader2, Network, Plus, RefreshCw} from 'lucide-react';
|
||||
import {useState} from 'react';
|
||||
import {toast} from 'sonner';
|
||||
|
||||
@@ -157,12 +156,6 @@ export default function WafIPGroupsPage() {
|
||||
<h1 className="text-2xl font-semibold tracking-tight">IP 组</h1>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" size="sm" className="h-7 text-xs" asChild>
|
||||
<Link href="/waf">
|
||||
<ArrowLeft className="size-3.5 mr-1" />
|
||||
返回 WAF
|
||||
</Link>
|
||||
</Button>
|
||||
<Button variant="secondary" size="sm" className="h-7 text-xs" onClick={handleCreate}>
|
||||
<Plus className="size-3.5 mr-1" />
|
||||
新建 IP 组
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query';
|
||||
import {Loader2, Network, Plus, RefreshCw, Shield} from 'lucide-react';
|
||||
import {Loader2, Plus, RefreshCw, Shield} from 'lucide-react';
|
||||
import {useState} from 'react';
|
||||
import {toast} from 'sonner';
|
||||
|
||||
@@ -139,12 +138,6 @@ export default function WafPage() {
|
||||
<h1 className="text-2xl font-semibold tracking-tight">WAF</h1>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" size="sm" className="h-7 text-xs" asChild>
|
||||
<Link href="/waf/ip-groups">
|
||||
<Network className="size-3.5 mr-1" />
|
||||
IP 组
|
||||
</Link>
|
||||
</Button>
|
||||
<Button variant="secondary" size="sm" className="h-7 text-xs" onClick={handleCreate}>
|
||||
<Plus className="size-3.5 mr-1" />
|
||||
新建规则组
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
Route,
|
||||
ScrollText,
|
||||
Server,
|
||||
Shield,
|
||||
ShieldCheck,
|
||||
} from 'lucide-react';
|
||||
|
||||
export interface OpenFlareNavItem {
|
||||
@@ -35,6 +35,16 @@ export type OpenFlareSidebarNavEntry =
|
||||
| ({kind: 'item'} & OpenFlareNavItem)
|
||||
| ({kind: 'group'} & OpenFlareNavGroup);
|
||||
|
||||
/** 安全性折叠组 */
|
||||
export const openflareSecurityNavGroup: OpenFlareNavGroup = {
|
||||
title: '安全性',
|
||||
icon: ShieldCheck,
|
||||
items: [
|
||||
{title: 'WAF', url: '/waf'},
|
||||
{title: 'IP 组', url: '/waf/ip-groups'},
|
||||
],
|
||||
};
|
||||
|
||||
/** 网站管理折叠组 */
|
||||
export const openflareWebsiteNavGroup: OpenFlareNavGroup = {
|
||||
title: '网站管理',
|
||||
@@ -55,8 +65,8 @@ export const openflareSidebarNav: OpenFlareSidebarNavEntry[] = [
|
||||
{kind: 'item', title: '数据看板', url: '/', icon: LayoutDashboard},
|
||||
{kind: 'item', title: '节点管理', url: '/nodes', icon: Server, childUrls: ['/nodes/detail']},
|
||||
{kind: 'item', title: '规则管理', url: '/proxy-routes', icon: Route, childUrls: ['/proxy-routes/detail']},
|
||||
{kind: 'item', title: 'WAF', url: '/waf', icon: Shield, childUrls: ['/waf/ip-groups']},
|
||||
{kind: 'group', ...openflareWebsiteNavGroup},
|
||||
{kind: 'group', ...openflareSecurityNavGroup},
|
||||
{kind: 'item', title: 'Pages', url: '/pages', icon: FileText, childUrls: ['/pages/detail']},
|
||||
{kind: 'item', title: '版本发布', url: '/config-versions', icon: GitBranch},
|
||||
{kind: 'item', title: '访问日志', url: '/access-logs', icon: ScrollText},
|
||||
@@ -112,4 +122,4 @@ export function isOpenFlareConsoleRoute(pathname: string): boolean {
|
||||
|
||||
return matchesNavPath(pathname, entry.url, entry.childUrls);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ sidebar: false
|
||||
- 侧栏新增「网站管理」折叠组(shadcn Collapsible + SidebarMenuSub),收纳网站、证书、DNS、源站入口。
|
||||
- 移除网站、证书、DNS 页面右上角互相跳转按钮,改由侧栏折叠组统一导航。
|
||||
- 侧栏导航改为 `openflareSidebarNav` 单一配置源,折叠组位置由数组顺序决定,移除 `slice(0, 4)` 硬编码切分。
|
||||
- 侧栏新增「安全性」折叠组,收纳 WAF 与 IP 组入口;同步移除两页右上角互相跳转按钮。
|
||||
- OpenFlare 前端路由去除 `/openflare` 前缀,业务页面直接挂载于 `/`(如 `/nodes`、`/websites`);侧栏移除「首页」「我的文件」;旧路径 `/openflare/*`、`/home` 永久重定向至新路径。
|
||||
|
||||
## [v2.3.4] - 2026-06-17
|
||||
|
||||
Reference in New Issue
Block a user