From dba375b29a6d015b6298714d0261eba2cef98278 Mon Sep 17 00:00:00 2001 From: luohoufu Date: Mon, 2 Dec 2024 17:18:51 +0800 Subject: [PATCH] chore: update license to agpl --- web/.gitignore | 1 + web/src/common/.gitignore | 3 +- .../components/GlobalHeader/RightContent.js | 4 +- web/src/components/Licence/AGPL.jsx | 29 ++ web/src/components/Licence/ApplyTrial.jsx | 317 ------------------ web/src/components/Licence/ApplyTrial.scss | 25 -- web/src/components/Licence/Buy.js | 20 -- web/src/components/Licence/Buy.less | 14 - web/src/components/Licence/Features.js | 42 --- web/src/components/Licence/Features.less | 58 ---- web/src/components/Licence/Licence.js | 88 ----- web/src/components/Licence/Licence.less | 51 --- web/src/components/Licence/LicenceDesc.js | 46 --- web/src/components/Licence/Tips.js | 60 ---- web/src/components/Licence/Tips.less | 29 -- web/src/components/Licence/Version.js | 31 +- web/src/components/Licence/Version.less | 5 + web/src/components/Licence/index.js | 111 +----- web/src/components/Licence/index.less | 2 +- web/src/components/SiderMenu/BottomMenu.js | 3 +- web/src/layouts/BasicLayout.js | 10 - web/src/locales/en-US.js | 2 +- web/src/locales/en-US/license.js | 1 + web/src/locales/zh-CN.js | 2 +- web/src/locales/zh-CN/license.js | 1 + web/src/models/global.js | 9 - web/src/services/api.js | 4 - 27 files changed, 74 insertions(+), 894 deletions(-) create mode 100644 web/src/components/Licence/AGPL.jsx delete mode 100644 web/src/components/Licence/ApplyTrial.jsx delete mode 100644 web/src/components/Licence/ApplyTrial.scss delete mode 100644 web/src/components/Licence/Buy.js delete mode 100644 web/src/components/Licence/Buy.less delete mode 100644 web/src/components/Licence/Features.js delete mode 100644 web/src/components/Licence/Features.less delete mode 100644 web/src/components/Licence/Licence.js delete mode 100644 web/src/components/Licence/Licence.less delete mode 100644 web/src/components/Licence/LicenceDesc.js delete mode 100644 web/src/components/Licence/Tips.js delete mode 100644 web/src/components/Licence/Tips.less diff --git a/web/.gitignore b/web/.gitignore index a3c11f48..a40ed7fa 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -35,3 +35,4 @@ log/ .env /web/ .github +src/common*/ diff --git a/web/src/common/.gitignore b/web/src/common/.gitignore index 34663306..800f3a80 100644 --- a/web/src/common/.gitignore +++ b/web/src/common/.gitignore @@ -10,6 +10,7 @@ # production /build +/dist # misc .DS_Store @@ -21,5 +22,3 @@ npm-debug.log* yarn-debug.log* yarn-error.log* - -/dist \ No newline at end of file diff --git a/web/src/components/GlobalHeader/RightContent.js b/web/src/components/GlobalHeader/RightContent.js index 180cbe26..3ef4c16c 100644 --- a/web/src/components/GlobalHeader/RightContent.js +++ b/web/src/components/GlobalHeader/RightContent.js @@ -208,10 +208,10 @@ export default class GlobalHeaderRight extends PureComponent { - + diff --git a/web/src/components/Licence/AGPL.jsx b/web/src/components/Licence/AGPL.jsx new file mode 100644 index 00000000..550981a4 --- /dev/null +++ b/web/src/components/Licence/AGPL.jsx @@ -0,0 +1,29 @@ +export default () => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/web/src/components/Licence/ApplyTrial.jsx b/web/src/components/Licence/ApplyTrial.jsx deleted file mode 100644 index d8da57ba..00000000 --- a/web/src/components/Licence/ApplyTrial.jsx +++ /dev/null @@ -1,317 +0,0 @@ -import request from "@/utils/request"; -import { - Modal, - Checkbox, - Button, - Form, - Icon, - Input, - message, - Alert, - Divider, -} from "antd"; -import { useEffect, useMemo, useState } from "react"; -import { formatMessage, getLocale } from "umi/locale"; -import { getWebsitePathByLang } from "@/utils/utils"; -import "./ApplyTrial.scss"; -import LicenceDesc from "./LicenceDesc"; - -const { TextArea } = Input; - -const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, -}; - -const tailFormItemLayout = { - wrapperCol: { - xs: { - span: 24, - offset: 0, - }, - sm: { - span: 16, - offset: 6, - }, - }, -}; - -const tipsFormItemLayout = { - wrapperCol: { - xs: { - span: 24, - offset: 0, - }, - sm: { - span: 20, - offset: 2, - }, - }, -}; - -export default Form.create()((props) => { - const { form, onLicenceUpdate } = props; - const { getFieldDecorator } = form; - const [visible, setVisible] = useState(false); - const [loading, setLoading] = useState(false); - const defaultState = { - status: -1, - error_msg: "", - licensed: false, - }; - const [state, setState] = useState(defaultState); - - const onSubmit = () => { - form.validateFields(async (err, values) => { - if (err) { - return false; - } - setLoading(true); - - const res = await request(`/_license/request_trial?lang=${getLocale()}`, { - method: "POST", - body: values, - }); - if (res?.acknowledged) { - let ack = { status: 1 }; - if (res?.license) { - ack.licensed = true; - onLicenceUpdate(); - } - setState({ ...state, ...ack }); - } else { - let error_msg = ""; - if (typeof res === "undefined") { - error_msg = "Request timeout or network problem"; - } else if (res?.error?.reason) { - error_msg = res.error.reason; - } - setState({ ...state, status: 0, error_msg: error_msg }); - } - setLoading(false); - }); - }; - - const onClose = () => { - props.onClose(); //close parent modal - setVisible(false); - setState({ ...state, ...defaultState }); - }; - - return ( - <> - - - {state.status === -1 ? ( -
- -
- - - {formatMessage({ - id: "license.label.apply.trial_tips", - })} - -
-
- - - {getFieldDecorator("organization", { - initialValue: "", - rules: [ - { - required: true, - message: formatMessage({ - id: "license.label.apply.organization.required", - }), - }, - ], - })()} - - - {getFieldDecorator("contact", { - initialValue: "", - rules: [ - { - required: true, - message: formatMessage({ - id: "license.label.apply.contact.required", - }), - }, - ], - })()} - - - {getFieldDecorator("email", { - initialValue: "", - rules: [ - { - type: "email", - message: formatMessage({ - id: "license.label.apply.email.valid", - }), - }, - { - required: true, - message: formatMessage({ - id: "license.label.apply.email.required", - }), - }, - ], - })( - - )} - - - {getFieldDecorator("phone", { - initialValue: "", - rules: [ - { - required: true, - message: formatMessage({ - id: "license.label.apply.phone.required", - }), - }, - ], - })()} - - - - - - - {getFieldDecorator("agreement", { - valuePropName: "checked", - rules: [ - { - required: true, - message: formatMessage({ - id: "license.label.agree.required", - }), - }, - ], - })( - - {formatMessage({ id: "license.label.agree" })}{" "} - - {formatMessage({ id: "license.label.agreement" })} - - - )} - -
- ) : null} - {state.status === 0 ? ( -
- - {state.error_msg ? ( - - ) : null} - -
- {formatMessage({ id: "license.label.apply.submit.failed.tips" })} -
-
- {formatMessage({ - id: "license.label.apply.submit.official_website.link", - })} - {`${APP_OFFICIAL_WEBSITE}/company/contact`} -
-
- ) : null} - {state.status === 1 ? ( -
- -
- {formatMessage({ - id: "license.label.apply.submit.successfully.tips", - })} -
-
- {state.licensed && props.licence?.license_type ? ( - <> - - {formatMessage({ - id: "license.label.apply.submit.divider", - })} - -
- -
- - ) : null} -
-
- ) : null} -
- - ); -}); diff --git a/web/src/components/Licence/ApplyTrial.scss b/web/src/components/Licence/ApplyTrial.scss deleted file mode 100644 index 1631d142..00000000 --- a/web/src/components/Licence/ApplyTrial.scss +++ /dev/null @@ -1,25 +0,0 @@ -.apply-trial-modal { - .ant-modal-header { - .ant-modal-title { - text-align: center; - color: #1890ff; - } - } - .tips-wrap { - line-height: 24px; - .tips-text { - padding-left: 5px; - } - } - .status-content { - min-height: 305px; - display: flex; - align-items: center; - justify-content: center; - flex-flow: column; - gap: 15px; - .successfully-tips { - word-break: break-all; - } - } -} diff --git a/web/src/components/Licence/Buy.js b/web/src/components/Licence/Buy.js deleted file mode 100644 index 29afa9fd..00000000 --- a/web/src/components/Licence/Buy.js +++ /dev/null @@ -1,20 +0,0 @@ -import { Button } from "antd"; -import styles from "./Buy.less"; -import { formatMessage } from "umi/locale"; -import ApplyTrial from "./ApplyTrial"; - -export default (props) => { - return APP_OFFICIAL_WEBSITE ? ( -
- {props?.trialVisible ? : null} - - -
- ) : null; -}; diff --git a/web/src/components/Licence/Buy.less b/web/src/components/Licence/Buy.less deleted file mode 100644 index 274c7cd4..00000000 --- a/web/src/components/Licence/Buy.less +++ /dev/null @@ -1,14 +0,0 @@ -.buy { - text-align: right; - margin-bottom: 16px; - - display: flex; - gap: 10px; - justify-content: right; - - :global { - .ant-btn { - padding: 0 15px; - } - } -} diff --git a/web/src/components/Licence/Features.js b/web/src/components/Licence/Features.js deleted file mode 100644 index f1a40ec9..00000000 --- a/web/src/components/Licence/Features.js +++ /dev/null @@ -1,42 +0,0 @@ -import { Button, Icon, Descriptions, Result } from 'antd'; -import styles from './Features.less'; -import { LICENCE_ROUTES, FEATURES, checkLicenceType } from '.' -import { formatMessage } from "umi/locale"; - -export default ({ licence }) => { - - const { license_type, expire_at } = licence; - - return ( -
- - { - FEATURES.map((item, index) => { - const isAllowed = - checkLicenceType(license_type, expire_at) || - !item.route || - LICENCE_ROUTES.every((r) => !r.includes(item.route)) - return ( - - {item.name} - - ) - }) - } - - )} - > - {formatMessage({ id: 'license.feature.more' })}··· - - -
- ) -} \ No newline at end of file diff --git a/web/src/components/Licence/Features.less b/web/src/components/Licence/Features.less deleted file mode 100644 index 3cc79424..00000000 --- a/web/src/components/Licence/Features.less +++ /dev/null @@ -1,58 +0,0 @@ -.features { - margin-top: 12px; - margin-bottom: 12px; - padding: 12px; - background-color: #f7f9fc; - - :global { - .ant-descriptions-title { - text-align: center; - margin-bottom: 12px; - } - - .ant-descriptions-row > th, .ant-descriptions-row > td { - padding-bottom: 8px; - vertical-align: top; - - .ant-descriptions-item-content { - word-break: break-all; - } - } - } - - .default { - - :global { - .ant-descriptions-item-content { - font-weight: 400; - font-size: 14px; - color: #bbb; - padding-right: 4px; - } - - } - - &.allow { - :global { - .ant-descriptions-item-content { - color: #575757; - } - } - - .icon { - background-color: #27b148; - } - } - - } - - .icon { - width: 6px; - height: 6px; - background-color: #bbb; - display: inline-block; - border-radius: 50%; - vertical-align: 2px; - margin-right: 4px; - } -} \ No newline at end of file diff --git a/web/src/components/Licence/Licence.js b/web/src/components/Licence/Licence.js deleted file mode 100644 index 42cf3f16..00000000 --- a/web/src/components/Licence/Licence.js +++ /dev/null @@ -1,88 +0,0 @@ -import styles from "./Licence.less"; -import { Icon, Input, Button, Descriptions, message } from "antd"; -import { forwardRef, useImperativeHandle, useEffect, useState } from "react"; -import { DATE_FORMAT } from "."; -import moment from "moment"; -import request from "@/utils/request"; -import { formatMessage } from "umi/locale"; -import LicenceDesc from "./LicenceDesc"; - -export default ({ licence, onLicenceUpdate }, ref) => { - const { - license_type, - license_id, - issue_to = "-", - issue_at, - valid_from, - expire_at, - max_nodes = "-", - } = licence || {}; - - const [isEdit, setIsEdit] = useState(false); - const [code, setCode] = useState(); - const [loading, setLoading] = useState(false); - - const onUpdate = async () => { - if (code) { - setLoading(true); - const res = await request( - "/_license/apply", - { - method: "POST", - body: { license: code }, - }, - undefined, - false - ); - if (res?.acknowledged) { - message.success("Licence update succeeded."); - setIsEdit(false); - onLicenceUpdate(); - } else { - message.error("Licence update failed."); - } - setLoading(false); - } - }; - - useImperativeHandle(ref, () => ({ - resetCode: () => { - setIsEdit(false); - setCode(); - }, - })); - - return ( -
-
- -
-
- {isEdit ? ( - setCode(e.target.value)} - autoFocus - /> - ) : ( -
- setIsEdit(true)}> - - -
- )} -
-
- -
-
- ); -}; diff --git a/web/src/components/Licence/Licence.less b/web/src/components/Licence/Licence.less deleted file mode 100644 index b9f7602d..00000000 --- a/web/src/components/Licence/Licence.less +++ /dev/null @@ -1,51 +0,0 @@ -.licence { - .header { - :global { - .ant-descriptions-title { - margin-bottom: 8px; - } - - .ant-descriptions-item { - padding-bottom: 4px; - } - } - } - - .licenceBox { - height: 133px; - background-color: #f7f9fc; - margin-top: 12px; - margin-bottom: 12px; - overflow-y: hidden; - font-weight: 400; - font-size: 14px; - color: rgba(187, 187, 187, 1); - padding: 8px; - display: flex; - justify-self: center; - align-items: center; - - .edit { - width: 100%; - text-align: center; - margin-top: 4px; - - :global { - .anticon { - font-size: 22px; - } - } - } - } - - .footer { - text-align: right; - margin-bottom: 16px; - - :global { - .ant-btn { - padding: 0 15px; - } - } - } -} diff --git a/web/src/components/Licence/LicenceDesc.js b/web/src/components/Licence/LicenceDesc.js deleted file mode 100644 index d6d1f5b2..00000000 --- a/web/src/components/Licence/LicenceDesc.js +++ /dev/null @@ -1,46 +0,0 @@ -import { Descriptions } from "antd"; -import { formatMessage } from "umi/locale"; -import { DATE_FORMAT } from "."; -import moment from "moment"; - -export default ({ licence }) => { - const { - license_type, - license_id, - issue_to = "-", - issue_at, - valid_from, - expire_at, - max_nodes = "-", - } = licence || {}; - - return ( - - - {license_type} - - - {max_nodes} - - - {issue_to} - - - {issue_at ? moment(issue_at).format(DATE_FORMAT) : "-"} - - - {expire_at ? moment(expire_at).format(DATE_FORMAT) : "-"} - - - ); -}; diff --git a/web/src/components/Licence/Tips.js b/web/src/components/Licence/Tips.js deleted file mode 100644 index 9a9973bf..00000000 --- a/web/src/components/Licence/Tips.js +++ /dev/null @@ -1,60 +0,0 @@ -import { useEffect, useMemo, useState } from "react"; -import { Icon, Result } from "antd"; -import moment from "moment"; -import styles from "./Tips.less"; -import Features from "./Features"; -import Buy from "./Buy"; -import { formatMessage } from "umi/locale"; -import { LICENCE_ROUTES } from "."; - -export default (props) => { - const licence = props.licence; - const { license_type, expire_at } = licence; - const needProLicense = LICENCE_ROUTES.some((item) => - props.location.pathname.includes(item) - ); - - const renderHeader = () => { - if (moment(expire_at).diff(moment(), "seconds") < 0) { - return ( - } - /> - ); - } - - //pro Edition - if (needProLicense) { - return ( - } - /> - ); - } - return ( - } - /> - ); - }; - - return ( -
-
{renderHeader()}
- - -
- ); -}; diff --git a/web/src/components/Licence/Tips.less b/web/src/components/Licence/Tips.less deleted file mode 100644 index 3911cc02..00000000 --- a/web/src/components/Licence/Tips.less +++ /dev/null @@ -1,29 +0,0 @@ -.tips { - .header { - .content { - padding: 8px 0px; - - :global { - .ant-result-icon { - margin-bottom: 8px; - .anticon { - font-size: 34px; - } - } - - .ant-result-title { - font-size: 18px; - color: #101010; - font-weight: 700; - margin-bottom: 4px; - } - - .ant-result-subtitle { - color: #5f5f5f; - font-weight: 400; - } - } - } - } - -} \ No newline at end of file diff --git a/web/src/components/Licence/Version.js b/web/src/components/Licence/Version.js index 0ccdc6d3..34df1294 100644 --- a/web/src/components/Licence/Version.js +++ b/web/src/components/Licence/Version.js @@ -1,10 +1,10 @@ -import { Descriptions } from "antd"; +import { Descriptions, Icon, Typography } from "antd"; import moment from "moment"; import styles from "./Version.less"; import { DATE_FORMAT } from "."; -import Features from "./Features"; -import Buy from "./Buy"; import { formatMessage } from "umi/locale"; +import AGPL from "./AGPL"; +const { Paragraph, Text } = Typography; export default ({ application, licence }) => { const { number, build_date, build_hash } = application?.version || {}; @@ -26,8 +26,29 @@ export default ({ application, licence }) => { {build_hash} - - +
+ +
+
+ + Copyright (C) INFINI Labs & INFINI LIMITED. + + The INFINI Console is offered under the GNU Affero General Public License v3.0 and as commercial software. + + For commercial licensing, contact us at: + + + + Open Source licensed under AGPL V3: +
+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + {`You should have received a copy of the GNU Affero General Public License along with this program. If not, see .`} +
); }; diff --git a/web/src/components/Licence/Version.less b/web/src/components/Licence/Version.less index b50ea532..5360d7ef 100644 --- a/web/src/components/Licence/Version.less +++ b/web/src/components/Licence/Version.less @@ -10,4 +10,9 @@ } } } + .licence { + word-break: break-all; + p { + } + } } \ No newline at end of file diff --git a/web/src/components/Licence/index.js b/web/src/components/Licence/index.js index 8495ff8d..c8ffae11 100644 --- a/web/src/components/Licence/index.js +++ b/web/src/components/Licence/index.js @@ -9,86 +9,26 @@ import React, { import { Tabs, Modal } from "antd"; import styles from "./index.less"; import Version from "./Version"; -import Tips from "./Tips"; -import Licence from "./Licence"; import moment from "moment"; import { formatMessage } from "umi/locale"; export const DATE_FORMAT = "YYYY.MM.DD HH:mm"; -export const LICENCE_ROUTES = ["/data_tools", "/alerting/channel"]; -export const LICENCE_NOOPEN_ROUTES = ["/", "/overview"]; - -export const FEATURES = [ - { name: formatMessage({ id: "license.feature.multi_cluster_access" }) }, - { name: formatMessage({ id: "license.feature.multi_cluster_manage" }) }, - { name: formatMessage({ id: "license.feature.log_audit" }) }, - { name: formatMessage({ id: "license.feature.query_analysis" }) }, - { name: formatMessage({ id: "license.feature.visual_analysis" }) }, - { name: formatMessage({ id: "license.feature.platform_monitoring" }) }, - { name: formatMessage({ id: "license.feature.identity_control" }) }, - { - name: formatMessage({ id: "license.feature.alarm_notification" }), - route: "/alerting", - }, - { - name: formatMessage({ id: "license.feature.data_migration" }), - route: "/data_tools", - }, - { - name: formatMessage({ id: "license.feature.data_backup" }), - route: "/data_tools", - }, - { - name: formatMessage({ id: "license.feature.data_disaster_recovery" }), - route: "/data_tools", - }, -]; - -export const checkLicenceType = (licenceType, expireAt, isProEdition) => { - if (isProEdition) { - if ( - !licenceType || - licenceType === "UnLicensed" || - licenceType === "Free" || - !expireAt - ) - return false; - } else { - if (!licenceType || licenceType === "UnLicensed" || !expireAt) return false; - } - - if (moment(expireAt).diff(moment(), "seconds") > 0) return true; - return false; -}; - const tabs = [ { key: "version", title: formatMessage({ id: "license.tab.version.title" }), component: Version, }, - { - key: "tips", - title: formatMessage({ id: "license.tab.tips.title" }), - component: Tips, - }, - { - key: "licence", - title: formatMessage({ id: "license.tab.license.title" }), - component: Licence, - }, ]; export default forwardRef((props, ref) => { const [visible, setVisible] = useState(false); - const [isTips, setIsTips] = useState(false); const triggerTimeRef = useRef(null); const tabRef = useRef(null); const { location: { pathname }, - licence: { license_type, expire_at, loading }, } = props; useImperativeHandle(ref, () => ({ @@ -96,63 +36,18 @@ export default forwardRef((props, ref) => { close: onClose, })); - const onOpen = (isTips) => { + const onOpen = () => { const isFirstLogin = localStorage.getItem("first-login"); if (isFirstLogin !== "true") { - setIsTips(isTips); setVisible(true); } }; const onClose = () => { - setIsTips(); setVisible(); if (tabRef.current.resetCode) tabRef.current.resetCode(); }; - const checkRoutes = (license_type, expire_at, is_pro) => { - if (checkLicenceType(license_type, expire_at, is_pro)) { - return; - } - if (triggerTimeRef.current) { - const now = moment(); - if (now.diff(triggerTimeRef.current, "seconds") > 60) { - //未授权时每1分钟弹窗提示 - onOpen(true); - triggerTimeRef.current = now; - } - } else { - onOpen(true); - triggerTimeRef.current = moment(); - } - }; - - useEffect(() => { - if (loading) { - return; - } - - //home overview do not open license window - if (LICENCE_NOOPEN_ROUTES.includes(props.location.pathname)) { - return; - } - if (LICENCE_ROUTES.some((item) => props.location.pathname.includes(item))) { - //pro Edition - checkRoutes(license_type, expire_at, true); - } else { - //all routes check(except pro Edition) - checkRoutes(license_type, expire_at); - } - }, [pathname, license_type, expire_at, loading]); - - const formatTabs = useMemo(() => { - return tabs.filter((item) => { - if (isTips && item.key === "version") return false; - if (!isTips && item.key === "tips") return false; - return true; - }); - }, [isTips]); - return ( { footer={null} onCancel={onClose} destroyOnClose - width={560} + width={580} > - {formatTabs.map((item) => ( + {tabs.map((item) => (
{item.component({ ...props, onClose }, tabRef)} diff --git a/web/src/components/Licence/index.less b/web/src/components/Licence/index.less index 41807c1b..de74b2bf 100644 --- a/web/src/components/Licence/index.less +++ b/web/src/components/Licence/index.less @@ -2,7 +2,7 @@ :global { .ant-modal-body { - padding: 20px 0 0 0; + padding: 0px 0 0 0; .ant-tabs-top-bar { justify-content: center; diff --git a/web/src/components/SiderMenu/BottomMenu.js b/web/src/components/SiderMenu/BottomMenu.js index a1d9b018..95c6b303 100644 --- a/web/src/components/SiderMenu/BottomMenu.js +++ b/web/src/components/SiderMenu/BottomMenu.js @@ -3,6 +3,7 @@ import { Menu, Icon } from 'antd'; import styles from './BottomMenu.less'; import Debounce from "lodash-decorators/debounce"; import Licence from "@/components/Licence"; +import { formatMessage } from "umi/locale"; export default class BottomMenu extends PureComponent { @@ -23,7 +24,7 @@ export default class BottomMenu extends PureComponent { const { theme, collapsed, global: { consoleInfo = {}, consoleLicence = {} }, onLicenceShow } = this.props; - const text = `${consoleLicence.license_type} (${consoleInfo?.application?.version?.number})` + const text = `${formatMessage({ id: "license.menu.label" })} (${consoleInfo?.application?.version?.number})` return (
diff --git a/web/src/layouts/BasicLayout.js b/web/src/layouts/BasicLayout.js index b1fb145a..30348ebe 100644 --- a/web/src/layouts/BasicLayout.js +++ b/web/src/layouts/BasicLayout.js @@ -166,8 +166,6 @@ class BasicLayout extends React.PureComponent { type: "global/fetchConsoleInfo", }); - this.fetchConsoleLicence(); - this.renderRef = requestAnimationFrame(() => { this.setState({ rendering: false, @@ -339,13 +337,6 @@ class BasicLayout extends React.PureComponent { return ; } - fetchConsoleLicence = () => { - const { dispatch } = this.props; - dispatch({ - type: "global/fetchConsoleLicence", - }); - }; - render() { this.init(); @@ -437,7 +428,6 @@ class BasicLayout extends React.PureComponent { version={this.props.global.consoleInfo?.application} licence={this.props.global.consoleLicence} location={this.props.location} - onLicenceUpdate={this.fetchConsoleLicence} /> ); diff --git a/web/src/locales/en-US.js b/web/src/locales/en-US.js index 4dd9c66e..2869de7e 100644 --- a/web/src/locales/en-US.js +++ b/web/src/locales/en-US.js @@ -310,7 +310,7 @@ export default { "menu.header.help.official_website": "Official website", "menu.header.help.release_notes": "Release notes", "menu.header.help.document": "Documentation", - "menu.header.help.ticket": "Request support", + "menu.header.help.ticket": "Report issue", "app.message.operate.success": "Operate successfully", "app.message.operate.failed": "Operate failure", diff --git a/web/src/locales/en-US/license.js b/web/src/locales/en-US/license.js index e2c60166..858cd969 100644 --- a/web/src/locales/en-US/license.js +++ b/web/src/locales/en-US/license.js @@ -1,4 +1,5 @@ export default { + "license.menu.label": "About", "license.tab.version.title": "Version", "license.tab.tips.title": "License Tips", "license.tab.license.title": "License", diff --git a/web/src/locales/zh-CN.js b/web/src/locales/zh-CN.js index d04c4036..a8a93a3f 100644 --- a/web/src/locales/zh-CN.js +++ b/web/src/locales/zh-CN.js @@ -315,7 +315,7 @@ export default { "menu.header.help.official_website": "官方网站", "menu.header.help.release_notes": "更新日志", "menu.header.help.document": "产品文档", - "menu.header.help.ticket": "提交工单", + "menu.header.help.ticket": "提交问题", "app.message.operate.success": "操作成功", "app.message.operate.failed": "操作失败", diff --git a/web/src/locales/zh-CN/license.js b/web/src/locales/zh-CN/license.js index f88f919a..306081d0 100644 --- a/web/src/locales/zh-CN/license.js +++ b/web/src/locales/zh-CN/license.js @@ -1,4 +1,5 @@ export default { + "license.menu.label": "关于", "license.tab.version.title": "版本信息", "license.tab.tips.title": "授权提示", "license.tab.license.title": "授权信息", diff --git a/web/src/models/global.js b/web/src/models/global.js index 7d5885dd..5235d90d 100644 --- a/web/src/models/global.js +++ b/web/src/models/global.js @@ -2,7 +2,6 @@ import { queryNotices, clearNotices, queryConsoleInfo, - queryConsoleLicence, } from "@/services/api"; import { message } from "antd"; import { searchClusterConfig, getClusterStatus } from "@/services/cluster"; @@ -291,14 +290,6 @@ export default { payload: data, }); }, - - *fetchConsoleLicence(_, { call, put }) { - const data = yield call(queryConsoleLicence); - yield put({ - type: "saveConsoleLicence", - payload: data || {}, - }); - }, }, reducers: { diff --git a/web/src/services/api.js b/web/src/services/api.js index 531ea3a3..0706519b 100644 --- a/web/src/services/api.js +++ b/web/src/services/api.js @@ -5,10 +5,6 @@ export async function queryConsoleInfo() { return request("/_info"); } -export async function queryConsoleLicence() { - return request("/_license/info"); -} - export async function queryProjectNotice() { return request("/api/project/notice"); }