Skip to content

Commit

Permalink
feat: add tips on login page (#1491)
Browse files Browse the repository at this point in the history
  • Loading branch information
Baoyuantop authored Feb 22, 2021
1 parent bd5ed03 commit e56163a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/src/pages/User/components/LoginMethodPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
import React from 'react';
import { Form, Input } from 'antd';
import { Form, Input, Tooltip } from 'antd';
import type { FormInstance } from 'antd/lib/form';
import { UserOutlined, LockTwoTone } from '@ant-design/icons';
import { request, formatMessage } from 'umi';
Expand Down Expand Up @@ -68,6 +68,13 @@ const LoginMethodPassword: UserModule.LoginMethod = {
prefix={<LockTwoTone />}
/>
</Form.Item>
<Form.Item>
<Tooltip title={formatMessage({ id: 'component.user.loginMethodPassword.modificationMethod' })}>
<a href="https://github.com/apache/apisix-dashboard/blob/master/api/conf/conf.yaml#L53-L57">
{formatMessage({ id: 'component.user.loginMethodPassword.changeDefaultAccount' })}
</a>
</Tooltip>
</Form.Item>
</Form>
);
},
Expand Down
2 changes: 2 additions & 0 deletions web/src/pages/User/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default {
'component.user.loginMethodPassword.incorrectPassword': 'Incorrect username or password',
'component.user.loginMethodPassword.fieldInvalid': 'Please check username and password',
'component.user.loginMethodPassword.success': 'Login Success',
'component.user.loginMethodPassword.changeDefaultAccount': 'How to update username/password?',
'component.user.loginMethodPassword.modificationMethod': 'Please modify the users field in the /api/conf/conf.yaml file',
'component.user.loginMethodExample': 'Example',
'component.user.loginMethodExample.message':
'Example Login Method, It is only used as an extension example of login method and cannot be used.',
Expand Down
2 changes: 2 additions & 0 deletions web/src/pages/User/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default {
'component.user.loginMethodPassword.incorrectPassword': '账号或密码错误',
'component.user.loginMethodPassword.fieldInvalid': '请检查账号和密码',
'component.user.loginMethodPassword.success': '登录成功',
'component.user.loginMethodPassword.changeDefaultAccount': '如何修改默认账户和密码?',
'component.user.loginMethodPassword.modificationMethod': '请修改 /api/conf/conf.yaml 文件中 users 字段',
'component.user.loginMethodExample': '示例登录',
'component.user.loginMethodExample.message': '示例登录方式,仅作为登录方式扩展例子,无法使用',
};

0 comments on commit e56163a

Please sign in to comment.