Jelajahi Sumber

fix: error link address in homepage

delong.wang 1 tahun lalu
induk
melakukan
b79cce3876
3 mengubah file dengan 27 tambahan dan 19 penghapusan
  1. 1 5
      Dockerfile
  2. 0 1
      backend/go.sum
  3. 26 13
      website/src/components/home/Abilities.tsx

+ 1 - 5
Dockerfile

@@ -1,12 +1,8 @@
 FROM golang:1.21 as go-builder
 
-ARG goproxy
-ARG goprivate
-
 WORKDIR /work
 COPY backend .
-RUN go env -w GOPROXY=$goproxy
-RUN go env -w GOPRIVATE=$goprivate
+ENV GOPROXY=https://goproxy.cn,direct
 RUN go mod tidy
 RUN CGO_ENABLED=0 go build -a -v -ldflags="-w" -o server .
 

+ 0 - 1
backend/go.sum

@@ -153,7 +153,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
 github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
 github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
 github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
 github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
 github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=

+ 26 - 13
website/src/components/home/Abilities.tsx

@@ -1,27 +1,27 @@
-import React, { useState } from 'react'
+import React, { useState } from "react";
 import { Grid, Box, Typography, Container, Link } from "@mui/material";
-import Image from 'next/image'
+import Image from "next/image";
 import Icon from "@/components/Icon";
 
 const ABILITY_LIST = [
   {
     title: "人机验证",
-    href: "https://waf-ce.chaitin.cn/docs/about/challenge",
+    href: "/docs/about/challenge",
     img: "/images/ability/ability_verification.png",
   },
   {
     title: "百川网站监控联动",
-    href: "https://waf-ce.chaitin.cn/docs/practice/monitor",
+    href: "/docs/practice/monitor",
     img: "/images/ability/ability_rivers.png",
   },
   {
     title: "APISIX 插件集成",
-    href: "https://waf-ce.chaitin.cn/docs/about/apisix",
+    href: "/docs/about/apisix",
     img: "/images/ability/ability_apisix.svg",
   },
   {
     title: "长亭社区恶意 IP 情报",
-    href: "https://waf-ce.chaitin.cn/docs/about/IpIntelligence",
+    href: "/docs/about/IpIntelligence",
     img: "/images/ability/ability_maliciousip.svg",
   },
   {
@@ -46,7 +46,7 @@ const ABILITY_LIST = [
   },
 ];
 
-const DEFAULT_URL = '/images/ability/ability_verification.png';
+const DEFAULT_URL = "/images/ability/ability_verification.png";
 
 const Abilities = () => {
   const [hoveredUrl, setHoveredUrl] = useState(DEFAULT_URL);
@@ -57,7 +57,7 @@ const Abilities = () => {
 
   return (
     <Box
-      position={'relative'}
+      position={"relative"}
       sx={{
         background: "#111227",
         color: "common.white",
@@ -69,10 +69,18 @@ const Abilities = () => {
       <Container maxWidth="lg">
         <Grid container alignItems="center">
           <Grid item xs={12} sm={12} md={6}>
-            <Typography variant="h2" mb={4.5}>多维能力拓展</Typography>
+            <Typography variant="h2" mb={4.5}>
+              多维能力拓展
+            </Typography>
             <Grid container spacing={2}>
               {ABILITY_LIST.map((ability) => (
-                <AbilityItem key={ability.title} title={ability.title} img={ability.img} href={ability.href} handleIconHover={handleIconHover} />
+                <AbilityItem
+                  key={ability.title}
+                  title={ability.title}
+                  img={ability.img}
+                  href={ability.href}
+                  handleIconHover={handleIconHover}
+                />
               ))}
             </Grid>
           </Grid>
@@ -101,11 +109,16 @@ export default Abilities;
 interface ItemProps {
   title: string;
   href?: string;
-  img?: string
-  handleIconHover: Function
+  img?: string;
+  handleIconHover: Function;
 }
 
-const AbilityItem: React.FC<ItemProps> = ({ title, href, img, handleIconHover }) => {
+const AbilityItem: React.FC<ItemProps> = ({
+  title,
+  href,
+  img,
+  handleIconHover,
+}) => {
   return (
     <Grid item xs={12} sm={6}>
       <Box