You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/12/15 13:46:13 UTC
[incubator-streampark-website] branch dev updated: [Feature]: add download page (#164)
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark-website.git
The following commit(s) were added to refs/heads/dev by this push:
new 8732c01e [Feature]: add download page (#164)
8732c01e is described below
commit 8732c01e66c3523b584d7b364871cdb8d5642038
Author: WSZ <12...@qq.com>
AuthorDate: Thu Dec 15 21:46:08 2022 +0800
[Feature]: add download page (#164)
---
docusaurus.config.js | 8 +--
src/pages/download/data.json | 1 +
src/pages/download/index.jsx | 73 +++++++++++++++++++++++++
src/pages/download/index.less | 109 ++++++++++++++++++++++++++++++++++++++
src/pages/download/info.svg | 1 +
src/pages/download/languages.json | 46 ++++++++++++++++
src/pages/download/table.jsx | 52 ++++++++++++++++++
7 files changed, 287 insertions(+), 3 deletions(-)
diff --git a/docusaurus.config.js b/docusaurus.config.js
index de18e4d8..8f4014c9 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -68,9 +68,11 @@ const config = {
activeBaseRegex: `^/$`,
},
{
- to: 'https://github.com/apache/incubator-streampark/releases',
+ // to: 'https://github.com/apache/incubator-streampark/releases',
+ to: '/download',
position: 'right',
- label: 'Download'
+ label: 'Download',
+ activeBaseRegex: '/download',
},
{
to: '/docs/intro',
@@ -283,7 +285,7 @@ const config = {
</p>
</div>
</div>
-
+
<div style="border-top: 1px solid #525252;min-height: 60px;line-height: 25px;text-align: left;font-family: Avenir-Medium;font-size: 14px;color: #999;display: flex;align-items: center;">
<span>
Copyright © ${new Date().getFullYear()} The Apache Software Foundation. Apache StreamPark, StreamPark, and its feather logo are trademarks of The Apache Software Foundation.
diff --git a/src/pages/download/data.json b/src/pages/download/data.json
new file mode 100644
index 00000000..fe51488c
--- /dev/null
+++ b/src/pages/download/data.json
@@ -0,0 +1 @@
+[]
diff --git a/src/pages/download/index.jsx b/src/pages/download/index.jsx
new file mode 100644
index 00000000..9af7ade4
--- /dev/null
+++ b/src/pages/download/index.jsx
@@ -0,0 +1,73 @@
+import React from 'react';
+import useIsBrowser from '@docusaurus/useIsBrowser';
+import config from "./languages.json";
+import Layout from '@theme/Layout';
+import InfoSvg from "./info.svg"
+import './index.less';
+import downloadDataSource from './data.json'
+import ReleaseTable from "./table"
+export default function () {
+ const isBrowser = useIsBrowser();
+ const language = isBrowser && location.pathname.indexOf('/zh-CN/') === 0 ? 'zh-CN' : 'en';
+ const dataSource = config?.[language];
+ let lastRelease = []
+ const archivedRelease = []
+ downloadDataSource.forEach(item => {
+ if (item.isLast) lastRelease = [item]
+ else archivedRelease.push(item)
+ })
+ return (
+ <Layout>
+ <div className="block download_page" style={{ padding: "10px 0 30px" }}>
+ <h2 className="fs-4 mb-4 fw-bold">{dataSource.download}</h2>
+ <div className="custom-info-block">
+ <div className='d-flex align-items-center'>
+ <InfoSvg className='info-icon' />
+ <p className="custom-block-title">Instructions</p>
+ </div>
+ <ul>
+ <li>{dataSource.last.title}</li>
+ <li>
+ <span>{dataSource.last.verification} </span>
+ <a href='https://downloads.apache.org/incubator/streampark/KEYS' target="_blank">
+ {dataSource.last.projectKey}
+ </a>.
+ </li>
+ <li>
+ <span>{dataSource.last.check} </span>
+ <a href='https://www.apache.org/dyn/closer.cgi#verify' target="_blank">
+ {dataSource.last.verify}
+ </a>
+ <span> {dataSource.last.page}.</span>
+ </li>
+ </ul>
+ </div>
+ <h3 className="fs-4 mb-4 fw-bold">{dataSource.latestVersion}</h3>
+ <ReleaseTable dataSource={lastRelease}>
+ </ReleaseTable>
+ <h3 className="fs-4 mb-4 fw-bold">{dataSource.archived}</h3>
+ <div className="custom-info-block">
+ <div className='d-flex align-items-center'>
+ <InfoSvg className='info-icon' />
+ <p className="custom-block-title">Note</p>
+ </div>
+ <ul>
+ <li>{dataSource.note}</li>
+ </ul>
+ </div>
+ <ReleaseTable dataSource={archivedRelease}>
+ </ReleaseTable>
+ <h4>License</h4>
+ <p>
+ <em>
+ <span>The software licensed under </span>
+ <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">
+ Apache License 2.0
+ </a>.
+ </em>
+ </p>
+ </div>
+ </Layout>
+
+ );
+}
diff --git a/src/pages/download/index.less b/src/pages/download/index.less
new file mode 100644
index 00000000..057b7482
--- /dev/null
+++ b/src/pages/download/index.less
@@ -0,0 +1,109 @@
+@import url('/src/styles/variable.less');
+
+.download_page {
+
+ a {
+ text-decoration: none;
+ }
+
+ margin-top: 50px !important;
+
+ .custom-info-block {
+ margin: 28px 0;
+ padding: 20px 24px 4px 42px;
+ border-radius: 5px;
+ transition: color .5s, background-color .5s;
+ position: relative;
+ font-size: 14px;
+ line-height: 1.6;
+ font-weight: 500;
+ color: #0000008c;
+ background-color: #f9f9f9;
+ border: 1px solid var(--ifm-color-warning);
+ .info-icon{
+ width:25px;
+ height:25px;
+ margin-right:5px;
+ }
+ .custom-block-title {
+ margin-bottom: 0px;
+ font-size: 17px;
+ font-weight: 500;
+ color: #213547;
+ transition: color .5s;
+ }
+
+ ul li {
+ position: relative;
+ padding: 4px 0;
+ }
+ }
+
+ .table-ui {
+ display: table;
+ max-width: 100%;
+ width: 100%;
+ background: #fff;
+ border: 1px solid rgba(34, 36, 38, .15);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ border-radius: 0.28571429rem;
+ text-align: left;
+ color: rgba(0, 0, 0, .87);
+ border-collapse: separate;
+ border-spacing: 0;
+ font-size: 1em;
+
+ thead {
+ box-shadow: none;
+
+ tr:first-child>th:first-child {
+ border-radius: .2rem 0 0 0;
+ border-left: none;
+ border-top: 0;
+ }
+
+ th {
+ cursor: auto;
+ background: #f9fafb;
+ text-align: inherit;
+ color: rgba(0, 0, 0, .87);
+ padding: 0.92857143em 0.78571429em;
+ vertical-align: inherit;
+ font-weight: 700;
+ text-transform: none;
+ border: none;
+ border-right: 1px solid rgba(34, 36, 38, .15);
+
+ &:last-child {
+ border-right: none;
+ }
+ }
+ }
+
+ tbody {
+ &>tr:nth-of-type(odd) {
+ background-color: #f9f9f9;
+ }
+
+ tr {
+ &:hover {
+ background: rgba(0, 0, 0, .05) !important;
+ color: rgba(0, 0, 0, .95) !important;
+ cursor: pointer;
+ }
+
+ td {
+ border: none;
+ border-top: 1px solid rgba(34, 36, 38, .15);
+ border-right: 1px solid rgba(34, 36, 38, .15);
+
+ &:last-child {
+ border-right: none;
+ }
+ }
+
+ }
+ }
+ }
+}
diff --git a/src/pages/download/info.svg b/src/pages/download/info.svg
new file mode 100644
index 00000000..c286cb1d
--- /dev/null
+++ b/src/pages/download/info.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1671096920147" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2668" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M509.92 795.84c157.904 0 285.92-128.016 285.92-285.92C795.84 352 667.808 224 509.92 224 352 224 224 352 224 509.92c0 157.904 128 285.92 285.92 285.92z m0 48C32 [...]
diff --git a/src/pages/download/languages.json b/src/pages/download/languages.json
new file mode 100644
index 00000000..fca5d7d5
--- /dev/null
+++ b/src/pages/download/languages.json
@@ -0,0 +1,46 @@
+{
+ "zh-CN": {
+ "download": "下载 Apache StreamPark (incubating)",
+ "last": {
+ "title": "请从下表中选择 StreamPark 版本下载,推荐最新版本。",
+ "verification": "验证下载版本,请使用相应的哈希(sha512)、签名和",
+ "projectKey": "项目发布KEYS",
+ "check": "检查哈希(sha512)和签名的说明显示在",
+ "verify": "验证说明",
+ "page": "页面"
+ },
+ "latestVersion": "最新版本",
+ "archived": "所有存档的版本",
+ "note": "以前版本的 StreamPark 可能会受到安全问题的影响,请考虑使用最新版本。",
+ "table": {
+ "version": "版本",
+ "date": "日期",
+ "source": "源码",
+ "binary": "二进制包",
+ "releaseNotes": "发布记录"
+ },
+ "releaseNotes": "发布记录"
+ },
+ "en": {
+ "download": "Download Apache StreamPark (incubating)",
+ "last": {
+ "title": "Please choose a StreamPark version to download from the blowing tables, the latest release is recommended.",
+ "verification": "Please verify the release with corresponding hashes(sha512), signatures and ",
+ "projectKey": "project release KEYS",
+ "check": "The instructions for checking hashes(sha512) and signatures is indicated on",
+ "verify": "Verify Instructions",
+ "page": "page"
+ },
+ "latestVersion": "The latest release",
+ "archived": "All archived releases",
+ "note": "Previous releases of StreamPark may be affected by security issues, please consider use the latest one.",
+ "table": {
+ "version": "Version",
+ "date": "Date",
+ "source": "Source",
+ "binary": "Binary",
+ "releaseNotes": "Release notes"
+ },
+ "releaseNotes": "release notes"
+ }
+}
diff --git a/src/pages/download/table.jsx b/src/pages/download/table.jsx
new file mode 100644
index 00000000..1e16797c
--- /dev/null
+++ b/src/pages/download/table.jsx
@@ -0,0 +1,52 @@
+import React from 'react'
+import useIsBrowser from '@docusaurus/useIsBrowser'
+import config from './languages.json'
+
+export default function (props) {
+ const tableData = props.dataSource || []
+ const isBrowser = useIsBrowser();
+ const language = isBrowser && location.pathname.indexOf('/zh-CN/') === 0 ? 'zh-CN' : 'en'
+ const dataSource = config?.[language];
+ return (
+ <table className="table-ui mb-4">
+ <thead>
+ <tr>
+ <th className='text-center'> {dataSource.table.version} </th>
+ <th className='text-center'>{dataSource.table.date} </th>
+ <th className='text-center'> {dataSource.table.source}</th>
+ <th className='text-center'> {dataSource.table.binary} </th>
+ <th className='text-center'> {dataSource.table.releaseNotes} </th>
+ </tr>
+ </thead>
+ <tbody>
+ {
+ tableData.map((release) => {
+ return <tr key={release.version}>
+ <td className='text-center'> {release.version} </td>
+ <td className='text-center'> {release.date} </td>
+ <td className='text-center'>
+ <a href={release.source} target="_blank">source</a>
+ <span> ( </span>
+ <a href={release.sourceSha} target="_blank">sha512</a>
+ <span> | </span>
+ <a href={release.sourceSignature} target="_blank">signature</a>
+ <span> ) </span>
+ </td>
+ <td className='text-center'>
+ <a href={release.binary} target="_blank">binary</a>
+ <span> ( </span>
+ <a href={release.binarySha} target="_blank">sha512</a>
+ <span> | </span>
+ <a href={release.binarySignature} target="_blank">signature</a>
+ <span> ) </span>
+ </td>
+ <td className='text-center'>
+ <a href={release.changeLog} target="_blank">{dataSource.releaseNotes}</a>
+ </td>
+ </tr>
+ })
+ }
+ </tbody>
+ </table>
+ );
+}