Skip to content

Commit

Permalink
fix Deletion protection checkbox show in tenant detail
Browse files Browse the repository at this point in the history
  • Loading branch information
TianWuwt committed Jan 6, 2025
1 parent e782e60 commit 661c9db
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions ui/src/pages/Tenant/Detail/Overview/BasicInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,29 +126,28 @@ export default function BasicInfo({
</Descriptions.Item>
);
})}
{deletionProtection && (
<Descriptions.Item
label={intl.formatMessage({
id: 'src.pages.Tenant.Detail.Overview.EE772326',
defaultMessage: '删除保护',
})}
>
<Checkbox
// loading 态禁止操作,防止重复操作
disabled={patchTenantLoading}
defaultChecked={deletionProtection}
onChange={(e) => {
const body = {} as API.ParamPatchTenant;
if (!e.target.checked) {
body.removeDeletionProtection = true;
} else {
body.addDeletionProtection = true;
}
patchTenant(ns, name, body);
}}
/>
</Descriptions.Item>
)}

<Descriptions.Item
label={intl.formatMessage({
id: 'src.pages.Tenant.Detail.Overview.EE772326',
defaultMessage: '删除保护',
})}
>
<Checkbox
// loading 态禁止操作,防止重复操作
disabled={patchTenantLoading}
defaultChecked={deletionProtection}
onChange={(e) => {
const body = {} as API.ParamPatchTenant;
if (!e.target.checked) {
body.removeDeletionProtection = true;
} else {
body.addDeletionProtection = true;
}
patchTenant(ns, name, body);
}}
/>
</Descriptions.Item>
</Descriptions>

{checkSource(source) && (
Expand Down

0 comments on commit 661c9db

Please sign in to comment.