+
长亭雷池 WAF 社区版
@@ -21,6 +21,6 @@ export default function MyApp({ Component, pageProps }: any) {
-
+
)
}
\ No newline at end of file
diff --git a/waf/src/pages/community/index.tsx b/website/src/pages/community/index.tsx
similarity index 87%
rename from waf/src/pages/community/index.tsx
rename to website/src/pages/community/index.tsx
index 7ad5b75..3d126a8 100644
--- a/waf/src/pages/community/index.tsx
+++ b/website/src/pages/community/index.tsx
@@ -1,8 +1,9 @@
import React from "react";
import { Box, Grid, Button, Typography, Container, Stack } from "@mui/material";
-import Image from 'next/image'
-import DiscussionList from '@/components/community/DiscussionList'
-import IssueList from '@/components/community/IssueList'
+import Image from 'next/image';
+import Head from 'next/head';
+import DiscussionList from '@/components/community/DiscussionList';
+import IssueList from '@/components/community/IssueList';
import { getDiscussions, getIssues } from "@/api";
type CommunityPropsType = {
@@ -13,13 +14,9 @@ type CommunityPropsType = {
export async function getServerSideProps() {
let discussions = []
let issues = []
- let isClient = true
- if (typeof window === 'undefined') {
- isClient = false
- }
try {
- discussions = await getDiscussions('', isClient);
- issues = await getIssues('', isClient);
+ discussions = await getDiscussions('');
+ issues = await getIssues('');
} finally {
return {
@@ -33,7 +30,12 @@ export async function getServerSideProps() {
function Community({ discussions, issues }: CommunityPropsType) {
return (
-
+
+
+ 社区 | 长亭雷池 WAF 社区版
+
+
+
([]);
- const [result, setResult] = useState([]);
-
- useEffect(() => {
- // useRouter 中获取 参数会有延迟,所以先判断有没有 id 参数
- const realSetId =
- new URLSearchParams(location.search).get("id") || "default";
- // const setId = (router.query.id as string) || "default";
- const setId = "default";
- if (setId !== realSetId) return;
-
- // 查询样本集合
- getSampleSet(setId).then((res) => {
- if (res.code != 0) {
- Message.error("测试集合 " + setId + ": " + res.msg);
- return;
- }
- if (!res.data.data) {
- Message.error("测试集合 " + setId + ": 获取结果为空");
- return;
- }
- setSamples(
- res.data.data?.map((i: any) => ({
- id: i.id,
- summary: i.summary,
- size: i.length,
- isAttack: i.tag == "black",
- }))
- );
- });
-
- // 查询样本集合结果
- getSampleSetResult(setId).then(({ data, timeout }) => {
- if (timeout) {
- Message.error("获取检测集结果超时");
- return;
- }
- setResult(
- data.map((i: any) => ({
- engine: i.engine,
- version: i.version,
- detectionRate: percent(i.recall),
- failedRate: percent(i.fdr),
- accuracy: percent(i.accuracy),
- cost: i.elapsed > 0 ? i.elapsed + " 毫秒" : "小于 1 毫秒",
- }))
- );
- });
- }, []);
-
- const handleSetId = (id: string) => {
- // router.push({
- // pathname: router.pathname,
- // query: { id },
- // });
- };
-
- return (
-
-
-
-
-
-
-
- TP: 正确识别到攻击样本的数量
-
- 检出率 = TP / (TP + FN)
-
-
- TN: 正确识别到普通样本的数量
-
- 误报率 = FP / (TP + FP)
-
-
- FP: 将普通样本误报为攻击的数量
-
- 准确率 = (TP + TN) / (TP + TN + FP + FN)
-
-
- FN: 未识别到攻击样本的数量
-
-
-
-
-
- );
-}
-
-function percent(v: number) {
- return Math.round(v * 10000) / 100 + "%";
-}
diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx
index 45fcc91..df782e8 100644
--- a/website/src/pages/index.tsx
+++ b/website/src/pages/index.tsx
@@ -1,48 +1,34 @@
import React, { useEffect, useRef } from "react";
-import { Carousel } from "react-responsive-carousel";
-import Features from "@site/src/components/Features";
-import { Box, Grid, Button, Typography, Container, Stack } from "@mui/material";
-import Layout from "@theme/Layout";
-import Title from "@site/src/components/Title";
-import Version from "@site/src/components/Version";
-import { getSetupCount } from "@site/src/api";
-import "react-responsive-carousel/lib/styles/carousel.min.css";
-import ThemeProvider from "@site/src/components/Theme";
-import Head from "@docusaurus/Head";
+import Head from 'next/head';
+import { getSetupCount } from "@/api";
+import Features from "@/components/home/Features";
+import Abilities from "@/components/home/Abilities";
+import Partner from "@/components/home/Partner";
+import { Box, Grid, Button, Link, Typography, Container, Stack } from "@mui/material";
+import Image from 'next/image';
-const IMAGE_LIST = [
- {
- name: "可视化仪表盘",
- url: "/images/album/0.png",
- },
- {
- name: "登录页",
- url: "/images/album/5.png",
- },
- {
- name: "攻击检测列表",
- url: "/images/album/1.png",
- },
- {
- name: "攻击检测详情",
- url: "/images/album/2.png",
- },
- {
- name: "防护站点列表",
- url: "/images/album/3.png",
- },
- {
- name: "自定义规则列表",
- url: "/images/album/3.png",
- },
- {
- name: "攻击阻断页面",
- url: "/images/album/block.png",
- },
-];
+const ARTICLES = [
+ '《阮一峰·科技爱好者周刊》',
+ '《Hello Github 月刊》',
+ '《码农出击》',
+ '《GitHub Daily》',
+ '《Open Github 社区》',
+ '《科技 lion》',
+]
-export default function Home(): JSX.Element {
+const totalSx = {
+ color: "primary.main",
+ fontSize: { xs: "58px", md: "70px" },
+ background: 'linear-gradient(90deg, #8FE5D7 0%, #0FC6C2 100%)',
+ '-webkit-background-clip': 'text',
+ '-webkit-text-fill-color': 'transparent',
+ lineHeight: 1.25,
+ fontFamily: "AlimamaShuHeiTi-Bold",
+}
+const textAligns = ['left', 'center', 'right'];
+
+export default function Home() {
const totalRef = useRef(null);
const initTotal = async (n: number) => {
@@ -60,224 +46,195 @@ export default function Home(): JSX.Element {
});
return (
-
+
+ 长亭雷池 WAF 社区版
+
-
+
+
-
-
-
-
-
-
-
-
- 雷池 Web 应用防火墙
-
-
-
-
- 耗时近 10 年,长亭科技倾情打造,核心检测能力由
-
- 智能语义分析算法
-
- 驱动,专为社区而生,不让黑客越雷池半步。
-
-
-
-
-
- }
- >
- GitHub
-
-
- }
- >
- 讨论组
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
-
-
-
- -
-
-
-
-
-
-
-
-
- {IMAGE_LIST.map((item) => (
-
+
+
+
+
+ -
+
+
+ 装机量
+
+
+
+
+
+
+
+
+ 5.9k
+
+
+ GitHub Star
+
+
+
+
+
+
+
+
+
+
+
+
+ {ARTICLES.map((article, index) => (
+
+
-
-
-
- {item.name}
-
-
-
- ))}
-
+ {article}
+
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ 欢迎使用雷池其他版本
+
+
+
+
+
-
-
- );
+
+
+ )
}
diff --git a/website/src/pages/version/index.tsx b/website/src/pages/version/index.tsx
new file mode 100644
index 0000000..d269598
--- /dev/null
+++ b/website/src/pages/version/index.tsx
@@ -0,0 +1,41 @@
+import React from "react";
+import Head from 'next/head';
+import { Box, Container, Stack, Typography } from "@mui/material";
+import Version from "@/components/Version";
+
+export default function VersionView() {
+
+ return (
+
+
+ 版本对比 | 长亭雷池 WAF 社区版
+
+
+
+
+
+
+
+ 大小网站皆宜,免费即可开始
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/website/static/fonts/iconfont.js b/website/static/fonts/iconfont.js
deleted file mode 100644
index feb36b4..0000000
--- a/website/static/fonts/iconfont.js
+++ /dev/null
@@ -1 +0,0 @@
-window._iconfont_svg_string_4031246='',function(n){var t=(t=document.getElementsByTagName("script"))[t.length-1],e=t.getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var o,a,i,c,d,s=function(t,e){e.parentNode.insertBefore(t,e)};if(e&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}o=function(){var t,e=document.createElement("div");e.innerHTML=n._iconfont_svg_string_4031246,(e=e.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",e=e,(t=document.body).firstChild?s(e,t.firstChild):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(o,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),o()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(i=o,c=n.document,d=!1,r(),c.onreadystatechange=function(){"complete"==c.readyState&&(c.onreadystatechange=null,l())})}function l(){d||(d=!0,i())}function r(){try{c.documentElement.doScroll("left")}catch(t){return void setTimeout(r,50)}l()}}(window);
\ No newline at end of file
diff --git a/website/static/images/class.png b/website/static/images/class.png
deleted file mode 100644
index 3a6191d..0000000
Binary files a/website/static/images/class.png and /dev/null differ
diff --git a/website/static/images/docs/Untitled10.png b/website/static/images/docs/Untitled10.png
deleted file mode 100644
index e52f85f..0000000
Binary files a/website/static/images/docs/Untitled10.png and /dev/null differ
diff --git a/website/static/images/docs/Untitled11.png b/website/static/images/docs/Untitled11.png
deleted file mode 100644
index ed68f33..0000000
Binary files a/website/static/images/docs/Untitled11.png and /dev/null differ
diff --git a/website/static/images/docs/Untitled12.png b/website/static/images/docs/Untitled12.png
deleted file mode 100644
index 995e452..0000000
Binary files a/website/static/images/docs/Untitled12.png and /dev/null differ
diff --git a/website/static/images/docs/Untitled13.png b/website/static/images/docs/Untitled13.png
deleted file mode 100644
index c61b6a7..0000000
Binary files a/website/static/images/docs/Untitled13.png and /dev/null differ
diff --git a/website/static/images/docs/flow.png b/website/static/images/docs/flow.png
deleted file mode 100644
index 0429f24..0000000
Binary files a/website/static/images/docs/flow.png and /dev/null differ
diff --git a/website/static/images/docs/guide_config/deploy_on_separate_server.png b/website/static/images/docs/guide_config/deploy_on_separate_server.png
deleted file mode 100644
index bd789df..0000000
Binary files a/website/static/images/docs/guide_config/deploy_on_separate_server.png and /dev/null differ
diff --git a/website/static/images/docs/guide_config/deploy_on_web_server.png b/website/static/images/docs/guide_config/deploy_on_web_server.png
deleted file mode 100644
index c16305e..0000000
Binary files a/website/static/images/docs/guide_config/deploy_on_web_server.png and /dev/null differ
diff --git a/website/static/images/docs/guide_config/deploy_origin.png b/website/static/images/docs/guide_config/deploy_origin.png
deleted file mode 100644
index 0305402..0000000
Binary files a/website/static/images/docs/guide_config/deploy_origin.png and /dev/null differ
diff --git a/website/static/images/docs/guide_config/deploy_with_other_server.png b/website/static/images/docs/guide_config/deploy_with_other_server.png
deleted file mode 100644
index 18c9869..0000000
Binary files a/website/static/images/docs/guide_config/deploy_with_other_server.png and /dev/null differ
diff --git a/website/static/images/docs/guide_introduction/website_with_safeline.png b/website/static/images/docs/guide_introduction/website_with_safeline.png
deleted file mode 100644
index da7eb20..0000000
Binary files a/website/static/images/docs/guide_introduction/website_with_safeline.png and /dev/null differ
diff --git a/website/static/images/docs/guide_introduction/website_without_safeline.png b/website/static/images/docs/guide_introduction/website_without_safeline.png
deleted file mode 100644
index 1231bbc..0000000
Binary files a/website/static/images/docs/guide_introduction/website_without_safeline.png and /dev/null differ
diff --git a/website/static/images/favicon.ico b/website/static/images/favicon.ico
deleted file mode 100644
index bcba385..0000000
Binary files a/website/static/images/favicon.ico and /dev/null differ
diff --git a/website/static/images/feature.svg b/website/static/images/feature.svg
deleted file mode 100644
index 16ec807..0000000
--- a/website/static/images/feature.svg
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
\ No newline at end of file
diff --git a/website/static/images/github.png b/website/static/images/github.png
deleted file mode 100755
index 9490ffc..0000000
Binary files a/website/static/images/github.png and /dev/null differ
diff --git a/website/static/images/logo.png b/website/static/images/logo.png
deleted file mode 100755
index 1ef614b..0000000
Binary files a/website/static/images/logo.png and /dev/null differ
diff --git a/website/static/images/logo.svg b/website/static/images/logo.svg
deleted file mode 100644
index 2253368..0000000
--- a/website/static/images/logo.svg
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
\ No newline at end of file
diff --git a/website/static/images/safeline.png b/website/static/images/safeline.png
deleted file mode 100755
index 3a3485d..0000000
Binary files a/website/static/images/safeline.png and /dev/null differ
diff --git a/website/static/images/wechat-logo.png b/website/static/images/wechat-logo.png
deleted file mode 100644
index 07cb558..0000000
Binary files a/website/static/images/wechat-logo.png and /dev/null differ
diff --git a/waf/styles/globals.css b/website/styles/globals.css
similarity index 100%
rename from waf/styles/globals.css
rename to website/styles/globals.css
diff --git a/waf/tailwind.config.ts b/website/tailwind.config.ts
similarity index 100%
rename from waf/tailwind.config.ts
rename to website/tailwind.config.ts
diff --git a/website/tsconfig.json b/website/tsconfig.json
index 6f47569..e59724b 100644
--- a/website/tsconfig.json
+++ b/website/tsconfig.json
@@ -1,7 +1,27 @@
{
- // This file is not used in compilation. It is here just for a nice editor experience.
- "extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
- "baseUrl": "."
- }
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ],
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
+ "exclude": ["node_modules"]
}
diff --git a/waf/yarn.lock b/website/yarn.lock
similarity index 100%
rename from waf/yarn.lock
rename to website/yarn.lock