Skip to content

Commit

Permalink
feat: Add some notes (higress-group#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO authored Jul 11, 2024
1 parent d3b9f07 commit 142bc0f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
4 changes: 3 additions & 1 deletion frontend/src/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -297,6 +298,7 @@
"createRoute": "Create Route",
"editRoute": "Edit Route",
"deleteConfirmation": "Are you sure you want to delete <1>{{currentRouteName}}</1>?",
"noCustomIngresses": "Note: Only routes created from the console are listed above.",
"factorGroup": {
"columns": {
"key": "Key",
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
"targetDomain": "作用域名:",
"targetRoute": "作用路由:",
"enableStatus": "开启状态",
"dataEditor": "数据编辑器 - YAML"
"dataEditor": "数据编辑器 - YAML",
"globalConfigWarning": "注意:以上配置将会在所有域名和路由上生效。请谨慎配置。"
},
"builtIns": {
"rewrite": {
Expand Down Expand Up @@ -297,6 +298,7 @@
"createRoute": "创建路由",
"editRoute": "编辑路由",
"deleteConfirmation": "确定删除 <1>{{currentRouteName}}</1> 吗?",
"noCustomIngresses": "注:列表中仅包含通过控制台页面创建的路由配置。",
"factorGroup": {
"columns": {
"key": "Key",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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';
import { useRequest } from 'ahooks';
import { t } from 'i18next';
import { useSearchParams } from 'ice';

const { Text } = Typography;

export interface IPluginData {
configurations: object;
enabled: boolean;
Expand Down Expand Up @@ -175,6 +177,11 @@ const GlobalPluginDetail = forwardRef((props: IProps, ref) => {
{!getConfigLoading && !getDataLoading && (
<CodeEditor defaultValue={defaultValue} onChange={(val) => setRawConfigurations(val)} />
)}
{!getConfigLoading && !getDataLoading && !isRoutePlugin && !isDomainPlugin && (
<Space direction="horizontal" style={{ marginTop: "0.5rem" }}>
<Text>{t('plugins.configForm.globalConfigWarning')}</Text>
</Space>
)}
</Form>
</Spin>
</div>
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/pages/route/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down Expand Up @@ -235,6 +237,11 @@ const RouteList: React.FC = () => {
</Row>
</Form>
<Table loading={loading} dataSource={dataSource} columns={columns} pagination={false} />
{!loading && (
<Space direction="horizontal" style={{ width: '100%', justifyContent: 'center', marginTop: '0.5rem' }}>
<Text>{t('route.noCustomIngresses')}</Text>
</Space>
)}
<Modal
title={
<div>
Expand Down

0 comments on commit 142bc0f

Please sign in to comment.