mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-22 18:25:47 +08:00
Improve user pages.
This commit is contained in:
parent
89a094dd78
commit
6be01cc77c
@ -24,8 +24,11 @@ type User struct {
|
|||||||
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
||||||
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
||||||
|
|
||||||
Title string `xorm:"varchar(100)" json:"title"`
|
Password string `xorm:"varchar(100)" json:"password"`
|
||||||
Url string `xorm:"varchar(2000)" json:"url"`
|
PasswordType string `xorm:"varchar(100)" json:"passwordType"`
|
||||||
|
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||||
|
Email string `xorm:"varchar(100)" json:"email"`
|
||||||
|
Phone string `xorm:"varchar(100)" json:"phone"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUsers(owner string) []*User {
|
func GetUsers(owner string) []*User {
|
||||||
|
@ -64,23 +64,53 @@ class UserEditPage extends React.Component {
|
|||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row style={{marginTop: '10px'}} >
|
<Row style={{marginTop: '20px'}} >
|
||||||
<Col style={{marginTop: '5px'}} span={2}>
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
Title:
|
Password Type:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Input value={this.state.user.title} onChange={e => {
|
<Input value={this.state.user.passwordType} onChange={e => {
|
||||||
this.updateUserField('title', e.target.value);
|
this.updateUserField('passwordType', e.target.value);
|
||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row style={{marginTop: '10px'}} >
|
<Row style={{marginTop: '20px'}} >
|
||||||
<Col style={{marginTop: '5px'}} span={2}>
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
Link:
|
Password:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Input prefix={<LinkOutlined/>} value={this.state.user.url} onChange={e => {
|
<Input value={this.state.user.password} onChange={e => {
|
||||||
this.updateUserField('url', e.target.value);
|
this.updateUserField('password', e.target.value);
|
||||||
|
}} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style={{marginTop: '20px'}} >
|
||||||
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
|
Display Name:
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<Input value={this.state.user.displayName} onChange={e => {
|
||||||
|
this.updateUserField('displayName', e.target.value);
|
||||||
|
}} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style={{marginTop: '20px'}} >
|
||||||
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
|
Email:
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<Input value={this.state.user.email} onChange={e => {
|
||||||
|
this.updateUserField('email', e.target.value);
|
||||||
|
}} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style={{marginTop: '20px'}} >
|
||||||
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
|
Phone:
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<Input value={this.state.user.phone} onChange={e => {
|
||||||
|
this.updateUserField('phone', e.target.value);
|
||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -30,9 +30,12 @@ class UserListPage extends React.Component {
|
|||||||
return {
|
return {
|
||||||
owner: "admin", // this.props.account.username,
|
owner: "admin", // this.props.account.username,
|
||||||
name: `user_${this.state.users.length}`,
|
name: `user_${this.state.users.length}`,
|
||||||
title: `New User - ${this.state.users.length}`,
|
|
||||||
createdTime: moment().format(),
|
createdTime: moment().format(),
|
||||||
Url: "",
|
password: "123456",
|
||||||
|
passwordType: "plain",
|
||||||
|
displayName: `New User - ${this.state.users.length}`,
|
||||||
|
email: "user@example.com",
|
||||||
|
phone: "1-12345678",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,13 +82,6 @@ class UserListPage extends React.Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: 'Title',
|
|
||||||
dataIndex: 'title',
|
|
||||||
key: 'title',
|
|
||||||
// width: '80px',
|
|
||||||
sorter: (a, b) => a.title.localeCompare(b.title),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Created Time',
|
title: 'Created Time',
|
||||||
dataIndex: 'createdTime',
|
dataIndex: 'createdTime',
|
||||||
@ -97,26 +93,45 @@ class UserListPage extends React.Component {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Url',
|
title: 'PasswordType',
|
||||||
dataIndex: 'url',
|
dataIndex: 'passwordType',
|
||||||
key: 'url',
|
key: 'passwordType',
|
||||||
width: '150px',
|
width: '150px',
|
||||||
sorter: (a, b) => a.url.localeCompare(b.url),
|
sorter: (a, b) => a.passwordType.localeCompare(b.passwordType),
|
||||||
render: (text, record, index) => {
|
},
|
||||||
return (
|
{
|
||||||
<a target="_blank" href={text}>
|
title: 'Password',
|
||||||
{
|
dataIndex: 'password',
|
||||||
text
|
key: 'password',
|
||||||
}
|
width: '150px',
|
||||||
</a>
|
sorter: (a, b) => a.password.localeCompare(b.password),
|
||||||
)
|
},
|
||||||
}
|
{
|
||||||
|
title: 'Display Name',
|
||||||
|
dataIndex: 'displayName',
|
||||||
|
key: 'displayName',
|
||||||
|
// width: '100px',
|
||||||
|
sorter: (a, b) => a.displayName.localeCompare(b.displayName),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Email',
|
||||||
|
dataIndex: 'email',
|
||||||
|
key: 'email',
|
||||||
|
width: '150px',
|
||||||
|
sorter: (a, b) => a.email.localeCompare(b.email),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Phone',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
key: 'phone',
|
||||||
|
width: '120px',
|
||||||
|
sorter: (a, b) => a.phone.localeCompare(b.phone),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Action',
|
title: 'Action',
|
||||||
dataIndex: '',
|
dataIndex: '',
|
||||||
key: 'op',
|
key: 'op',
|
||||||
width: '220px',
|
width: '170px',
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user