mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-12 19:33:41 +08:00
feat: i18n support
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Header, Segment } from 'semantic-ui-react';
|
||||
import { Button, Form, Card } from 'semantic-ui-react';
|
||||
import { API, showError, showSuccess } from '../../helpers';
|
||||
|
||||
const AddUser = () => {
|
||||
@@ -30,49 +30,51 @@ const AddUser = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Segment>
|
||||
<Header as='h3'>{t('user.add.title')}</Header>
|
||||
<Form autoComplete='off'>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label={t('user.edit.username')}
|
||||
name='username'
|
||||
placeholder={t('user.edit.username_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={username}
|
||||
autoComplete='off'
|
||||
required
|
||||
/>
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label={t('user.edit.display_name')}
|
||||
name='display_name'
|
||||
placeholder={t('user.edit.display_name_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={display_name}
|
||||
autoComplete='off'
|
||||
/>
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label={t('user.edit.password')}
|
||||
name='password'
|
||||
type={'password'}
|
||||
placeholder={t('user.edit.password_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={password}
|
||||
autoComplete='off'
|
||||
required
|
||||
/>
|
||||
</Form.Field>
|
||||
<Button positive type={'submit'} onClick={submit}>
|
||||
{t('user.edit.buttons.submit')}
|
||||
</Button>
|
||||
</Form>
|
||||
</Segment>
|
||||
</>
|
||||
<div className='dashboard-container'>
|
||||
<Card fluid className='chart-card'>
|
||||
<Card.Content>
|
||||
<Card.Header className='header'>{t('user.add.title')}</Card.Header>
|
||||
<Form autoComplete='off'>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label={t('user.edit.username')}
|
||||
name='username'
|
||||
placeholder={t('user.edit.username_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={username}
|
||||
autoComplete='off'
|
||||
required
|
||||
/>
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label={t('user.edit.display_name')}
|
||||
name='display_name'
|
||||
placeholder={t('user.edit.display_name_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={display_name}
|
||||
autoComplete='off'
|
||||
/>
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label={t('user.edit.password')}
|
||||
name='password'
|
||||
type='password'
|
||||
placeholder={t('user.edit.password_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={password}
|
||||
autoComplete='off'
|
||||
required
|
||||
/>
|
||||
</Form.Field>
|
||||
<Button positive type='submit' onClick={submit}>
|
||||
{t('user.edit.buttons.submit')}
|
||||
</Button>
|
||||
</Form>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user