Skip to content

Commit

Permalink
feat: added java plugin runner download block (apache#411)
Browse files Browse the repository at this point in the history
Co-authored-by: 琚致远 <[email protected]>
  • Loading branch information
2 people authored and 1502shivam-singh committed Sep 19, 2021
1 parent da082bb commit 4f5f6e0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
21 changes: 20 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ module.exports = {
shape: "triangle",
color: "#e8433e",
githubRepo: "apache/apisix",
githubBranch: "master",
downloadPath: "apisix/2.7/apache-apisix-2.7-src",
version: "2.7",
releaseDate: "2021-06-25",
firstDocPath: "/getting-started",
Expand All @@ -114,6 +116,8 @@ module.exports = {
shape: "square",
color: "#10B981",
githubRepo: "apache/apisix-dashboard",
githubBranch: "master",
downloadPath: "apisix/dashboard/2.7/apache-apisix-dashboard-2.7-src",
version: "2.7",
releaseDate: "2021-06-15",
firstDocPath: "/USER_GUIDE",
Expand All @@ -125,10 +129,25 @@ module.exports = {
shape: "hexagon",
color: "#2563EB",
githubRepo: "apache/apisix-ingress-controller",
githubBranch: "master",
downloadPath: "apisix/ingress-controller/1.1.0/apache-apisix-ingress-controller-1.1.0-src",
version: "1.1.0",
releaseDate: "2021-07-13",
firstDocPath: "/getting-started",
}
},
{
name: "APISIX™ Java Plugin Runner",
nameInParamCase: "java-plugin-runner",
description: "Runs Apache APISIX plugins written in Java. Implemented as a sidecar that accompanies Apache APISIX.",
shape: "star",
color: "#FB9300",
githubRepo: "apache/apisix-java-plugin-runner",
githubBranch: "main",
downloadPath: "apisix/java-plugin-runner/0.1/apisix-java-plugin-runner-0.1.0-src",
version: "0.1.0",
releaseDate: "2021-06-23",
firstDocPath: "/development",
},
],

team: require("./static/data/team.json"),
Expand Down
21 changes: 10 additions & 11 deletions website/src/pages/downloads/ProjectCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import IconDownload from "../../assets/icons/download.svg";
import IconTriangle from "../../assets/icons/triangle.svg";
import IconSquare from "../../assets/icons/square.svg";
import IconHexagon from "../../assets/icons/hexagon.svg";
import IconStarSolid from "../../assets/icons/star-solid.svg";

const Dropdown = (props) => {
const ref = useRef();
Expand All @@ -34,27 +35,25 @@ const ProjectCard = (props) => {
const [repoStats, setRepoStats] = useState({ stars: 0, issues: 0 });
const {
name,
nameInParamCase,
description,
shape,
color,
version,
releaseDate,
githubRepo,
githubBranch,
downloadPath
} = props;
const shapeComponent =
shape === "triangle" ? (
<IconTriangle />
) : shape === "square" ? (
<IconSquare />
) : (
) : shape === "hexagon" ? (
<IconHexagon />
) : (
<IconStarSolid />
);
const downloadLink = `apisix${
nameInParamCase !== "apisix" ? "/" + nameInParamCase : ""
}/${version}/apache-${
nameInParamCase !== "apisix" ? "apisix-" + nameInParamCase : "apisix"
}-${version}-src`;

useEffect(() => {
getGitHubRepoStats(githubRepo).then((stats) => {
Expand Down Expand Up @@ -92,7 +91,7 @@ const ProjectCard = (props) => {
</LeftSideLink>
<LeftSideLink
className="downloads-leftsidelink"
href={`https://github.com/${githubRepo}/blob/master/CHANGELOG.md`}
href={`https://github.com/${githubRepo}/blob/${githubBranch}/CHANGELOG.md`}
target="_blank"
>
<IconDocumentText /> CHANGELOG
Expand Down Expand Up @@ -120,21 +119,21 @@ const ProjectCard = (props) => {
>
<DropdownItem
className="download-dropdown-item"
href={`https://www.apache.org/dyn/closer.cgi/${downloadLink}.tgz`}
href={`https://www.apache.org/dyn/closer.cgi/${downloadPath}.tgz`}
target="_blank"
>
Source
</DropdownItem>
<DropdownItem
className="download-dropdown-item"
href={`https://downloads.apache.org/${downloadLink}.tgz.asc`}
href={`https://downloads.apache.org/${downloadPath}.tgz.asc`}
target="_blank"
>
ASC
</DropdownItem>
<DropdownItem
className="download-dropdown-item"
href={`https://downloads.apache.org/${downloadLink}.tgz.sha512`}
href={`https://downloads.apache.org/${downloadPath}.tgz.sha512`}
target="_blank"
>
SHA512
Expand Down

0 comments on commit 4f5f6e0

Please sign in to comment.