Skip to content

Commit

Permalink
update disable dropmenu delete button
Browse files Browse the repository at this point in the history
  • Loading branch information
TianWuwt committed Jan 7, 2025
1 parent 9ed8310 commit 19e356b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions ui/src/pages/Cluster/Detail/Overview/BasicInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export default function BasicInfo({
clusterName,
style,
deletionProtection,
clusterDetailRefresh,
...props
}: ResponseOBCluster & { style?: React.CSSProperties; extra?: boolean }) {
const statusItem = findByValue(STATUS_LIST, status);
Expand Down Expand Up @@ -170,6 +171,7 @@ export default function BasicInfo({
defaultMessage: '修改删除保护已成功',
}),
);
clusterDetailRefresh();
}
},
},
Expand Down
15 changes: 10 additions & 5 deletions ui/src/pages/Cluster/Detail/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ const ClusterOverview: React.FC = () => {
setOperateModalVisible(true);
};

const { parameters, storage, resource, deletionProtection, backupVolume } =
clusterDetail?.info || {};

// 不为空即为绑定了NFS
const removeNFS = !!clusterDetail?.info?.backupVolume;
const removeNFS = !!backupVolume;

const menuChange = ({ key }) => {
if (key === 'AddZone') {
Expand Down Expand Up @@ -308,9 +311,6 @@ const ClusterOverview: React.FC = () => {
};
};

const { parameters, storage, resource, deletionProtection, pvcIndependent } =
clusterDetail?.info || {};

const resourceinit = [
{
key: intl.formatMessage({
Expand Down Expand Up @@ -567,7 +567,12 @@ const ClusterOverview: React.FC = () => {
<Row gutter={[16, 16]}>
{clusterDetail && (
<Col span={24}>
<BasicInfo {...(clusterDetail?.info as API.ClusterInfo)} />
<BasicInfo
{...(clusterDetail?.info as API.ClusterInfo)}
clusterDetailRefresh={() => {
clusterDetailRefresh();
}}
/>
</Col>
)}
<Col span={24}>
Expand Down
1 change: 0 additions & 1 deletion ui/src/pages/Tenant/New/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default function New() {
const [passwordVal, setPasswordVal] = useState('');
const [selectClusterId, setSelectClusterId] = useState<string>();
const [clusterList, setClusterList] = useState<API.SimpleClusterList>([]);
// 删除保护 默认勾选
const [deleteValue, setDeleteValue] = useState<boolean>(false);
useRequest(getSimpleClusterList, {
onSuccess: ({ successful, data }) => {
Expand Down

0 comments on commit 19e356b

Please sign in to comment.