Skip to content

Commit

Permalink
🎉 use Chinese prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Nov 24, 2022
1 parent da7555f commit e45abc7
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 186 deletions.
24 changes: 12 additions & 12 deletions admin/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ class App extends React.Component {
const menu = (
<Menu>
<Menu.Item key="1" icon={<UserOutlined />}>
<Link to={'/users'}>Account</Link>
<Link to={'/users'}>账户管理</Link>
</Menu.Item>
<Menu.Item key="2" icon={<SettingOutlined />}>
<Link to={'/settings'}>Settings</Link>
<Link to={'/settings'}>系统设置</Link>
</Menu.Item>
<Menu.Divider />
{this.state.status === 1 ? (
Expand All @@ -94,17 +94,17 @@ class App extends React.Component {
this.logout().then((r) => {});
}}
>
Logout
退出登录
</Link>
</Menu.Item>
) : (
<Menu.Item key="4" icon={<LoginOutlined />}>
<Link to={'/login'}>Login</Link>
<Link to={'/login'}>用户登录</Link>
</Menu.Item>
)}
<Menu.Item key="5" icon={<PoweroffOutlined />}>
<Link to={'/login'} onClick={() => this.shutdownServer()}>
Shutdown
关闭博客
</Link>
</Menu.Item>
</Menu>
Expand All @@ -114,23 +114,23 @@ class App extends React.Component {
<Layout style={{ height: '100%' }}>
<Sider trigger={null} collapsible collapsed={this.state.collapsed}>
<div className="logo">
<h1>System Admin</h1>
<h1>管理</h1>
</div>
<Menu theme="dark" mode="inline" defaultSelectedKeys={['0']}>
<Menu.Item key="3" icon={<FileTextOutlined />}>
<Link to={'/posts'}>Posts</Link>
<Link to={'/posts'}>页面管理</Link>
</Menu.Item>
<Menu.Item key="1" icon={<CodeOutlined />}>
<Link to={'/editor'}>Editor</Link>
<Link to={'/editor'}>创建页面</Link>
</Menu.Item>
<Menu.Item key="5" icon={<CloudUploadOutlined />}>
<Link to={'/files'}>Files</Link>
<Link to={'/files'}>文件管理</Link>
</Menu.Item>
<Menu.Item key="6" icon={<UserOutlined />}>
<Link to={'/users'}>Users</Link>
<Link to={'/users'}>用户管理</Link>
</Menu.Item>
<Menu.Item key="7" icon={<SettingOutlined />}>
<Link to={'/settings'}>Settings</Link>
<Link to={'/settings'}>系统设置</Link>
</Menu.Item>
</Menu>
</Sider>
Expand All @@ -146,7 +146,7 @@ class App extends React.Component {
<Space style={{ float: 'right', marginRight: '16px' }}>
<Dropdown overlay={menu} placement="bottomCenter">
<Button type={'text'} icon={<UserOutlined />} size={'large'}>
Admin
管理员
</Button>
</Dropdown>
</Space>
Expand Down
2 changes: 1 addition & 1 deletion admin/src/components/Comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Comments extends Component {

async componentDidMount() {
if (this.state.status === 0) {
Message.error('Access denied.');
Message.error('访问被拒绝');
this.props.history.push('/login');
}
}
Expand Down
26 changes: 13 additions & 13 deletions admin/src/components/EditUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class EditUser extends Component {
: await axios.put(`/api/user`, user);
const { status, message } = res.data;
if (status) {
Message.success('Successfully processed.');
Message.success('提交成功');
this.props.history.goBack();
} else {
Message.error(message);
Expand All @@ -88,7 +88,7 @@ class EditUser extends Component {
render() {
return (
<div className={'content-area'}>
<h1>Edit User</h1>
<h1>编辑用户信息</h1>
<Form
labelCol={{ span: 4 }}
wrapperCol={{ span: 8 }}
Expand All @@ -97,35 +97,35 @@ class EditUser extends Component {
ref={this.formRef}
initialValues={this.state.user}
>
<Form.Item label="Username" name="username" required>
<Form.Item label="用户名" name="username" required>
<Input />
</Form.Item>
<Form.Item label="Password" name="password" required>
<Form.Item label="密码" name="password" required>
<Input />
</Form.Item>
<Form.Item label="Display Name" name="displayName">
<Form.Item label="显示名称" name="displayName">
<Input />
</Form.Item>
<Form.Item label="Email" name="email" type="email">
<Form.Item label="邮箱地址" name="email" type="email">
<Input />
</Form.Item>
<Form.Item label="Avatar" name="avatar" type="link">
<Form.Item label="头像链接" name="avatar" type="link">
<Input />
</Form.Item>
<Form.Item label="Url" name="url" type="url">
<Form.Item label="网站链接" name="url" type="url">
<Input />
</Form.Item>
<Form.Item label="Admin" name="isAdmin">
<Form.Item label="超级管理员" name="isAdmin">
<Switch checked={this.state.user.isAdmin} />
</Form.Item>
<Form.Item label="Moderator" name="isModerator">
<Form.Item label="普通管理员" name="isModerator">
<Switch checked={this.state.user.isModerator} />
</Form.Item>
<Form.Item label="Blocked" name="isBlocked">
<Form.Item label="禁用账户" name="isBlocked">
<Switch checked={this.state.user.isBlocked} />
</Form.Item>
<Form.Item label="Action">
<Button onClick={this.submitData}>Submit</Button>
<Form.Item label="操作">
<Button onClick={this.submitData}>提交更改</Button>
</Form.Item>
</Form>
</div>
Expand Down
Loading

0 comments on commit e45abc7

Please sign in to comment.