Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
4b9f0297
Commit
4b9f0297
authored
5 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Add link for resetting password
parent
3791dec0
No related branches found
No related tags found
1 merge request
!45
Generate invite tokens from admin-fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/store/modules/users.js
+10
-6
10 additions, 6 deletions
src/store/modules/users.js
src/views/users/index.vue
+27
-17
27 additions, 17 deletions
src/views/users/index.vue
with
37 additions
and
23 deletions
src/store/modules/users.js
+
10
−
6
View file @
4b9f0297
...
...
@@ -13,7 +13,10 @@ const users = {
active
:
false
,
deactivated
:
false
},
passwordResetToken
:
''
passwordResetToken
:
{
token
:
''
,
link
:
''
}
},
mutations
:
{
SET_USERS
:
(
state
,
users
)
=>
{
...
...
@@ -46,8 +49,9 @@ const users = {
SET_PAGE_SIZE
:
(
state
,
pageSize
)
=>
{
state
.
pageSize
=
pageSize
},
SET_PASSWORD_RESET_TOKEN
:
(
state
,
token
)
=>
{
state
.
passwordResetToken
=
token
SET_PASSWORD_RESET_TOKEN
:
(
state
,
{
token
,
link
})
=>
{
state
.
passwordResetToken
.
token
=
token
state
.
passwordResetToken
.
link
=
link
},
SET_SEARCH_QUERY
:
(
state
,
query
)
=>
{
state
.
searchQuery
=
query
...
...
@@ -86,11 +90,11 @@ const users = {
loadUsers
(
commit
,
page
,
response
.
data
)
},
async
GetPasswordResetToken
({
commit
,
state
,
getters
},
nickname
)
{
const
response
=
await
getPasswordResetToken
(
nickname
,
getters
.
authHost
,
getters
.
token
)
commit
(
'
SET_PASSWORD_RESET_TOKEN
'
,
response
.
data
)
const
{
data
}
=
await
getPasswordResetToken
(
nickname
,
getters
.
authHost
,
getters
.
token
)
commit
(
'
SET_PASSWORD_RESET_TOKEN
'
,
data
)
},
RemovePasswordToken
({
commit
})
{
commit
(
'
SET_PASSWORD_RESET_TOKEN
'
,
''
)
commit
(
'
SET_PASSWORD_RESET_TOKEN
'
,
{
link
:
''
,
token
:
''
}
)
},
async
RemoveTag
({
commit
,
getters
},
{
users
,
tag
})
{
const
nicknames
=
users
.
map
(
user
=>
user
.
nickname
)
...
...
This diff is collapsed.
Click to expand it.
src/views/users/index.vue
+
27
−
17
View file @
4b9f0297
...
...
@@ -9,7 +9,7 @@
<el-input
:placeholder=
"$t('users.search')"
v-model=
"search"
class=
"search"
@
input=
"handleDebounceSearchInput"
/>
</div>
<div
class=
"actions-container"
>
<el-button
class=
"actions-button create-account"
@
click=
"
dialogFormVisible
= true"
>
<el-button
class=
"actions-button create-account"
@
click=
"
createAccountDialogOpen
= true"
>
<span>
<i
class=
"el-icon-plus"
/>
{{
$t
(
'
users.createAccount
'
)
}}
...
...
@@ -20,9 +20,9 @@
@
apply-action=
"clearSelection"
/>
</div>
<new-account-dialog
:dialog-form-visible=
"
dialogFormVisible
"
:dialog-form-visible=
"
createAccountDialogOpen
"
@
createNewAccount=
"createNewAccount"
@
closeWindow=
"
dialogFormVisible
= false"
/>
@
closeWindow=
"
createAccountDialogOpen
= false"
/>
<el-table
v-loading=
"loading"
ref=
"usersTable"
...
...
@@ -139,13 +139,17 @@
</el-table-column>
</el-table>
<el-dialog
:visible.sync=
"passwordResetTokenDialog"
v-loading=
"loading"
:visible.sync=
"resetPasswordDialogOpen"
:title=
"$t('users.passwordResetTokenCreated')"
:before-close=
"removePasswordToken"
class=
"password-reset-token-dialog"
>
<span
class=
"password-reset-token"
>
{{ passwordResetToken }}
</span>
class=
"password-reset-token-dialog"
@
close=
"closeResetPasswordDialog"
>
<div>
<p
class=
"password-reset-token"
>
Password reset token was generated: {{ passwordResetToken }}
</p>
<p>
You can also use this link to reset password:
<a
:href=
"passwordResetLink"
target=
"_blank"
class=
"reset-password-link"
>
{{ passwordResetLink }}
</a>
</p>
</div>
</el-dialog>
<div
v-if=
"users.length === 0"
class=
"no-users-message"
>
<p>
There are no users to display
</p>
...
...
@@ -181,7 +185,8 @@ export default {
return
{
search
:
''
,
selectedUsers
:
[],
dialogFormVisible
:
false
createAccountDialogOpen
:
false
,
resetPasswordDialogOpen
:
false
}
},
computed
:
{
...
...
@@ -200,11 +205,11 @@ export default {
pageSize
()
{
return
this
.
$store
.
state
.
users
.
pageSize
},
passwordReset
Token
()
{
return
this
.
$store
.
state
.
users
.
passwordResetToken
passwordReset
Link
()
{
return
this
.
$store
.
state
.
users
.
passwordResetToken
.
link
},
passwordResetToken
Dialog
()
{
return
this
.
$store
.
state
.
users
.
passwordResetToken
.
length
>
0
passwordResetToken
()
{
return
this
.
$store
.
state
.
users
.
passwordResetToken
.
token
},
currentPage
()
{
return
this
.
$store
.
state
.
users
.
currentPage
...
...
@@ -240,7 +245,7 @@ export default {
}
catch
(
_e
)
{
return
}
finally
{
this
.
dialogFormVisible
=
false
this
.
createAccountDialogOpen
=
false
}
this
.
$message
({
type
:
'
success
'
,
...
...
@@ -251,6 +256,7 @@ export default {
return
str
.
charAt
(
0
).
toUpperCase
()
},
getPasswordResetToken
(
nickname
)
{
this
.
resetPasswordDialogOpen
=
true
this
.
$store
.
dispatch
(
'
GetPasswordResetToken
'
,
nickname
)
},
handleDeactivation
({
nickname
})
{
...
...
@@ -270,7 +276,8 @@ export default {
handleSelectionChange
(
value
)
{
this
.
$data
.
selectedUsers
=
value
},
removePasswordToken
()
{
closeResetPasswordDialog
()
{
this
.
resetPasswordDialogOpen
=
false
this
.
$store
.
dispatch
(
'
RemovePasswordToken
'
)
},
showAdminAction
({
local
,
id
})
{
...
...
@@ -321,7 +328,10 @@ export default {
margin-right
:
5px
;
}
.password-reset-token
{
margin-bottom
:
20px
margin
:
0
0
14px
0
;
}
.reset-password-link
{
text-decoration
:
underline
;
}
.users-container
{
h1
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment