diff --git a/frontend/src/locales/en-US/translation.json b/frontend/src/locales/en-US/translation.json index eb0e3cbc..0e9ac1c1 100644 --- a/frontend/src/locales/en-US/translation.json +++ b/frontend/src/locales/en-US/translation.json @@ -117,7 +117,8 @@ "targetDomain": "Target Domain: ", "targetRoute": "Target Route: ", "enableStatus": "Enabled", - "dataEditor": "Configuration Editor - YAML" + "dataEditor": "Configuration Editor - YAML", + "globalConfigWarning": "Note: Configurations above will be applied to all domains the routes. Please edit with caution." }, "builtIns": { "rewrite": { @@ -297,6 +298,7 @@ "createRoute": "Create Route", "editRoute": "Edit Route", "deleteConfirmation": "Are you sure you want to delete <1>{{currentRouteName}}?", + "noCustomIngresses": "Note: Only routes created from the console are listed above.", "factorGroup": { "columns": { "key": "Key", diff --git a/frontend/src/locales/zh-CN/translation.json b/frontend/src/locales/zh-CN/translation.json index 2f1295ee..6dd0a786 100644 --- a/frontend/src/locales/zh-CN/translation.json +++ b/frontend/src/locales/zh-CN/translation.json @@ -117,7 +117,8 @@ "targetDomain": "作用域名:", "targetRoute": "作用路由:", "enableStatus": "开启状态", - "dataEditor": "数据编辑器 - YAML" + "dataEditor": "数据编辑器 - YAML", + "globalConfigWarning": "注意:以上配置将会在所有域名和路由上生效。请谨慎配置。" }, "builtIns": { "rewrite": { @@ -297,6 +298,7 @@ "createRoute": "创建路由", "editRoute": "编辑路由", "deleteConfirmation": "确定删除 <1>{{currentRouteName}} 吗?", + "noCustomIngresses": "注:列表中仅包含通过控制台页面创建的路由配置。", "factorGroup": { "columns": { "key": "Key", diff --git a/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx b/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx index 6bb8918b..49deb171 100644 --- a/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx +++ b/frontend/src/pages/plugin/components/PluginDrawer/GlobalPluginDetail.tsx @@ -1,5 +1,5 @@ import CodeEditor from '@/components/CodeEditor'; -import { Alert, Divider, Form, Spin, Switch, message } from 'antd'; +import { Alert, Divider, Form, Spin, Switch, message, Space, Typography } from 'antd'; import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from 'react'; import * as servicesApi from '@/services'; @@ -7,6 +7,8 @@ import { useRequest } from 'ahooks'; import { t } from 'i18next'; import { useSearchParams } from 'ice'; +const { Text } = Typography; + export interface IPluginData { configurations: object; enabled: boolean; @@ -175,6 +177,11 @@ const GlobalPluginDetail = forwardRef((props: IProps, ref) => { {!getConfigLoading && !getDataLoading && ( setRawConfigurations(val)} /> )} + {!getConfigLoading && !getDataLoading && !isRoutePlugin && !isDomainPlugin && ( + + {t('plugins.configForm.globalConfigWarning')} + + )} diff --git a/frontend/src/pages/route/index.tsx b/frontend/src/pages/route/index.tsx index b0d2b3e4..54d83195 100644 --- a/frontend/src/pages/route/index.tsx +++ b/frontend/src/pages/route/index.tsx @@ -11,12 +11,14 @@ import store from '@/store'; import { ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-layout'; import { useRequest } from 'ahooks'; -import { Alert, Button, Col, Drawer, Form, Modal, Row, Space, Table } from 'antd'; +import { Alert, Button, Col, Drawer, Form, Modal, Row, Space, Table, Typography } from 'antd'; import { history } from 'ice'; import React, { useEffect, useRef, useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import RouteForm from './components/RouteForm'; +const { Text } = Typography; + interface RouteFormProps { name: string; domains: string[]; @@ -235,6 +237,11 @@ const RouteList: React.FC = () => { + {!loading && ( + + {t('route.noCustomIngresses')} + + )}