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
8a698398
Commit
8a698398
authored
6 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Exclude page size handling from frontend
parent
3adcd048
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Add search to users
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/api/users.js
+4
-4
4 additions, 4 deletions
src/api/users.js
src/store/modules/users.js
+5
-6
5 additions, 6 deletions
src/store/modules/users.js
src/views/users/index.vue
+4
-4
4 additions, 4 deletions
src/views/users/index.vue
with
13 additions
and
14 deletions
src/api/users.js
+
4
−
4
View file @
8a698398
import
request
from
'
@/utils/request
'
export
async
function
fetchUsers
(
page
=
1
,
page_size
)
{
export
async
function
fetchUsers
(
page
=
1
)
{
return
await
request
({
url
:
`/api/pleroma/admin/users?page=
${
page
}
&page_size=
${
page_size
}
`
,
url
:
`/api/pleroma/admin/users?page=
${
page
}
`
,
method
:
'
get
'
})
}
...
...
@@ -14,9 +14,9 @@ export async function toggleUserActivation(nickname) {
})
}
export
async
function
searchUsers
(
query
,
page
=
1
,
page_size
)
{
export
async
function
searchUsers
(
query
,
page
=
1
)
{
return
await
request
({
url
:
`/api/pleroma/admin/users/search?query=
${
query
}
&page=
${
page
}
&page_size=
${
page_size
}
`
,
url
:
`/api/pleroma/admin/users/search?query=
${
query
}
&page=
${
page
}
`
,
method
:
'
get
'
})
}
...
...
This diff is collapsed.
Click to expand it.
src/store/modules/users.js
+
5
−
6
View file @
8a698398
...
...
@@ -6,7 +6,6 @@ const user = {
loading
:
true
,
searchQuery
:
''
,
totalUsersCount
:
0
,
pageSize
:
2
,
currentPage
:
1
},
mutations
:
{
...
...
@@ -39,8 +38,8 @@ const user = {
}
},
actions
:
{
async
FetchUsers
({
commit
},
{
page
,
page_size
})
{
const
response
=
await
fetchUsers
(
page
,
page_size
)
async
FetchUsers
({
commit
},
{
page
})
{
const
response
=
await
fetchUsers
(
page
)
commit
(
'
SET_LOADING
'
,
true
)
...
...
@@ -51,15 +50,15 @@ const user = {
commit
(
'
SWAP_USER
'
,
response
.
data
)
},
async
SearchUsers
({
commit
,
dispatch
},
{
query
,
page
,
page_size
})
{
async
SearchUsers
({
commit
,
dispatch
},
{
query
,
page
})
{
if
(
query
.
length
===
0
)
{
commit
(
'
SET_SEARCH_QUERY
'
,
query
)
dispatch
(
'
FetchUsers
'
,
{
page
,
page_size
:
2
}
)
dispatch
(
'
FetchUsers
'
,
page
)
}
else
{
commit
(
'
SET_LOADING
'
,
true
)
commit
(
'
SET_SEARCH_QUERY
'
,
query
)
const
response
=
await
searchUsers
(
query
,
page
,
page_size
)
const
response
=
await
searchUsers
(
query
,
page
)
loadUsers
(
commit
,
page
,
response
.
data
)
}
...
...
This diff is collapsed.
Click to expand it.
src/views/users/index.vue
+
4
−
4
View file @
8a698398
...
...
@@ -60,11 +60,11 @@ export default {
},
created
()
{
this
.
handleDebounceSearchInput
=
debounce
((
query
)
=>
{
this
.
$store
.
dispatch
(
'
SearchUsers
'
,
{
query
,
page
:
1
,
page_size
:
2
})
this
.
$store
.
dispatch
(
'
SearchUsers
'
,
{
query
,
page
:
1
})
},
500
)
},
mounted
:
function
()
{
this
.
$store
.
dispatch
(
'
FetchUsers
'
,
{
page
:
1
,
page_size
:
2
})
this
.
$store
.
dispatch
(
'
FetchUsers
'
,
{
page
:
1
})
},
methods
:
{
handleDeactivate
({
nickname
})
{
...
...
@@ -73,9 +73,9 @@ export default {
handlePageChange
(
page
)
{
const
searchQuery
=
this
.
$store
.
state
.
users
.
searchQuery
if
(
searchQuery
===
''
)
{
this
.
$store
.
dispatch
(
'
FetchUsers
'
,
{
page
,
page_size
:
2
})
this
.
$store
.
dispatch
(
'
FetchUsers
'
,
{
page
})
}
else
{
this
.
$store
.
dispatch
(
'
SearchUsers
'
,
{
query
:
searchQuery
,
page
,
page_size
:
2
})
this
.
$store
.
dispatch
(
'
SearchUsers
'
,
{
query
:
searchQuery
,
page
})
}
},
showDeactivatedButton
(
id
)
{
...
...
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