fix: reference and website links (#12)
* fix: remove `www` of official website * chore: update docs' url --------- Co-authored-by: yaojiping <yaojiping@infini.ltd>
This commit is contained in:
parent
8b176ab8ed
commit
b2401bb31f
|
@ -58,7 +58,6 @@ export default {
|
|||
APP_TITLE: packageJson.title,
|
||||
APP_AUTHOR: packageJson.author,
|
||||
APP_OFFICIAL_WEBSITE: packageJson.official_website || "",
|
||||
APP_DOCS_WEBSITE: packageJson.docs_website || "",
|
||||
},
|
||||
// 路由配置
|
||||
routes: pageRoutes,
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
"description": "Pursuing Excellence, Infinite Possibilities!",
|
||||
"author": "INFINI.LTD",
|
||||
"license": "INFINI-EULA",
|
||||
"official_website": "https://www.infinilabs.com",
|
||||
"docs_website": "https://www.infinilabs.com",
|
||||
"official_website": "https://infinilabs.com",
|
||||
"dependencies": {
|
||||
"@ant-design/charts": "1.4.2",
|
||||
"@ant-design/icons": "^4.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { PureComponent } from "react";
|
||||
import { FormattedMessage, formatMessage } from "umi/locale";
|
||||
import { getWebsitePathByLang } from "@/utils/utils";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
import { Spin, Tag, Menu, Icon, Dropdown, Avatar, Tooltip } from "antd";
|
||||
import moment from "moment";
|
||||
import groupBy from "lodash/groupBy";
|
||||
|
@ -190,7 +190,7 @@ export default class GlobalHeaderRight extends PureComponent {
|
|||
</Menu.Item>
|
||||
<Menu.Item key="release_notes">
|
||||
<a
|
||||
href={`${getWebsitePathByLang()}/docs/latest/console/release-notes`}
|
||||
href={`${getDocPathByLang()}/release-notes`}
|
||||
target="_blank"
|
||||
>
|
||||
<Icon type="sync" />
|
||||
|
@ -199,7 +199,7 @@ export default class GlobalHeaderRight extends PureComponent {
|
|||
</Menu.Item>
|
||||
<Menu.Item key="document">
|
||||
<a
|
||||
href={`${getWebsitePathByLang()}/docs/latest/console/`}
|
||||
href={`${getDocPathByLang()}/`}
|
||||
target="_blank"
|
||||
>
|
||||
<Icon type="read" />
|
||||
|
|
|
@ -5,6 +5,7 @@ import { useEffect, useMemo, useState } from "react";
|
|||
import request from "@/utils/request";
|
||||
import { CopyToClipboard } from "react-copy-to-clipboard";
|
||||
import { formatMessage } from "umi/locale";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
|
||||
export default ({autoInit = false}) => {
|
||||
const { loading, value } = useFetch(`/instance/_search`);
|
||||
|
@ -116,7 +117,7 @@ export default ({autoInit = false}) => {
|
|||
· {formatMessage({
|
||||
id:"agent.install.tips.desc"
|
||||
})}
|
||||
<a href='https://www.infinilabs.com/docs/latest/console/reference/agent/install/' target="_blank">{formatMessage({
|
||||
<a href={`${getDocPathByLang()}/reference/agent/install/`} target="_blank">{formatMessage({
|
||||
id:"agent.install.link.manual_install"
|
||||
})}></a>
|
||||
</p>
|
||||
|
|
|
@ -4,6 +4,7 @@ import styles from "./Version.less";
|
|||
import { DATE_FORMAT } from ".";
|
||||
import { formatMessage } from "umi/locale";
|
||||
import AGPL from "./AGPL";
|
||||
import { getWebsitePathByLang } from "@/utils/utils";
|
||||
const { Paragraph, Text } = Typography;
|
||||
|
||||
export default ({ application, licence }) => {
|
||||
|
@ -39,7 +40,7 @@ export default ({ application, licence }) => {
|
|||
For commercial licensing, contact us at:
|
||||
<ul>
|
||||
<li>Email: hello@infini.ltd</li>
|
||||
<li>Website: <a href="http://www.infinilabs.com" target="_blank">infinilabs.com</a></li>
|
||||
<li>Website: <a href={`${getWebsitePathByLang()}`} target="_blank">infinilabs.com</a></li>
|
||||
</ul>
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Button } from "antd";
|
||||
import { formatMessage } from "umi/locale";
|
||||
import { getWebsitePathByLang } from "@/utils/utils";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
|
||||
interface IProps {
|
||||
height?: string | number;
|
||||
|
@ -26,7 +26,7 @@ export default (props: IProps) => {
|
|||
type="primary"
|
||||
onClick={() =>
|
||||
window.open(
|
||||
`${getWebsitePathByLang()}/docs/latest/console/reference/agent/install/`
|
||||
`${getDocPathByLang()}/reference/agent/install/`
|
||||
)
|
||||
}
|
||||
>
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Button, Card, Icon, message } from "antd";
|
|||
import MessageIcon from "../../../Overview/components/Quick/icons/MessageIcon";
|
||||
import { formatMessage } from "umi/locale";
|
||||
import { Link } from "umi";
|
||||
import { getWebsitePathByLang } from "@/utils/utils";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
import ExportAndImport from "../../components/ExportAndImport";
|
||||
import Import from "../../components/Import";
|
||||
import { useState } from "react";
|
||||
|
@ -63,7 +63,7 @@ export default ({ onSuccess }) => {
|
|||
) : null}
|
||||
|
||||
<a
|
||||
href={`${getWebsitePathByLang()}/docs/latest/console/reference/alerting/rule/`}
|
||||
href={`${getDocPathByLang()}/reference/alerting/rule/`}
|
||||
target="_blank"
|
||||
>
|
||||
<Icon type="file-text" theme="twoTone" />{" "}
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import { Table, Drawer } from "antd";
|
||||
import { formatMessage } from "umi/locale";
|
||||
import { getWebsitePathByLang } from "@/utils/utils";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
import { useState } from "react";
|
||||
import TemplateVariables from "./Template/Variables";
|
||||
|
||||
const VariablesExampleLabel = (props) => {
|
||||
const [varVisible, setVarVisible] = useState(false);
|
||||
const docsLink =
|
||||
APP_DOCS_WEBSITE && APP_DOCS_WEBSITE.indexOf("infinilabs") > -1
|
||||
? `${getWebsitePathByLang()}/docs/latest/console/reference/alerting/variables`
|
||||
: APP_DOCS_WEBSITE;
|
||||
const docsLink = `${getDocPathByLang()}/reference/alerting/variables`;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Group from "@/components/Icons/Group";
|
||||
import GroupBy from "@/components/Icons/GroupBy";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
import { Button, Icon, Input, Switch } from "antd"
|
||||
import { cloneDeep } from "lodash";
|
||||
import { useMemo } from "react";
|
||||
|
@ -84,7 +85,7 @@ export default (props) => {
|
|||
lineHeight: '32px',
|
||||
border: '1px solid #d9d9d9'
|
||||
}}>
|
||||
{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>
|
||||
{formatMessage({ id: "dashboard.widget.config.group.labels.template" })} <a href={`${getDocPathByLang()}/reference/alerting/variables/`} target="_blank"><Icon type="question-circle" /></a>
|
||||
</div>
|
||||
<Input
|
||||
style={{
|
||||
|
|
|
@ -4,6 +4,7 @@ import { Link } from "umi";
|
|||
import gatewayBg from "@/assets/gateway_install_bg.svg";
|
||||
import styles from "./index.less";
|
||||
import { formatMessage } from "umi/locale";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
|
||||
const shell = `curl -sSL https://get.infini.cloud | bash -s -- -p gateway`;
|
||||
|
||||
|
@ -42,7 +43,7 @@ export default () => {
|
|||
· {formatMessage({ id: "gateway.guide.tips.content" })}
|
||||
{` `}
|
||||
<a
|
||||
href="https://www.infinilabs.com/docs/latest/gateway/getting-started/install/"
|
||||
href={`${getDocPathByLang('gateway')}/getting-started/install/`}
|
||||
target={"_blank"}
|
||||
>
|
||||
{`${formatMessage({
|
||||
|
|
|
@ -5,6 +5,7 @@ import { getLocale, formatMessage } from "umi/locale";
|
|||
import { useEffect, useState } from 'react';
|
||||
import request from '@/utils/request';
|
||||
import CardMore from '../CardMore';
|
||||
import { getWebsitePathByLang } from '@/utils/utils';
|
||||
|
||||
export default () => {
|
||||
|
||||
|
@ -39,7 +40,7 @@ export default () => {
|
|||
{formatMessage({ id: "overview.title.product_activities"})}
|
||||
</div>
|
||||
<Card className={styles.content} size="small">
|
||||
<CardMore linkTo="https://www.infinilabs.com/blog/" external={true}/>
|
||||
<CardMore linkTo={`${getWebsitePathByLang()}/blog/`} external={true}/>
|
||||
{
|
||||
loading ? <div style={{ height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center'}}><Spin spinning={true} /></div> : (
|
||||
activities.map((item, index) => (
|
||||
|
|
|
@ -7,7 +7,7 @@ import { formatter } from "@/utils/format";
|
|||
import Table from "@/components/Overview/Detail/Infos/Table";
|
||||
import { Button } from "antd";
|
||||
import { formatMessage } from "umi/locale";
|
||||
import { getWebsitePathByLang } from "@/utils/utils";
|
||||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
|
||||
export default (props) => {
|
||||
const id = props.data?._id;
|
||||
|
@ -46,7 +46,7 @@ export default (props) => {
|
|||
type="primary"
|
||||
onClick={() =>
|
||||
window.open(
|
||||
`${getWebsitePathByLang()}/docs/latest/console/reference/agent/install/`
|
||||
`${getDocPathByLang()}/reference/agent/install/`
|
||||
)
|
||||
}
|
||||
>
|
||||
|
|
|
@ -15,12 +15,11 @@ export function getWebsitePathByLang() {
|
|||
}
|
||||
}
|
||||
|
||||
export function getDocPathByLang() {
|
||||
if (!APP_OFFICIAL_WEBSITE) return;
|
||||
export function getDocPathByLang(product = 'console') {
|
||||
if (getLocale() === "zh-CN") {
|
||||
return APP_OFFICIAL_WEBSITE.replace('.com', '.cn')
|
||||
return `https://infinilabs.cn/docs/latest/${product}`
|
||||
} else {
|
||||
return APP_OFFICIAL_WEBSITE + '/en'
|
||||
return `https://docs.infinilabs.com/${product}/main/docs`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue