Skip to content

Commit

Permalink
fix: can not edit password for root user
Browse files Browse the repository at this point in the history
Signed-off-by: shanghaikid <[email protected]>
  • Loading branch information
shanghaikid committed Feb 15, 2025
1 parent 2bdee89 commit d00f8ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions client/src/i18n/cn/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const userTrans = {
deleteTip: '请至少选择一个要删除的用户,不能删除root用户。',
deleteRoleTip: '请至少选择一个要删除的角色,不能删除admin/public 角色。',
editPassword: '修改密码',
editPassDisabledTip: '请选择一个用户进行编辑。',

// role
deleteEditRoleTip: '请选择一个角色,并且root角色不可编辑。',
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const userTrans = {
deleteRoleTip:
'Please select at least one item to drop and the admin/public role can not be dropped.',
editPassword: 'Edit Password',
editPassDisabledTip: 'Please select one user to edit.',

// role
deleteEditRoleTip: 'Please select one user to edit, root is not editable.',
Expand Down
7 changes: 2 additions & 5 deletions client/src/pages/user/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,8 @@ const Users = () => {
});
},
icon: 'edit',
disabled: () =>
selectedUser.length === 0 ||
selectedUser.length > 1 ||
selectedUser.findIndex(v => v.username === 'root') > -1,
disabledTooltip: userTrans('deleteEditRoleTip'),
disabled: () => selectedUser.length === 0 || selectedUser.length > 1,
disabledTooltip: userTrans('editPassDisabledTip'),
},

{
Expand Down

0 comments on commit d00f8ce

Please sign in to comment.