diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..5e4086a --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=https://registry.npmmirror.com/ diff --git a/.umirc.ts b/.umirc.ts index 64a4275..5b07e0f 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -1,5 +1,5 @@ -import { DEFAULT_LOCAL } from './src/constant'; import { defineConfig } from 'umi'; +import { DEFAULT_LOCAL } from './src/constant'; export default defineConfig({ nodeModulesTransform: { @@ -52,21 +52,27 @@ export default defineConfig({ ], scripts: [ `var _hmt = _hmt || []; -(function() { - var hm = document.createElement("script"); - hm.src = "https://hm.baidu.com/hm.js?e4bea71987c7daae77ee69586aad5bec"; - var s = document.getElementsByTagName("script")[0]; - s.parentNode.insertBefore(hm, s); -})();`, + (function() { + var hm = document.createElement("script"); + hm.src = "https://hm.baidu.com/hm.js?e4bea71987c7daae77ee69586aad5bec"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); + })();`, { src: 'https://www.googletagmanager.com/gtag/js?id=AW-11092859162', async: true, }, `window.dataLayer = window.dataLayer || []; -function gtag(){dataLayer.push(arguments);} -gtag('js', new Date()); - -gtag('config', 'AW-11092859162');`, + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'AW-11092859162');`, + `var _hmt = _hmt || []; + (function() { + var hm = document.createElement("script"); + hm.src = "https://hm.baidu.com/hm.js?9452f06d5325a3907efec5619d9f2392"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); + })();`, ], theme: { 'primary-color': 'rgba(22,80,255,1)', @@ -83,7 +89,6 @@ gtag('config', 'AW-11092859162');`, .use('frontmatter-markdown-loader') .loader('frontmatter-markdown-loader'); }, - ssr: { mode: 'stream' }, exportStatic: {}, fastRefresh: {}, request: { diff --git a/package.json b/package.json index 4a219e3..81a8955 100644 --- a/package.json +++ b/package.json @@ -36,20 +36,12 @@ }, "devDependencies": { "@types/react": "^17.0.0", + "@types/react-copy-to-clipboard": "^5.0.4", "@types/react-dom": "^17.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", - "@types/react-copy-to-clipboard": "^5.0.4", "@umijs/preset-react": "1.x", - "@umijs/test": "^3.5.28", "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-react": "^7.26.1", - "eslint-plugin-react-hooks": "^4.2.0", "frontmatter-markdown-loader": "^3.7.0", "lint-staged": "^10.0.7", "prettier": "^2.2.0", diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 3fbf830..9e0fd01 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -3,22 +3,16 @@ import { CloseOutlined, RightOutlined, UpOutlined } from '@ant-design/icons'; import { DocSearch } from '@docsearch/react'; import { Drawer, Menu, Popover, Space } from 'antd'; import cx from 'classnames'; -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { useMedia } from 'react-use'; import { history, useIntl, useLocation } from 'umi'; +import { DEFAULT_LOCAL, searchParamsEn, searchParamsZh } from '@/constant'; +import { getSearch, goLinkAt, historyPushLinkAt } from '@/util'; import '@docsearch/css'; import AnnouncementBanner from '../AnnouncementBanner'; import GithubButton from '../githubButton'; import styles from './index.less'; -import { - DEFAULT_LOCAL, - HOST_EN, - HOST_ZH, - searchParamsEn, - searchParamsZh, -} from '@/constant'; -import { getSearch, goLinkAt, historyPushLinkAt } from '@/util'; export const Header = ({ isStick }: { isStick?: boolean }) => { const intl = useIntl(); @@ -362,6 +356,14 @@ export const Header = ({ isStick }: { isStick?: boolean }) => { > {intl.formatMessage({ id: 'header.product.desc3' })} +
{ + window.open('https://osgraph.com/'); + }} + > + {intl.formatMessage({ id: 'header.product.desc4' })} +
diff --git a/src/data/bannerContent.ts b/src/data/bannerContent.ts index 2e6ff5e..3e6c332 100644 --- a/src/data/bannerContent.ts +++ b/src/data/bannerContent.ts @@ -1,17 +1,3 @@ import { IntlShape } from 'react-intl'; -export const getBannerCnContentList = (intl: IntlShape) => [ - { - pcImg: - 'https://mdn.alipayobjects.com/huamei_qcdryc/afts/img/A*xDDQQIeyUTEAAAAAAAAAAAAADgOBAQ/original', - mobileImg: - 'https://mdn.alipayobjects.com/huamei_qcdryc/afts/img/A*bTMJT4EQmXcAAAAAAAAAAAAADgOBAQ/original', - }, -]; -export const getBannerEnContentList = (intl: IntlShape) => [ - // { - // pcImg: - // 'https://mdn.alipayobjects.com/huamei_2dxjn8/afts/img/A*MhtgQJHk8soAAAAAAAAAAAAADrR-AQ/original', - // mobileImg: - // 'https://mdn.alipayobjects.com/huamei_2dxjn8/afts/img/A*mb5dTZkyyG8AAAAAAAAAAAAADrR-AQ/original', - // }, -]; +export const getBannerCnContentList = (intl: IntlShape) => []; +export const getBannerEnContentList = (intl: IntlShape) => []; diff --git a/src/data/blog.ts b/src/data/blog.ts index c83ce3b..4d25ae5 100644 --- a/src/data/blog.ts +++ b/src/data/blog.ts @@ -20,9 +20,9 @@ import md17 from '@/doc/zh/17.md'; import md18 from '@/doc/zh/18.md'; import md19 from '@/doc/zh/19.md'; import md20 from '@/doc/zh/20.md'; +import md888 from '@/doc/zh/888.md'; import md999 from '@/doc/zh/999.md'; import idc from '@/doc/zh/IDC.md'; -import md888 from '@/doc/zh/888.md'; export const blogs = [ { @@ -207,7 +207,7 @@ export const blogs = [ content: md20?.html, }, { - id: 999, + id: 20, img: 'https://mdn.alipayobjects.com/huamei_qcdryc/afts/img/A*c41lRYAbTeYAAAAAAAAAAAAADgOBAQ/original', title: 'ICDM 2023 大赛成绩榜单', desc: '初赛和复赛阶段的评估函数按照 Adjusted rand score(ARI)计算。结果取历史最高分,分数榜单每天(T+1)在网站更新', @@ -221,11 +221,31 @@ export const blogs = [ desc: 'IDC发布了最新的市场研究报告《IDC MarketScape:中国图数据库市场厂商评估,2023》。蚂蚁集团自研的企业级图数据管理平台TuGraph跻身"领导者"象限。', type: 'news', updateDate: '2023-07-17', - id: 1000, + id: 21, content: idc?.html, }, { - id: 888, + id: 22, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*3teRQ5fY0H0AAAAAAAAAAAAADlT8AQ/original', + title: '活动回顾|TuGraph 社区 Meetup 北京站演讲内容,附视频和PPT', + desc: '', + updateDate: '2024-04-07', + type: 'news', + content: 'https://mp.weixin.qq.com/s/hoHSJg4mU6KWHbTEpgqFZQ', + isLink: true, + }, + { + id: 23, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*aQP_QL1BA3wAAAAAAAAAAAAADlT8AQ/original', + title: '陈文光:AI时代需要怎样的数据处理技术?', + desc: '', + updateDate: '2024-04-25', + type: 'news', + content: 'https://mp.weixin.qq.com/s/YXWkis0eaplKWjZGgMxsWw', + isLink: true, + }, + { + id: 24, img: 'https://mdn.alipayobjects.com/huamei_qcdryc/afts/img/A*BLo1QZwId_0AAAAAAAAAAAAADgOBAQ/original', title: '2024 开源之夏已开启', desc: '欢迎报名 TuGraph 项目,赢取万元奖金', @@ -233,6 +253,86 @@ export const blogs = [ type: 'competition', content: md888?.html, }, + { + id: 25, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*Da84T4u5MKIAAAAAAAAAAAAADlT8AQ/original', + title: '深入解读TuGraph计算引擎模型推理系统', + desc: '', + updateDate: '2024-05-24', + type: 'tech', + content: 'https://mp.weixin.qq.com/s/X3hx_y-e7XP1VQHoeRHnDA', + isLink: true, + }, + { + id: 26, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*AwGQQ4LE1AwAAAAAAAAAAAAADlT8AQ/original', + title: 'Vector | Graph:蚂蚁首个开源Graph RAG框架设计解读', + desc: '', + updateDate: '2024-06-19', + type: 'tech', + content: 'https://mp.weixin.qq.com/s/WILvYFiKugroy9Q_FmGriA', + isLink: true, + }, + { + id: 27, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*xlLgSJa49JoAAAAAAAAAAAAADlT8AQ/original', + title: '技术圈 i 人是如何交朋友的?有人尝试用技术解决这个问题', + desc: '', + updateDate: '2024-07-01', + type: 'news', + content: 'https://mp.weixin.qq.com/s/53lpp65G7MorrS22x8WH9A', + isLink: true, + }, + { + id: 28, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*RpGGQLyinTwAAAAAAAAAAAAADlT8AQ/original', + title: 'TuGraph分布式图数据库上线阿里云市场', + desc: '', + updateDate: '2024-07-04', + type: 'news', + content: 'https://mp.weixin.qq.com/s/IPjeF9egDDK4RwrTp_MhIg', + isLink: true, + }, + { + id: 29, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*UDuIRI2Y-1EAAAAAAAAAAAAADlT8AQ/original', + title: '社区贡献 | 新Feature发布:TuGraph-DB支持空间数据类型', + desc: '', + updateDate: '2024-07-12', + type: 'tech', + content: 'https://mp.weixin.qq.com/s/YIMJGFKBJHNgC4GA1jAiPg', + isLink: true, + }, + { + id: 30, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*iewnT7DgxTEAAAAAAAAAAAAADlT8AQ/original', + title: '上万次模型训练,TuGraph准确预测西班牙欧洲杯决赛夺冠', + desc: '', + updateDate: '2024-07-16', + type: 'news', + content: 'https://mp.weixin.qq.com/s/NqwqP8kzeaoZQqmBBI3NRg', + isLink: true, + }, + { + id: 31, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*jSDxRIOCdLQAAAAAAAAAAAAADlT8AQ/original', + title: '论文解读|GRAG: Graph Retrieval-Augmented Generation', + desc: '', + updateDate: '2024-07-19', + type: 'tech', + content: 'https://mp.weixin.qq.com/s/xLVaFVr7rnYJq0WZLsFVMw', + isLink: true, + }, + { + id: 32, + img: 'https://mdn.alipayobjects.com/huamei_mag6n2/afts/img/A*irZsSZVT780AAAAAAAAAAAAADlT8AQ/original', + title: '还在用Google Scholar看论文?「论文图谱」打开“上帝视角”', + desc: '', + updateDate: '2024-07-25', + type: 'tech', + content: 'https://mp.weixin.qq.com/s/jeHBn1DKyo2sTP9896ZbKA', + isLink: true, + }, ]; export const getZHBlogs = (type: string) => { diff --git a/src/data/download.ts b/src/data/download.ts index 50ac3e8..3a58249 100644 --- a/src/data/download.ts +++ b/src/data/download.ts @@ -18,6 +18,11 @@ export const assetsList = [ { name: 'CentOS', assets: [ + { + label: 'v4.3.2', + value: + 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-4.3.2/tugraph-4.3.2-1.el8.x86_64.rpm', + }, { label: 'v4.0.1', value: @@ -33,36 +38,16 @@ export const assetsList = [ value: 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.6.0/tugraph-3.6.0-1.el7.x86_64.rpm', }, - { - label: 'v3.5.1', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.5.1/tugraph-3.5.1-1.el7.x86_64.rpm', - }, - { - label: 'v3.5.0', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.5.0/tugraph-3.5.0-1.el7.x86_64.rpm', - }, - { - label: 'v3.4.0', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.4.0/TuGraph-3.4.0-1.el7.x86_64.rpm', - }, - { - label: 'v3.3.2', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.3.2/TuGraph-3.3.2-1.el7.x86_64.rpm', - }, - { - label: 'v3.3.0', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.3.0/TuGraph-3.3.0-1.el7.x86_64.rpm', - }, ], }, { name: 'Ubuntu', assets: [ + { + label: 'v4.3.2', + value: + 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-4.3.2/tugraph-4.3.2-1.x86_64.deb', + }, { label: 'v4.0.1', value: @@ -78,31 +63,6 @@ export const assetsList = [ value: 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.6.0/tugraph-3.6.0-1.x86_64.deb', }, - { - label: 'v3.5.1', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.5.1/tugraph-3.5.1-1.x86_64.deb', - }, - { - label: 'v3.5.0', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.5.0/tugraph-3.5.0-1.x86_64.deb', - }, - { - label: 'v3.4.0', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.4.0/TuGraph-3.4.0-1.x86_64.deb', - }, - { - label: 'v3.3.2', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.3.2/TuGraph-3.3.2-1.x86_64.deb', - }, - { - label: 'v3.3.0', - value: - 'https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/tugraph-3.3.0/TuGraph-3.3.0-1.x86_64.deb', - }, ], }, ]; diff --git a/src/hooks/useGetENDocsInfo.ts b/src/hooks/useGetENDocsInfo.ts index 1d56d96..4dafdd5 100644 --- a/src/hooks/useGetENDocsInfo.ts +++ b/src/hooks/useGetENDocsInfo.ts @@ -1,9 +1,9 @@ +import { useRequest } from 'umi'; import { queryCategory, - queryVersions, queryDocDetail, + queryVersions, } from '../services/DocsENController'; -import { useRequest } from 'umi'; export const useGetENDocsInfo = () => { const { run: getCategoryList } = useRequest(queryCategory, { manual: true }); diff --git a/src/interface.ts b/src/interface.ts index c48390f..d1ca409 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -36,6 +36,7 @@ export interface BlogItem { updateDate: string; content: string; type: string; + isLink?: boolean; } export interface MenuItem { diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index a307b56..52cabbf 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -14,6 +14,7 @@ export default { 'header.product.desc1': 'TuGraph Overview', 'header.product.desc2': 'TuGraph Analytics: Streaming Graph Computing Engine', 'header.product.desc3': 'TuGraph Learn: Graph Learning Engine', + 'header.product.desc4': 'OSGraph Open Source Graph Relationship Insight Tool', 'footer.product.title': 'Community Edition', 'footer.product.title1': 'Enterprise Edition', 'footer.product': 'Products', @@ -47,6 +48,7 @@ export default { 'home.btn.tryOut': ' Enterprise Edition', 'home.tugrpah.db': 'Standalone', 'home.distributed': 'Distributed', + 'home.highAvailability': 'High Availability', 'home.three.lines.consistent': 'online/near-line/offline all-in-one', 'home.case.desc1': 'bottlenecks for industrial data analysis.', 'home.case0.title': 'Financial Services', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 4025f6c..d6741ac 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -14,6 +14,7 @@ export default { 'header.product.desc1': 'TuGraph 企业版概览', 'header.product.desc2': 'TuGraph Analytics 实时图计算引擎', 'header.product.desc3': 'TuGraph Learn 图学习引擎', + 'header.product.desc4': 'OSGraph 开源图谱关系洞察工具', 'footer.product': '产品', 'footer.product.title': '社区版', 'footer.product.title1': '企业版', @@ -139,6 +140,7 @@ export default { 'home.version1': '企业版', 'home.tugrpah.db': '单机版', 'home.distributed': '分布式', + 'home.highAvailability': '高可用', 'home.three.lines.consistent': '离近在-三线一致', 'home.version.desc1': '企业版本对商业化功能支持更加完善,包括分布式集群架构,覆盖探索、研发、服务、运维全生命周期的一站式图平台,在线、近线、离线的图计算引擎,支持流式、大数据类数据源,多地多中心的部署形态等。是商业化解决方案的理想选择。', diff --git a/src/pages/blog.tsx b/src/pages/blog.tsx index 3d49a25..6c3a7c1 100644 --- a/src/pages/blog.tsx +++ b/src/pages/blog.tsx @@ -1,19 +1,18 @@ -import React, { useEffect, useState } from 'react'; -import HTMLRenderer from 'react-html-renderer'; -import { useIntl, useLocation } from 'umi'; -import { Spin, Pagination, Tabs, Space, Button } from 'antd'; -import { Layout } from 'antd'; -import cx from 'classnames'; -import { useMedia } from 'react-use'; -import styles from './blog.less'; -import { Header } from '@/components/Header'; import { Footer } from '@/components/Footer'; +import { Header } from '@/components/Header'; +import { LayoutTemplate } from '@/components/LayoutTemplate'; +import { DEFAULT_LOCAL } from '@/constant'; import { getZHBlogs } from '@/data/blog'; import { getENBlogs } from '@/data/blog_en'; -import { LayoutTemplate } from '@/components/LayoutTemplate'; import { BlogItem } from '@/interface'; import { getSearch } from '@/util'; -import { DEFAULT_LOCAL } from '@/constant'; +import { Button, Layout, Pagination, Space, Spin, Tabs } from 'antd'; +import cx from 'classnames'; +import React, { useEffect, useState } from 'react'; +import HTMLRenderer from 'react-html-renderer'; +import { useMedia } from 'react-use'; +import { useIntl, useLocation } from 'umi'; +import styles from './blog.less'; const { Content } = Layout; @@ -78,7 +77,15 @@ export default function BlogPage() { return; } setBlogDetail(blogs?.find((item) => item.id === Number(id))?.content); - }, [location]); + }, []); + + const jumpToArticle = (article: BlogItem) => { + if (article.isLink) { + window.open(article.content, '_blank'); + } else { + window.open(`/blog?id=${article.id}&lang=${lang}`); + } + }; const content = (
{ - setBlogDetail(item.content); + jumpToArticle(item); }} > @@ -127,9 +133,8 @@ export default function BlogPage() { { - setBlogDetail(item.content); + jumpToArticle(item); }} > @@ -155,7 +160,7 @@ export default function BlogPage() { key={key} href={`/blog?id=${item.id}&lang=${lang}`} onClick={() => { - setBlogDetail(item.content); + jumpToArticle(item); }} > @@ -181,7 +186,7 @@ export default function BlogPage() { key={key} href={`/blog?id=${item.id}&lang=${lang}`} onClick={() => { - setBlogDetail(item.content); + jumpToArticle(item); }} > diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 340551c..80eac39 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -25,19 +25,18 @@ import { useState } from 'react'; import { Helmet } from 'react-helmet'; import { useMedia } from 'react-use'; import { isBrowser, useIntl, useLocation } from 'umi'; -import React from 'react'; -import stylesZh from './index.less'; -import stylesEn from './index_en.less'; -import { getReasons } from '@/data/reasons'; -import { getTugraphFun } from '@/data/get_tugraph_functions'; -import { getCases } from '@/data/cases'; -import { SubTitle } from '@/components/SubTitle'; -import JoLPlayer from '@/components/Player'; -import { LayoutTemplate } from '@/components/LayoutTemplate'; -import { ApplyForm } from '@/components/ApplyForm'; import AnnouncementBanner from '@/components/AnnouncementBanner'; +import { ApplyForm } from '@/components/ApplyForm'; +import { LayoutTemplate } from '@/components/LayoutTemplate'; +import JoLPlayer from '@/components/Player'; +import { SubTitle } from '@/components/SubTitle'; +import { getCases } from '@/data/cases'; +import { getTugraphFun } from '@/data/get_tugraph_functions'; +import { getReasons } from '@/data/reasons'; import { getSearch } from '@/util'; +import stylesZh from './index.less'; +import stylesEn from './index_en.less'; export default function IndexPage() { const intl = useIntl(); @@ -486,6 +485,11 @@ export default function IndexPage() { id: 'home.version.title1', })}
{intl.formatMessage({ id: 'home.tugrpah.db' })}
+

+ {intl.formatMessage({ + id: 'home.highAvailability', + })} +

) : ( <>