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
cc8b2be0
Commit
cc8b2be0
authored
5 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Add pagination for fetching local statuses
parent
6eedb80d
No related branches found
No related tags found
1 merge request
!99
Add ability to see local statuses on Statuses by instance tab
Pipeline
#23374
passed
5 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/api/status.js
+2
-2
2 additions, 2 deletions
src/api/status.js
src/store/modules/status.js
+29
-11
29 additions, 11 deletions
src/store/modules/status.js
src/views/statuses/index.vue
+1
-1
1 addition, 1 deletion
src/views/statuses/index.vue
with
32 additions
and
14 deletions
src/api/status.js
+
2
−
2
View file @
cc8b2be0
...
...
@@ -21,10 +21,10 @@ export async function deleteStatus(id, authHost, token) {
})
}
export
async
function
fetchStatuses
({
godmode
,
localOnly
,
authHost
,
token
})
{
export
async
function
fetchStatuses
({
godmode
,
localOnly
,
authHost
,
token
,
pageSize
,
page
})
{
return
await
request
({
baseURL
:
baseName
(
authHost
),
url
:
`/api/pleroma/admin/statuses?godmode=
${
godmode
}
&local_only=
${
localOnly
}
`
,
url
:
`/api/pleroma/admin/statuses?godmode=
${
godmode
}
&local_only=
${
localOnly
}
&page=
${
page
}
&page_size=
${
pageSize
}
`
,
method
:
'
get
'
,
headers
:
authHeaders
(
token
)
})
...
...
This diff is collapsed.
Click to expand it.
src/store/modules/status.js
+
29
−
11
View file @
cc8b2be0
...
...
@@ -9,7 +9,7 @@ const status = {
showLocal
:
false
,
showPrivate
:
false
,
page
:
1
,
pageSize
:
1
,
pageSize
:
20
,
buttonLoading
:
false
,
allLoaded
:
false
}
...
...
@@ -75,7 +75,9 @@ const status = {
godmode
:
state
.
statusesByInstance
.
showPrivate
,
localOnly
:
state
.
statusesByInstance
.
showLocal
,
authHost
:
getters
.
authHost
,
token
:
getters
.
token
token
:
getters
.
token
,
pageSize
:
state
.
statusesByInstance
.
pageSize
,
page
:
state
.
statusesByInstance
.
page
})
:
await
fetchStatusesByInstance
(
{
...
...
@@ -92,16 +94,26 @@ const status = {
}
commit
(
'
SET_LOADING
'
,
false
)
},
async
FetchStatusesPageByInstance
({
commit
,
getters
,
state
})
{
async
FetchStatusesPageByInstance
({
commit
,
getters
,
rootState
,
state
})
{
commit
(
'
SET_BUTTON_LOADING
'
,
true
)
const
statuses
=
await
fetchStatusesByInstance
(
{
instance
:
state
.
statusesByInstance
.
selectedInstance
,
authHost
:
getters
.
authHost
,
token
:
getters
.
token
,
pageSize
:
state
.
statusesByInstance
.
pageSize
,
page
:
state
.
statusesByInstance
.
page
})
const
statuses
=
state
.
statusesByInstance
.
selectedInstance
===
rootState
.
user
.
authHost
?
await
fetchStatuses
(
{
godmode
:
state
.
statusesByInstance
.
showPrivate
,
localOnly
:
state
.
statusesByInstance
.
showLocal
,
authHost
:
getters
.
authHost
,
token
:
getters
.
token
,
pageSize
:
state
.
statusesByInstance
.
pageSize
,
page
:
state
.
statusesByInstance
.
page
})
:
await
fetchStatusesByInstance
(
{
instance
:
state
.
statusesByInstance
.
selectedInstance
,
authHost
:
getters
.
authHost
,
token
:
getters
.
token
,
pageSize
:
state
.
statusesByInstance
.
pageSize
,
page
:
state
.
statusesByInstance
.
page
})
commit
(
'
PUSH_STATUSES
'
,
statuses
.
data
)
commit
(
'
SET_BUTTON_LOADING
'
,
false
)
if
(
statuses
.
data
.
length
<
state
.
statusesByInstance
.
pageSize
)
{
...
...
@@ -109,10 +121,16 @@ const status = {
}
},
HandleGodmodeCheckboxChange
({
commit
,
dispatch
},
value
)
{
dispatch
(
'
HandlePageChange
'
,
1
)
commit
(
'
SET_ALL_LOADED
'
,
false
)
commit
(
'
CHANGE_GODMODE_CHECKBOX_VALUE
'
,
value
)
dispatch
(
'
FetchStatusesByInstance
'
)
},
HandleLocalCheckboxChange
({
commit
,
dispatch
},
value
)
{
dispatch
(
'
HandlePageChange
'
,
1
)
commit
(
'
SET_ALL_LOADED
'
,
false
)
commit
(
'
CHANGE_LOCAL_CHECKBOX_VALUE
'
,
value
)
dispatch
(
'
FetchStatusesByInstance
'
)
},
...
...
This diff is collapsed.
Click to expand it.
src/views/statuses/index.vue
+
1
−
1
View file @
cc8b2be0
...
...
@@ -40,7 +40,7 @@
</div>
<div
v-if=
"statuses.length > 0"
class=
"statuses-pagination"
>
<el-button
v-if=
"!allLoaded"
:loading=
"buttonLoading"
@
click=
"handleLoadMore"
>
{{
$t
(
'
statuses.loadMore
'
)
}}
</el-button>
<el-button
v-else
type=
"success"
icon=
"el-icon-check"
circle
/>
<el-button
v-else
icon=
"el-icon-check"
circle
/>
</div>
</div>
</
template
>
...
...
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