Skip to content

Commit b2401bb

Browse files
yaojp123yaojiping
and
yaojiping
authored
fix: reference and website links (#12)
* fix: remove `www` of official website * chore: update docs' url --------- Co-authored-by: yaojiping <[email protected]>
1 parent 8b176ab commit b2401bb

File tree

13 files changed

+25
-26
lines changed

13 files changed

+25
-26
lines changed

web/config/config.js

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export default {
5858
APP_TITLE: packageJson.title,
5959
APP_AUTHOR: packageJson.author,
6060
APP_OFFICIAL_WEBSITE: packageJson.official_website || "",
61-
APP_DOCS_WEBSITE: packageJson.docs_website || "",
6261
},
6362
// 路由配置
6463
routes: pageRoutes,

web/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"description": "Pursuing Excellence, Infinite Possibilities!",
77
"author": "INFINI.LTD",
88
"license": "INFINI-EULA",
9-
"official_website": "https://www.infinilabs.com",
10-
"docs_website": "https://www.infinilabs.com",
9+
"official_website": "https://infinilabs.com",
1110
"dependencies": {
1211
"@ant-design/charts": "1.4.2",
1312
"@ant-design/icons": "^4.0.0",

web/src/components/GlobalHeader/RightContent.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PureComponent } from "react";
22
import { FormattedMessage, formatMessage } from "umi/locale";
3-
import { getWebsitePathByLang } from "@/utils/utils";
3+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
44
import { Spin, Tag, Menu, Icon, Dropdown, Avatar, Tooltip } from "antd";
55
import moment from "moment";
66
import groupBy from "lodash/groupBy";
@@ -190,7 +190,7 @@ export default class GlobalHeaderRight extends PureComponent {
190190
</Menu.Item>
191191
<Menu.Item key="release_notes">
192192
<a
193-
href={`${getWebsitePathByLang()}/docs/latest/console/release-notes`}
193+
href={`${getDocPathByLang()}/release-notes`}
194194
target="_blank"
195195
>
196196
<Icon type="sync" />
@@ -199,7 +199,7 @@ export default class GlobalHeaderRight extends PureComponent {
199199
</Menu.Item>
200200
<Menu.Item key="document">
201201
<a
202-
href={`${getWebsitePathByLang()}/docs/latest/console/`}
202+
href={`${getDocPathByLang()}/`}
203203
target="_blank"
204204
>
205205
<Icon type="read" />

web/src/components/InstallAgent/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useEffect, useMemo, useState } from "react";
55
import request from "@/utils/request";
66
import { CopyToClipboard } from "react-copy-to-clipboard";
77
import { formatMessage } from "umi/locale";
8+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
89

910
export default ({autoInit = false}) => {
1011
const { loading, value } = useFetch(`/instance/_search`);
@@ -116,7 +117,7 @@ export default ({autoInit = false}) => {
116117
· {formatMessage({
117118
id:"agent.install.tips.desc"
118119
})}
119-
<a href='https://www.infinilabs.com/docs/latest/console/reference/agent/install/' target="_blank">{formatMessage({
120+
<a href={`${getDocPathByLang()}/reference/agent/install/`} target="_blank">{formatMessage({
120121
id:"agent.install.link.manual_install"
121122
})}&gt;</a>
122123
</p>

web/src/components/Licence/Version.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import styles from "./Version.less";
44
import { DATE_FORMAT } from ".";
55
import { formatMessage } from "umi/locale";
66
import AGPL from "./AGPL";
7+
import { getWebsitePathByLang } from "@/utils/utils";
78
const { Paragraph, Text } = Typography;
89

910
export default ({ application, licence }) => {
@@ -39,7 +40,7 @@ export default ({ application, licence }) => {
3940
For commercial licensing, contact us at:
4041
<ul>
4142
<li>Email: [email protected]</li>
42-
<li>Website: <a href="http://www.infinilabs.com" target="_blank">infinilabs.com</a></li>
43+
<li>Website: <a href={`${getWebsitePathByLang()}`} target="_blank">infinilabs.com</a></li>
4344
</ul>
4445
</Paragraph>
4546
<Paragraph>

web/src/components/Overview/Monitor/InstallAgent.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button } from "antd";
22
import { formatMessage } from "umi/locale";
3-
import { getWebsitePathByLang } from "@/utils/utils";
3+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
44

55
interface IProps {
66
height?: string | number;
@@ -26,7 +26,7 @@ export default (props: IProps) => {
2626
type="primary"
2727
onClick={() =>
2828
window.open(
29-
`${getWebsitePathByLang()}/docs/latest/console/reference/agent/install/`
29+
`${getDocPathByLang()}/reference/agent/install/`
3030
)
3131
}
3232
>

web/src/pages/Alerting/Rule/components/NoData.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Button, Card, Icon, message } from "antd";
22
import MessageIcon from "../../../Overview/components/Quick/icons/MessageIcon";
33
import { formatMessage } from "umi/locale";
44
import { Link } from "umi";
5-
import { getWebsitePathByLang } from "@/utils/utils";
5+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
66
import ExportAndImport from "../../components/ExportAndImport";
77
import Import from "../../components/Import";
88
import { useState } from "react";
@@ -63,7 +63,7 @@ export default ({ onSuccess }) => {
6363
) : null}
6464

6565
<a
66-
href={`${getWebsitePathByLang()}/docs/latest/console/reference/alerting/rule/`}
66+
href={`${getDocPathByLang()}/reference/alerting/rule/`}
6767
target="_blank"
6868
>
6969
<Icon type="file-text" theme="twoTone" />{" "}

web/src/pages/Alerting/components/VariablesExampleLabel.jsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { Table, Drawer } from "antd";
22
import { formatMessage } from "umi/locale";
3-
import { getWebsitePathByLang } from "@/utils/utils";
3+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
44
import { useState } from "react";
55
import TemplateVariables from "./Template/Variables";
66

77
const VariablesExampleLabel = (props) => {
88
const [varVisible, setVarVisible] = useState(false);
9-
const docsLink =
10-
APP_DOCS_WEBSITE && APP_DOCS_WEBSITE.indexOf("infinilabs") > -1
11-
? `${getWebsitePathByLang()}/docs/latest/console/reference/alerting/variables`
12-
: APP_DOCS_WEBSITE;
9+
const docsLink = `${getDocPathByLang()}/reference/alerting/variables`;
1310

1411
return (
1512
<>

web/src/pages/DataManagement/View/components/FormItems/GroupDisplay/GroupLabels.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Group from "@/components/Icons/Group";
22
import GroupBy from "@/components/Icons/GroupBy";
3+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
34
import { Button, Icon, Input, Switch } from "antd"
45
import { cloneDeep } from "lodash";
56
import { useMemo } from "react";
@@ -84,7 +85,7 @@ export default (props) => {
8485
lineHeight: '32px',
8586
border: '1px solid #d9d9d9'
8687
}}>
87-
{formatMessage({ id: "dashboard.widget.config.group.labels.template" })} <a href="https://www.infinilabs.com/en/docs/latest/console/reference/alerting/variables/" target="_blank"><Icon type="question-circle" /></a>
88+
{formatMessage({ id: "dashboard.widget.config.group.labels.template" })} <a href={`${getDocPathByLang()}/reference/alerting/variables/`} target="_blank"><Icon type="question-circle" /></a>
8889
</div>
8990
<Input
9091
style={{

web/src/pages/Gateway/Instance/Wizard/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Link } from "umi";
44
import gatewayBg from "@/assets/gateway_install_bg.svg";
55
import styles from "./index.less";
66
import { formatMessage } from "umi/locale";
7+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
78

89
const shell = `curl -sSL https://get.infini.cloud | bash -s -- -p gateway`;
910

@@ -42,7 +43,7 @@ export default () => {
4243
· {formatMessage({ id: "gateway.guide.tips.content" })}
4344
{` `}
4445
<a
45-
href="https://www.infinilabs.com/docs/latest/gateway/getting-started/install/"
46+
href={`${getDocPathByLang('gateway')}/getting-started/install/`}
4647
target={"_blank"}
4748
>
4849
{`${formatMessage({

web/src/pages/Overview/components/Product/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getLocale, formatMessage } from "umi/locale";
55
import { useEffect, useState } from 'react';
66
import request from '@/utils/request';
77
import CardMore from '../CardMore';
8+
import { getWebsitePathByLang } from '@/utils/utils';
89

910
export default () => {
1011

@@ -39,7 +40,7 @@ export default () => {
3940
{formatMessage({ id: "overview.title.product_activities"})}
4041
</div>
4142
<Card className={styles.content} size="small">
42-
<CardMore linkTo="https://www.infinilabs.com/blog/" external={true}/>
43+
<CardMore linkTo={`${getWebsitePathByLang()}/blog/`} external={true}/>
4344
{
4445
loading ? <div style={{ height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center'}}><Spin spinning={true} /></div> : (
4546
activities.map((item, index) => (

web/src/pages/Platform/Overview/Host/Detail/Metrics.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { formatter } from "@/utils/format";
77
import Table from "@/components/Overview/Detail/Infos/Table";
88
import { Button } from "antd";
99
import { formatMessage } from "umi/locale";
10-
import { getWebsitePathByLang } from "@/utils/utils";
10+
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
1111

1212
export default (props) => {
1313
const id = props.data?._id;
@@ -46,7 +46,7 @@ export default (props) => {
4646
type="primary"
4747
onClick={() =>
4848
window.open(
49-
`${getWebsitePathByLang()}/docs/latest/console/reference/agent/install/`
49+
`${getDocPathByLang()}/reference/agent/install/`
5050
)
5151
}
5252
>

web/src/utils/utils.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ export function getWebsitePathByLang() {
1515
}
1616
}
1717

18-
export function getDocPathByLang() {
19-
if (!APP_OFFICIAL_WEBSITE) return;
18+
export function getDocPathByLang(product = 'console') {
2019
if (getLocale() === "zh-CN") {
21-
return APP_OFFICIAL_WEBSITE.replace('.com', '.cn')
20+
return `https://infinilabs.cn/docs/latest/${product}`
2221
} else {
23-
return APP_OFFICIAL_WEBSITE + '/en'
22+
return `https://docs.infinilabs.com/${product}/main/docs`
2423
}
2524
}
2625

0 commit comments

Comments
 (0)