-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: languages config, update-password
- Loading branch information
Showing
21 changed files
with
435 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { | ||
digitReg, | ||
lowercaseReg, | ||
specialCharacterReg, | ||
uppercaseReg | ||
} from '@/config'; | ||
import { CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons'; | ||
import { useIntl } from '@umijs/max'; | ||
import { Space } from 'antd'; | ||
|
||
const PasswordValidate: React.FC<{ value: string }> = ({ value = '' }) => { | ||
const intl = useIntl(); | ||
|
||
const renderIcon = ({ valid, text }: { valid: boolean; text: string }) => { | ||
return ( | ||
<> | ||
{valid ? ( | ||
<CheckCircleFilled style={{ color: 'green' }} /> | ||
) : ( | ||
<CloseCircleFilled style={{ color: 'red' }} /> | ||
)} | ||
<span | ||
className="m-l-5" | ||
style={{ color: 'var(--ant-color-text-description)' }} | ||
> | ||
{text} | ||
</span> | ||
</> | ||
); | ||
}; | ||
return ( | ||
<Space direction="vertical" style={{ paddingTop: '10px' }}> | ||
<span> | ||
{renderIcon({ | ||
valid: uppercaseReg.test(value), | ||
text: intl.formatMessage({ id: 'users.password.uppcase' }) | ||
})} | ||
</span> | ||
<span> | ||
{renderIcon({ | ||
valid: lowercaseReg.test(value), | ||
text: intl.formatMessage({ id: 'users.password.lowercase' }) | ||
})} | ||
</span> | ||
|
||
<span> | ||
{renderIcon({ | ||
valid: digitReg.test(value), | ||
text: intl.formatMessage({ id: 'users.password.number' }) | ||
})} | ||
</span> | ||
<span> | ||
{renderIcon({ | ||
valid: value.length >= 6 && value.length <= 12, | ||
text: intl.formatMessage({ id: 'users.password.length' }) | ||
})} | ||
</span> | ||
<span> | ||
{renderIcon({ | ||
valid: specialCharacterReg.test(value), | ||
text: intl.formatMessage({ id: 'users.password.special' }) | ||
})} | ||
</span> | ||
</Space> | ||
); | ||
}; | ||
|
||
export default PasswordValidate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
export default { | ||
'apikeys.title': 'API Keys', | ||
'apikeys.table.apikeys': 'keys', | ||
'apikeys.button.create': 'New API Key', | ||
'apikeys.form.expiretime': 'Expiration', | ||
'apikeys.table.name': 'Key Name' | ||
'apikeys.table.name': 'Key Name', | ||
'apikeys.table.save.tips': | ||
'Make sure to copy your key immediately. You will not be able to see it again.' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export default { | ||
'users.title': 'Users', | ||
'users.button.create': 'Create User', | ||
'users.form.edit': 'Edit User', | ||
'users.form.create': 'Create User', | ||
'users.table.username': 'User Name', | ||
'users.table.role': 'Role', | ||
'users.form.fullname': 'Full Name', | ||
'users.table.user': 'users', | ||
'users.form.admin': 'Admin', | ||
'users.form.user': 'User', | ||
'users.form.newpassword': 'New Password', | ||
'users.form.currentpassword': 'Current Password', | ||
'users.form.updatepassword': 'Modify Password', | ||
'users.form.rule.password': | ||
'Contains uppercase and lowercase letters, numbers, and special characters, 6 to 12 characters in length, no spaces allowed.', | ||
'users.password.uppcase': 'At least one uppercase letter', | ||
'users.password.lowercase': 'At least one lowercase letter', | ||
'users.password.number': 'At least one number', | ||
'users.password.special': 'At least one special character', | ||
'users.password.length': 'Length between 6 and 12 characters' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import menu from './en-US/menu'; | ||
import apikeys from './zh-CN/apikeys'; | ||
import common from './zh-CN/common'; | ||
import menu from './zh-CN/menu'; | ||
import models from './zh-CN/models'; | ||
import playground from './zh-CN/playground'; | ||
import resources from './zh-CN/resources'; | ||
import users from './zh-CN/users'; | ||
|
||
export default { | ||
...common, | ||
...menu, | ||
...models, | ||
...playground, | ||
...resources, | ||
...apikeys | ||
...apikeys, | ||
...users | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
export default { | ||
'apikeys.title': 'API 密钥', | ||
'apikeys.table.apikeys': '密钥', | ||
'apikeys.button.create': '新建 API 密钥', | ||
'apikeys.form.expiretime': '过期时间', | ||
'apikeys.table.name': '密钥名称' | ||
'apikeys.table.name': '密钥名称', | ||
'apikeys.table.save.tips': '确保立即复制您的密钥。您将无法再次看到它!' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export default { | ||
'users.title': '用户', | ||
'users.button.create': '新建用户', | ||
'users.form.edit': '编辑用户', | ||
'users.form.create': '新建用户', | ||
'users.table.username': '用户名', | ||
'users.table.role': '角色', | ||
'users.form.fullname': '全名', | ||
'users.table.user': '用户', | ||
'users.form.admin': '管理员', | ||
'users.form.user': '普通用户', | ||
'users.form.newpassword': '新密码', | ||
'users.form.currentpassword': '当前密码', | ||
'users.form.updatepassword': '修改密码', | ||
'users.form.rule.password': | ||
'包含大小写字母、数字和特殊字符,6至12个字符,不允许有空格', | ||
'users.password.uppcase': '至少包含一个大写字母', | ||
'users.password.lowercase': '至少包含一个小写字母', | ||
'users.password.number': '至少包含一个数字', | ||
'users.password.special': '至少包含一个特殊字符', | ||
'users.password.length': '长度在6至12个字符之间' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.