Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can not edit password for root user #771

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading