Add user type.

This commit is contained in:
Yang Luo
2021-04-26 19:00:23 +08:00
parent 4dd0c1a457
commit 0fc7015c61
5 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,7 @@ type User struct {
CreatedTime string `xorm:"varchar(100)" json:"createdTime"` CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
Id string `xorm:"varchar(100)" json:"id"` Id string `xorm:"varchar(100)" json:"id"`
Type string `xorm:"varchar(100)" json:"type"`
Password string `xorm:"varchar(100)" json:"password"` Password string `xorm:"varchar(100)" json:"password"`
PasswordType string `xorm:"varchar(100)" json:"passwordType"` PasswordType string `xorm:"varchar(100)" json:"passwordType"`
DisplayName string `xorm:"varchar(100)" json:"displayName"` DisplayName string `xorm:"varchar(100)" json:"displayName"`

View File

@ -248,6 +248,19 @@ class UserEditPage extends React.Component {
</Row> </Row>
</Col> </Col>
</Row> </Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("general:User Type")}:
</Col>
<Col span={22} >
<Select virtual={false} style={{width: '100%'}} value={this.state.user.type} onChange={(value => {this.updateUserField('type', value);})}>
{
['normal-user']
.map((item, index) => <Option key={index} value={item}>{item}</Option>)
}
</Select>
</Col>
</Row>
<Row style={{marginTop: '20px'}} > <Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}> <Col style={{marginTop: '5px'}} span={2}>
{i18next.t("general:Password Type")}: {i18next.t("general:Password Type")}:

View File

@ -47,6 +47,7 @@ class UserListPage extends React.Component {
owner: "admin", // this.props.account.username, owner: "admin", // this.props.account.username,
name: `user_${this.state.users.length}`, name: `user_${this.state.users.length}`,
createdTime: moment().format(), createdTime: moment().format(),
type: "normal-user",
password: "123", password: "123",
passwordType: "plain", passwordType: "plain",
displayName: `New User - ${this.state.users.length}`, displayName: `New User - ${this.state.users.length}`,

View File

@ -17,6 +17,7 @@
"Display Name": "Display Name", "Display Name": "Display Name",
"Avatar": "Avatar", "Avatar": "Avatar",
"Preview": "Preview", "Preview": "Preview",
"User Type": "User Type",
"Password Type": "Password Type", "Password Type": "Password Type",
"Password": "Password", "Password": "Password",
"Email": "Email", "Email": "Email",

View File

@ -17,6 +17,7 @@
"Display Name": "展示的名字", "Display Name": "展示的名字",
"Avatar": "头像", "Avatar": "头像",
"Preview": "预览", "Preview": "预览",
"User Type": "用户类型",
"Password Type": "密码类型", "Password Type": "密码类型",
"Password": "密码", "Password": "密码",
"Email": "电子邮件", "Email": "电子邮件",