diff --git a/ui/src/components/TopoComponent/index.tsx b/ui/src/components/TopoComponent/index.tsx index 4ecee9abf..9a1a4e6f2 100644 --- a/ui/src/components/TopoComponent/index.tsx +++ b/ui/src/components/TopoComponent/index.tsx @@ -9,12 +9,12 @@ import { ReactElement, useEffect, useMemo, useRef, useState } from 'react'; import showDeleteConfirm from '@/components/customModal/DeleteModal'; import OperateModal from '@/components/customModal/OperateModal'; +import { RESULT_STATUS } from '@/constants'; import BasicInfo from '@/pages/Cluster/Detail/Overview/BasicInfo'; import { deleteObcluster, deleteObzone, getClusterDetailReq } from '@/services'; import { getNSName } from '../../pages/Cluster/Detail/Overview/helper'; import { ReactNode, config } from './G6register'; import type { OperateTypeLabel } from './constants'; -import { RESULT_STATUS } from '@/constants'; import { clusterOperate, clusterOperateOfTenant, @@ -49,13 +49,13 @@ export default function TopoComponent({ const [inNode, setInNode] = useState(false); const [inModal, setInModal] = useState(false); const [operateDisable, setOperateDisable] = useState(false); - + const [[ns, name]] = useState( namespace && clusterNameOfKubectl ? [namespace, clusterNameOfKubectl] : getNSName(), ); - + //Control the visibility of operation and maintenance modal const [operateModalVisible, setOperateModalVisible] = useState(false); @@ -116,7 +116,13 @@ export default function TopoComponent({ zoneName: chooseZoneName.current, }); if (res.successful) { - message.success(res.message || '删除成功'); + message.success( + res.message || + intl.formatMessage({ + id: 'Dashboard.components.TopoComponent.DeletedSuccessfully', + defaultMessage: '删除成功', + }), + ); getTopoData({ ns, name, useFor: 'topo', tenantReplicas }); } }; @@ -289,10 +295,11 @@ export default function TopoComponent({ : originTopoData && ( )} +
{useMemo( () => ( diff --git a/ui/src/i18n/strings/en-US.json b/ui/src/i18n/strings/en-US.json index f860871b8..ff22b94a6 100644 --- a/ui/src/i18n/strings/en-US.json +++ b/ui/src/i18n/strings/en-US.json @@ -629,5 +629,11 @@ "Dashboard.Detail.Overview.Replicas.ClogDiskSize": "Clog disk size", "Dashboard.Detail.Overview.Replicas.ResourcePool": "Resource Pool", "Dashboard.Detail.Overview.Replicas.ResourcePoolReplicazone": "Resource pool-{replicaZone}", - "Dashboard.Detail.Overview.TenantOverview": "Tenant overview" + "Dashboard.Detail.Overview.TenantOverview": "Tenant overview", + "Dashboard.Cluster.New.Topo.TheFirstCharacterMustBe": "The first character must be a letter or an underscore and cannot contain-", + "Dashboard.Detail.Overview.Replicas.DeletedSuccessfully": "Deleted successfully", + "Dashboard.Detail.Overview.Replicas.Edit": "Edit", + "Dashboard.Detail.Overview.Replicas.AreYouSureYouWant": "Are you sure you want to delete the tenant's resource pool on {replicaZone}?", + "Dashboard.Detail.Overview.Replicas.Delete": "Delete", + "Dashboard.components.TopoComponent.DeletedSuccessfully": "Deleted successfully" } diff --git a/ui/src/i18n/strings/zh-CN.json b/ui/src/i18n/strings/zh-CN.json index 8783de191..219819b16 100644 --- a/ui/src/i18n/strings/zh-CN.json +++ b/ui/src/i18n/strings/zh-CN.json @@ -629,5 +629,11 @@ "Dashboard.Detail.Overview.Replicas.ClogDiskSize": "Clog 盘大小", "Dashboard.Detail.Overview.Replicas.ResourcePool": "资源池", "Dashboard.Detail.Overview.Replicas.ResourcePoolReplicazone": "资源池 - {replicaZone}", - "Dashboard.Detail.Overview.TenantOverview": "租户概览" + "Dashboard.Detail.Overview.TenantOverview": "租户概览", + "Dashboard.Cluster.New.Topo.TheFirstCharacterMustBe": "首字符必须是字母或者下划线,不能包含 -", + "Dashboard.Detail.Overview.Replicas.DeletedSuccessfully": "删除成功", + "Dashboard.Detail.Overview.Replicas.Edit": "编辑", + "Dashboard.Detail.Overview.Replicas.AreYouSureYouWant": "确定要删除该租户在{replicaZone}上的资源池吗?", + "Dashboard.Detail.Overview.Replicas.Delete": "删除", + "Dashboard.components.TopoComponent.DeletedSuccessfully": "删除成功" } diff --git a/ui/src/pages/Cluster/New/Topo.tsx b/ui/src/pages/Cluster/New/Topo.tsx index b3a40d751..a8e40304a 100644 --- a/ui/src/pages/Cluster/New/Topo.tsx +++ b/ui/src/pages/Cluster/New/Topo.tsx @@ -1,15 +1,15 @@ import { intl } from '@/utils/intl'; -import { DeleteOutlined,PlusOutlined } from '@ant-design/icons'; +import { DeleteOutlined, PlusOutlined } from '@ant-design/icons'; import type { FormInstance } from 'antd'; import { -Button, -Card, -Col, -Form, -Input, -InputNumber, -Popconfirm, -Row, + Button, + Card, + Col, + Form, + Input, + InputNumber, + Popconfirm, + Row, } from 'antd'; import NodeSelector from '@/components/NodeSelector'; @@ -61,7 +61,11 @@ export default function Topo({ form }: { form: FormInstance }) { }, { pattern: TZ_NAME_REG, - message: '首字符必须是字母或者下划线,不能包含 -', + message: intl.formatMessage({ + id: 'Dashboard.Cluster.New.Topo.TheFirstCharacterMustBe', + defaultMessage: + '首字符必须是字母或者下划线,不能包含 -', + }), }, resourceNameRule, ]} diff --git a/ui/src/pages/Tenant/Detail/Overview/Replicas.tsx b/ui/src/pages/Tenant/Detail/Overview/Replicas.tsx index 33752de3b..888fd043c 100644 --- a/ui/src/pages/Tenant/Detail/Overview/Replicas.tsx +++ b/ui/src/pages/Tenant/Detail/Overview/Replicas.tsx @@ -3,16 +3,15 @@ import showDeleteConfirm from '@/components/customModal/DeleteModal'; import { getNSName } from '@/pages/Cluster/Detail/Overview/helper'; import { deleteObtenantPool } from '@/services/tenant'; import { intl } from '@/utils/intl'; -import { Button,Col,Descriptions,message } from 'antd'; -import type { ClusterNSName } from '.'; +import { Button, Col, Descriptions, message } from 'antd'; import styles from './index.less'; export default function Replicas({ replicaList, - refreshTenant + refreshTenant, }: { replicaList: API.ReplicaDetailType[]; - refreshTenant:()=>void; + refreshTenant: () => void; }) { const LABEL_TEXT_MAP = { priority: intl.formatMessage({ @@ -54,10 +53,16 @@ export default function Replicas({ const res = await deleteObtenantPool({ ns, name, zoneName }); if (res.successful) { refreshTenant(); - message.success(res.message || '删除成功'); + message.success( + res.message || + intl.formatMessage({ + id: 'Dashboard.Detail.Overview.Replicas.DeletedSuccessfully', + defaultMessage: '删除成功', + }), + ); } }; - + return (
- +
diff --git a/ui/src/pages/Tenant/Detail/Overview/index.tsx b/ui/src/pages/Tenant/Detail/Overview/index.tsx index f39556f53..e20193aab 100644 --- a/ui/src/pages/Tenant/Detail/Overview/index.tsx +++ b/ui/src/pages/Tenant/Detail/Overview/index.tsx @@ -1,25 +1,25 @@ import EventsTable from '@/components/EventsTable'; import showDeleteConfirm from '@/components/customModal/DeleteModal'; import OperateModal from '@/components/customModal/OperateModal'; -import { REFRESH_TENANT_TIME,RESULT_STATUS } from '@/constants'; +import { REFRESH_TENANT_TIME, RESULT_STATUS } from '@/constants'; import { getNSName } from '@/pages/Cluster/Detail/Overview/helper'; import { -getEssentialParameters as getEssentialParametersReq, -getSimpleClusterList, + getEssentialParameters as getEssentialParametersReq, + getSimpleClusterList, } from '@/services'; import { -deleteTenent, -getBackupJobs, -getBackupPolicy, -getTenant, + deleteTenent, + getBackupJobs, + getBackupPolicy, + getTenant, } from '@/services/tenant'; import { intl } from '@/utils/intl'; import { EllipsisOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-components'; import { history } from '@umijs/max'; import { useRequest } from 'ahooks'; -import { Button,Row,Tooltip,message } from 'antd'; -import { useEffect,useRef,useState } from 'react'; +import { Button, Row, Tooltip, message } from 'antd'; +import { useEffect, useRef, useState } from 'react'; import Backups from './Backups'; import BasicInfo from './BasicInfo'; import Replicas from './Replicas'; @@ -33,7 +33,7 @@ type OperateItemConfigType = { danger?: boolean; }; -export type ClusterNSName = { ns?: string; name?: string } +export type ClusterNSName = { ns?: string; name?: string }; export default function TenantOverview() { const [operateModalVisible, setOperateModalVisible] = @@ -216,7 +216,15 @@ export default function TenantOverview() { .filter((item) => item.show && !item.isMore) .map((item, index) => (