diff --git a/ui/src/components/SelectWithTooltip/index.tsx b/ui/src/components/SelectWithTooltip/index.tsx index 1605e641..9ec15af2 100644 --- a/ui/src/components/SelectWithTooltip/index.tsx +++ b/ui/src/components/SelectWithTooltip/index.tsx @@ -13,7 +13,6 @@ export default function SelectWithTooltip({ selectList, form, name, - type, TooltipItemContent, }: SelectWithTooltipProps) { const filterOption = ( @@ -61,11 +60,7 @@ export default function SelectWithTooltip({ filterOption={filterOption} options={formatData(selectList)} onChange={selectChange} - value={ - type === 'observer' && formatData(selectList)?.length !== 1 - ? '' - : form.getFieldValue(name) - } + value={form.getFieldValue(name)} // dropdownRender={DropDownComponent} /> ); diff --git a/ui/src/components/TopoComponent/index.tsx b/ui/src/components/TopoComponent/index.tsx index 5accf5fd..9d411475 100644 --- a/ui/src/components/TopoComponent/index.tsx +++ b/ui/src/components/TopoComponent/index.tsx @@ -29,6 +29,7 @@ import { ReactNode, config } from './G6register'; import { clusterOperate, clusterOperateOfTenant, + getClusterOperates, getServerOperateOfCluster, getZoneOperateOfCluster, getZoneOperateOfTenant, diff --git a/ui/src/constants/index.ts b/ui/src/constants/index.ts index ce6a8cd4..74fd2932 100644 --- a/ui/src/constants/index.ts +++ b/ui/src/constants/index.ts @@ -93,6 +93,7 @@ const TOPO_INFO_CONFIG = [ 'image', 'mode', 'rootPasswordSecret', + 'deletionProtection', ]; // use for tenant name or zone name diff --git a/ui/src/i18n/strings/en-US.json b/ui/src/i18n/strings/en-US.json index e858bae7..4f224865 100644 --- a/ui/src/i18n/strings/en-US.json +++ b/ui/src/i18n/strings/en-US.json @@ -1165,7 +1165,7 @@ "src.constants.Warning": "Warning", "src.pages.Tenant.New.6071B46A": "Optimization Scenarios", "src.pages.Tenant.New.7D0448C6": "Please select an optimization scenario", - "src.pages.Tenant.New.3979BAB6": "Delete protection", + "src.pages.Tenant.New.3979BAB6": "Deletion protection", "src.pages.Tenant.Detail.Overview.2D1BC77D": "Unlimited", "src.pages.Tenant.Detail.NewBackup.F6D664A0": "Please enter Host", "src.pages.Tenant.Detail.NewBackup.7A899F0F": "Please enter AppID", @@ -1175,7 +1175,7 @@ "src.pages.Cluster.New.94B6798C": "PVC independent life cycle", "src.pages.Cluster.New.04047AB8": "Optimization Scenarios", "src.pages.Cluster.New.8126F0B5": "Please select an optimization scenario", - "src.pages.Cluster.New.FCB7C4F3": "Delete protection", + "src.pages.Cluster.New.FCB7C4F3": "Deletion protection", "src.pages.Cluster.New.1E85AB3D": "Mount NFS resources", "src.pages.Cluster.Detail.Overview.C47B9DA4": "Remove NFS resources", "src.pages.Cluster.Detail.Overview.6B97ABB6": "Mount NFS backup volumes", @@ -1236,13 +1236,17 @@ "src.pages.Cluster.Detail.Overview.B7E9F065": "Please enter a path", "src.pages.Cluster.Detail.Overview.D0356ACB": "Please enter", "src.pages.Cluster.Detail.Overview.0798E33D": "Note that mounting the backup volume will roll-restart all nodes", - "src.pages.Cluster.Detail.Overview.02AE8EA0": "Delete protection modified successfully", - "src.pages.Cluster.Detail.Overview.8DB38279": "Delete protection", + "src.pages.Cluster.Detail.Overview.02AE8EA0": "Deletion protection modified successfully", + "src.pages.Cluster.Detail.Overview.8DB38279": "Deletion protection", "src.components.TopoComponent.AD3D247F": "Server deleted successfully", "src.components.TopoComponent.86ECC17E": "Restarting the Server successfully", "src.components.TopoComponent.FAB70713": "Are you sure you want to delete this server?", "src.components.TopoComponent.96A4C193": "Are you sure you want to restart the server?", "src.components.TopoComponent.601BE33A": "Unlimited", "src.components.TopoComponent.0E4AAB80": "Unlimited", - "src.components.TopoComponent.2494A473": "Restart the server" + "src.components.TopoComponent.2494A473": "Restart the server", + "src.pages.Tenant.Detail.Overview.892E62C7": "Deletion protection modified successfully", + "src.pages.Tenant.Detail.Overview.EE772326": "Deletion protection", + "src.pages.Overview.E15A1FED": "metrics-server has not been installed in the K8s cluster, and the usage of node resources cannot be obtained.", + "src.pages.Cluster.Detail.Overview.FF85D01F": "Unmanaged Successfully" } diff --git a/ui/src/i18n/strings/zh-CN.json b/ui/src/i18n/strings/zh-CN.json index 7f2aa148..c1e87e4b 100644 --- a/ui/src/i18n/strings/zh-CN.json +++ b/ui/src/i18n/strings/zh-CN.json @@ -1266,5 +1266,9 @@ "src.components.TopoComponent.96A4C193": "你确定重启该 server 吗?", "src.components.TopoComponent.601BE33A": "无限制", "src.components.TopoComponent.0E4AAB80": "无限制", - "src.components.TopoComponent.2494A473": "重启server" + "src.components.TopoComponent.2494A473": "重启server", + "src.pages.Tenant.Detail.Overview.892E62C7": "修改删除保护已成功", + "src.pages.Tenant.Detail.Overview.EE772326": "删除保护", + "src.pages.Overview.E15A1FED": "K8s 集群中尚未安装 metrics-server,无法获取节点资源用量", + "src.pages.Cluster.Detail.Overview.FF85D01F": "解除托管已成功" } diff --git a/ui/src/pages/Cluster/Detail/Overview/index.tsx b/ui/src/pages/Cluster/Detail/Overview/index.tsx index 4a6c7e6e..5fbb2681 100644 --- a/ui/src/pages/Cluster/Detail/Overview/index.tsx +++ b/ui/src/pages/Cluster/Detail/Overview/index.tsx @@ -119,6 +119,23 @@ const ClusterOverview: React.FC = () => { }, }); + const { runAsync: patchOBCluster, loading: patchOBClusterloading } = + useRequest(obcluster.patchOBCluster, { + manual: true, + onSuccess: (res) => { + if (res.successful) { + message.success( + intl.formatMessage({ + id: 'src.pages.Cluster.Detail.Overview.FF85D01F', + defaultMessage: '解除托管已成功', + }), + ); + refresh(); + clusterDetailRefresh(); + } + }, + }); + const handleDelete = async () => { const res = await deleteClusterReportWrap({ ns: ns!, name: name! }); if (res.successful) { @@ -156,8 +173,7 @@ const ClusterOverview: React.FC = () => { {text && ( -