feat: disable operations for root user (close #76)
This commit is contained in:
parent
4d6172a242
commit
69cf1de7bd
@ -234,6 +234,7 @@ const UsersTable = () => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
manageUser(user.username, 'promote', idx);
|
manageUser(user.username, 'promote', idx);
|
||||||
}}
|
}}
|
||||||
|
disabled={user.role === 100}
|
||||||
>
|
>
|
||||||
提升
|
提升
|
||||||
</Button>
|
</Button>
|
||||||
@ -243,12 +244,13 @@ const UsersTable = () => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
manageUser(user.username, 'demote', idx);
|
manageUser(user.username, 'demote', idx);
|
||||||
}}
|
}}
|
||||||
|
disabled={user.role === 100}
|
||||||
>
|
>
|
||||||
降级
|
降级
|
||||||
</Button>
|
</Button>
|
||||||
<Popup
|
<Popup
|
||||||
trigger={
|
trigger={
|
||||||
<Button size='small' negative>
|
<Button size='small' negative disabled={user.role === 100}>
|
||||||
删除
|
删除
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
@ -274,6 +276,7 @@ const UsersTable = () => {
|
|||||||
idx
|
idx
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
disabled={user.role === 100}
|
||||||
>
|
>
|
||||||
{user.status === 1 ? '禁用' : '启用'}
|
{user.status === 1 ? '禁用' : '启用'}
|
||||||
</Button>
|
</Button>
|
||||||
@ -281,6 +284,7 @@ const UsersTable = () => {
|
|||||||
size={'small'}
|
size={'small'}
|
||||||
as={Link}
|
as={Link}
|
||||||
to={'/user/edit/' + user.id}
|
to={'/user/edit/' + user.id}
|
||||||
|
disabled={user.role === 100}
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</Button>
|
</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user