mirror of
https://github.com/chaitin/SafeLine.git
synced 2026-02-08 09:43:20 +08:00
feat: docs link
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@ const LINKS = [
|
||||
items: [
|
||||
{
|
||||
label: "技术文档",
|
||||
to: "/docs",
|
||||
to: "https://docs.waf-ce.chaitin.cn/zh/home",
|
||||
},
|
||||
{
|
||||
label: "教学视频",
|
||||
@@ -16,11 +16,11 @@ const LINKS = [
|
||||
},
|
||||
{
|
||||
label: "学习资料",
|
||||
to: "/docs",
|
||||
to: "https://docs.waf-ce.chaitin.cn/zh/home",
|
||||
},
|
||||
{
|
||||
label: "更新日志",
|
||||
to: "/docs/about/changelog",
|
||||
to: "https://docs.waf-ce.chaitin.cn/zh/%E7%89%88%E6%9C%AC%E6%9B%B4%E6%96%B0%E8%AE%B0%E5%BD%95",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -14,8 +14,6 @@ import {
|
||||
ListItemText,
|
||||
Stack,
|
||||
IconButton,
|
||||
MenuItem,
|
||||
Select,
|
||||
} from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import dynamic from "next/dynamic";
|
||||
@@ -27,9 +25,9 @@ import usePopupState, {
|
||||
} from "@/components/Popover/usePopupState";
|
||||
|
||||
const navs = [
|
||||
{ to: "/docs", label: "帮助文档", target: "_blank" },
|
||||
{ to: "/community", label: "开发计划", target: "_self" },
|
||||
{ to: "/version", label: "付费版本", target: "_self" },
|
||||
{ to: "https://docs.waf-ce.chaitin.cn/zh/home", label: "帮助文档", target: "_blank", new: true },
|
||||
{ to: "/community", label: "开发计划", target: "_self", new: false },
|
||||
{ to: "/version", label: "付费版本", target: "_self", new: false },
|
||||
];
|
||||
|
||||
const menus = [
|
||||
@@ -38,11 +36,13 @@ const menus = [
|
||||
to: "https://github.com/chaitin/SafeLine",
|
||||
label: "GitHub",
|
||||
target: "_blank",
|
||||
new: false,
|
||||
},
|
||||
{
|
||||
to: "https://demo.waf-ce.chaitin.cn:9443/dashboard",
|
||||
label: "演示 Demo",
|
||||
target: "_blank",
|
||||
new: false,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -56,17 +56,7 @@ const HoverPopover = dynamic(
|
||||
export default function NavBar() {
|
||||
const [isSticky, setIsSticky] = useState(false);
|
||||
const [open, setOpen] = useState(false);
|
||||
const [langOpen, setLangOpen] = useState(false);
|
||||
|
||||
const handleOpen = () => {
|
||||
setLangOpen(true);
|
||||
};
|
||||
const handleClose = () => {
|
||||
setLangOpen(false);
|
||||
};
|
||||
const handleChange = () => {
|
||||
window.open("https://waf.chaitin.com/");
|
||||
};
|
||||
const popoverState = usePopupState({
|
||||
popupId: "wechat-qrcode-popover",
|
||||
});
|
||||
@@ -87,79 +77,7 @@ export default function NavBar() {
|
||||
window.removeEventListener("scroll", handleScroll);
|
||||
};
|
||||
}, []);
|
||||
const langRender = () => (
|
||||
<Select
|
||||
value={"cn"}
|
||||
label=""
|
||||
onChange={handleChange}
|
||||
size="small"
|
||||
open={langOpen}
|
||||
onMouseEnter={handleOpen}
|
||||
onClose={handleClose}
|
||||
onOpen={handleOpen}
|
||||
MenuProps={{
|
||||
PaperProps: {
|
||||
onMouseLeave: handleClose,
|
||||
},
|
||||
}}
|
||||
renderValue={() => {
|
||||
return (
|
||||
<Stack
|
||||
direction="row"
|
||||
alignItems="center"
|
||||
spacing={1}
|
||||
sx={{ ml: "auto" }}
|
||||
>
|
||||
<Box display={{ xs: "none", md: "flex" }}>
|
||||
<svg
|
||||
className="icon_svg"
|
||||
style={{ width: "16px", height: "16px" }}
|
||||
>
|
||||
<use xlinkHref="#icon-diqiuyangshi1" />
|
||||
</svg>
|
||||
</Box>
|
||||
<Box>中文</Box>
|
||||
</Stack>
|
||||
);
|
||||
}}
|
||||
sx={{
|
||||
border: "none",
|
||||
fontFamily: "GilroyBold",
|
||||
px: "4px",
|
||||
ml: { sx: "auto", md: 1 },
|
||||
"& fieldset": {
|
||||
border: langOpen
|
||||
? "2px solid rgba(15,198,194,0.1)!important"
|
||||
: "none",
|
||||
},
|
||||
"& .MuiSelect-select": { px: "12px" },
|
||||
}}
|
||||
className="lang_select"
|
||||
>
|
||||
<MenuItem
|
||||
value="en"
|
||||
sx={{
|
||||
"&.Mui-selected": {
|
||||
bgcolor: "rgba(15,198,194,0.1)!important",
|
||||
},
|
||||
"&:hover": { bgcolor: "rgba(15,198,194,0.1)" },
|
||||
}}
|
||||
>
|
||||
English
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
value="cn"
|
||||
sx={{
|
||||
"&.Mui-selected": {
|
||||
bgcolor: "rgba(15,198,194,0.1)!important",
|
||||
},
|
||||
"&:hover": { bgcolor: "rgba(15,198,194,0.1)" },
|
||||
}}
|
||||
>
|
||||
简体中文
|
||||
</MenuItem>
|
||||
</Select>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppBar
|
||||
@@ -182,19 +100,19 @@ export default function NavBar() {
|
||||
>
|
||||
<Grid container justifyContent="space-around">
|
||||
<Grid item xs={10} md={6} display="flex">
|
||||
<Box display="flex" alignItems="center" sx={{ width: "100%" }}>
|
||||
<Box display="flex" alignItems="center">
|
||||
<SafelineTitle />
|
||||
{langRender()}
|
||||
<Box display={{ xs: "none", md: "flex" }} alignItems="center">
|
||||
{navs.map((nav, index) => (
|
||||
<Box component="span" key={index} mr={3.5}>
|
||||
<Link
|
||||
key={index}
|
||||
href={nav.to}
|
||||
sx={{ color: "common.black" }}
|
||||
sx={{ color: "common.black",lineHeight: '45px' }}
|
||||
target={nav.target}
|
||||
>
|
||||
{nav.label}
|
||||
{nav.new && <Icon type="icon-new" sx={{ ml: '4px', fontSize: '26px' }} />}
|
||||
</Link>
|
||||
</Box>
|
||||
))}
|
||||
@@ -224,6 +142,21 @@ export default function NavBar() {
|
||||
<Icon type="icon-discord1" sx={{ mr: 1 }} />
|
||||
Discord
|
||||
</Link>
|
||||
<Link
|
||||
href="https://x.com/safeline_waf"
|
||||
target="_blank"
|
||||
sx={{
|
||||
color: "common.black",
|
||||
display: "flex",
|
||||
"&:hover": {
|
||||
color: "primary.main",
|
||||
},
|
||||
}}
|
||||
mr={3.5}
|
||||
>
|
||||
<Icon type="icon-tuite" sx={{ mr: 1, fontSize: '16px' }} />
|
||||
X
|
||||
</Link>
|
||||
<Link
|
||||
href="https://github.com/chaitin/SafeLine"
|
||||
target="_blank"
|
||||
@@ -280,10 +213,7 @@ export default function NavBar() {
|
||||
<Button
|
||||
variant="contained"
|
||||
target="_blank"
|
||||
sx={{
|
||||
width: { xs: "100%", sm: "auto" },
|
||||
textTransform: "none",
|
||||
}}
|
||||
sx={{ width: { xs: "100%", sm: "auto" } }}
|
||||
href="https://demo.waf-ce.chaitin.cn:9443/dashboard"
|
||||
>
|
||||
Demo
|
||||
@@ -362,27 +292,27 @@ export const SafelineTitle: React.FC = () => {
|
||||
flexDirection="row"
|
||||
display="flex"
|
||||
spacing={2}
|
||||
sx={{ marginTop: "0px", flexWrap: "nowrap" }}
|
||||
sx={{ marginTop: "0px", minWidth: "192px" }}
|
||||
>
|
||||
<Box
|
||||
width={{ xs: "30px", md: "24px" }}
|
||||
height={{ xs: "33px", md: "26px" }}
|
||||
width={{ xs: "40px", md: "24px" }}
|
||||
height={{ xs: "43px", md: "26px" }}
|
||||
position="relative"
|
||||
>
|
||||
<Image
|
||||
src="/images/safeline.svg"
|
||||
alt="SafeLine Logo"
|
||||
layout="responsive"
|
||||
width={30}
|
||||
height={33}
|
||||
width={40}
|
||||
height={43}
|
||||
/>
|
||||
</Box>
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{
|
||||
ml: { xs: "4px", md: 1 },
|
||||
mr: { xs: 0, md: 0 },
|
||||
fontSize: { xs: "20px", md: "16px" },
|
||||
ml: { xs: 2, md: 1 },
|
||||
mr: { xs: 0, md: 7 },
|
||||
fontSize: { xs: "24px", md: "16px" },
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
fontFamily: "AlimamaShuHeiTi-Bold",
|
||||
|
||||
@@ -27,7 +27,7 @@ const VERSION_LIST = [
|
||||
my: 4,
|
||||
boxShadow: "0px 15px 25px 0px rgba(15,198,194,0.3)",
|
||||
}}
|
||||
href="/docs/guide/install"
|
||||
href="https://docs.waf-ce.chaitin.cn/zh/%E4%B8%8A%E6%89%8B%E6%8C%87%E5%8D%97/%E5%AE%89%E8%A3%85%E9%9B%B7%E6%B1%A0"
|
||||
>
|
||||
立即安装
|
||||
</Button>
|
||||
|
||||
@@ -6,22 +6,22 @@ import Icon from "@/components/Icon";
|
||||
const ABILITY_LIST = [
|
||||
{
|
||||
title: "人机验证",
|
||||
href: "/docs/about/challenge",
|
||||
href: "https://docs.waf-ce.chaitin.cn/zh/%E4%B8%8A%E6%89%8B%E6%8C%87%E5%8D%97/%E5%BF%AB%E9%80%9F%E9%85%8D%E7%BD%AE",
|
||||
img: "/images/ability/ability_verification.png",
|
||||
},
|
||||
{
|
||||
title: "百川网站监控联动",
|
||||
href: "/docs/practice/monitor",
|
||||
href: "https://docs.waf-ce.chaitin.cn/%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5/%E7%99%BE%E5%B7%9D%E7%BD%91%E7%AB%99%E7%9B%91%E6%B5%8B",
|
||||
img: "/images/ability/ability_rivers.png",
|
||||
},
|
||||
{
|
||||
title: "APISIX 插件集成",
|
||||
href: "/docs/practice/apisix",
|
||||
href: "https://docs.waf-ce.chaitin.cn/zh/%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5/%E8%81%94%E5%8A%A8APISIX",
|
||||
img: "/images/ability/ability_apisix.svg",
|
||||
},
|
||||
{
|
||||
title: "长亭社区恶意 IP 情报",
|
||||
href: "/docs/practice/IpIntelligence",
|
||||
href: "https://docs.waf-ce.chaitin.cn/",
|
||||
img: "/images/ability/ability_maliciousip.svg",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ const FEATURE_LIST = [
|
||||
mb: { xs: 2, sm: 0 },
|
||||
fontSize: { xs: "24px", sm: "14px" },
|
||||
}}
|
||||
href="/docs/about/syntaxanalysis"
|
||||
href="https://docs.waf-ce.chaitin.cn/"
|
||||
>
|
||||
了解详情
|
||||
</Button>
|
||||
|
||||
@@ -217,7 +217,7 @@ export default function Home({ total, starCount }: { total: number, starCount: n
|
||||
fontSize: { xs: "32px", sm: "20px" },
|
||||
boxShadow: "0px 15px 25px 0px rgba(15,198,194,0.3)",
|
||||
}}
|
||||
href="/docs/guide/install"
|
||||
href="https://docs.waf-ce.chaitin.cn/zh/%E4%B8%8A%E6%89%8B%E6%8C%87%E5%8D%97/%E5%AE%89%E8%A3%85%E9%9B%B7%E6%B1%A0"
|
||||
>
|
||||
立即安装
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user