diff --git a/object/user.go b/object/user.go index 06f237ce..ca7df4aa 100644 --- a/object/user.go +++ b/object/user.go @@ -24,8 +24,11 @@ type User struct { Name string `xorm:"varchar(100) notnull pk" json:"name"` CreatedTime string `xorm:"varchar(100)" json:"createdTime"` - Title string `xorm:"varchar(100)" json:"title"` - Url string `xorm:"varchar(2000)" json:"url"` + Password string `xorm:"varchar(100)" json:"password"` + 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 { diff --git a/web/src/UserEditPage.js b/web/src/UserEditPage.js index b743252e..7c5367f9 100644 --- a/web/src/UserEditPage.js +++ b/web/src/UserEditPage.js @@ -64,23 +64,53 @@ class UserEditPage extends React.Component { }} /> - + - Title: + Password Type: - { - this.updateUserField('title', e.target.value); + { + this.updateUserField('passwordType', e.target.value); }} /> - + - Link: + Password: - } value={this.state.user.url} onChange={e => { - this.updateUserField('url', e.target.value); + { + this.updateUserField('password', e.target.value); + }} /> + + + + + Display Name: + + + { + this.updateUserField('displayName', e.target.value); + }} /> + + + + + Email: + + + { + this.updateUserField('email', e.target.value); + }} /> + + + + + Phone: + + + { + this.updateUserField('phone', e.target.value); }} /> diff --git a/web/src/UserListPage.js b/web/src/UserListPage.js index 0bd7525d..7649b87a 100644 --- a/web/src/UserListPage.js +++ b/web/src/UserListPage.js @@ -30,9 +30,12 @@ class UserListPage extends React.Component { return { owner: "admin", // this.props.account.username, name: `user_${this.state.users.length}`, - title: `New User - ${this.state.users.length}`, 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', dataIndex: 'createdTime', @@ -97,26 +93,45 @@ class UserListPage extends React.Component { } }, { - title: 'Url', - dataIndex: 'url', - key: 'url', + title: 'PasswordType', + dataIndex: 'passwordType', + key: 'passwordType', width: '150px', - sorter: (a, b) => a.url.localeCompare(b.url), - render: (text, record, index) => { - return ( - - { - text - } - - ) - } + sorter: (a, b) => a.passwordType.localeCompare(b.passwordType), + }, + { + title: 'Password', + dataIndex: 'password', + key: 'password', + width: '150px', + 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', dataIndex: '', key: 'op', - width: '220px', + width: '170px', render: (text, record, index) => { return (