forked from AkkomaGang/admin-fe
Merge branch 'cherry-pick-ce3d3387' into 'release/2.0.2'
Merge branch 'feature/display-status-counts-by-scope' into 'master' See merge request pleroma/admin-fe!115
This commit is contained in:
commit
2a0aced674
10 changed files with 46 additions and 13 deletions
|
@ -30,6 +30,15 @@ export async function fetchStatuses({ godmode, localOnly, authHost, token, pageS
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function fetchStatusesCount(authHost, token) {
|
||||||
|
return await request({
|
||||||
|
baseURL: baseName(authHost),
|
||||||
|
url: `/api/pleroma/admin/stats`,
|
||||||
|
method: 'get',
|
||||||
|
headers: authHeaders(token)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export async function fetchStatusesByInstance({ instance, authHost, token, pageSize, page }) {
|
export async function fetchStatusesByInstance({ instance, authHost, token, pageSize, page }) {
|
||||||
return await request({
|
return await request({
|
||||||
baseURL: baseName(authHost),
|
baseURL: baseName(authHost),
|
||||||
|
|
|
@ -241,12 +241,16 @@ export default {
|
||||||
resendConfirmation: 'Resend confirmation email'
|
resendConfirmation: 'Resend confirmation email'
|
||||||
},
|
},
|
||||||
statuses: {
|
statuses: {
|
||||||
statuses: 'Statuses by instance',
|
statuses: 'Statuses',
|
||||||
instanceFilter: 'Instance filter',
|
instanceFilter: 'Instance filter',
|
||||||
loadMore: 'Load more',
|
loadMore: 'Load more',
|
||||||
noInstances: 'No other instances found',
|
noInstances: 'No other instances found',
|
||||||
onlyLocalStatuses: 'Show only local statuses',
|
onlyLocalStatuses: 'Show only local statuses',
|
||||||
showPrivateStatuses: 'Show private statuses'
|
showPrivateStatuses: 'Show private statuses',
|
||||||
|
direct: 'Direct',
|
||||||
|
private: 'Private',
|
||||||
|
public: 'Public',
|
||||||
|
unlisted: 'Unlisted'
|
||||||
},
|
},
|
||||||
userProfile: {
|
userProfile: {
|
||||||
tags: 'Tags',
|
tags: 'Tags',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { changeStatusScope, deleteStatus, fetchStatuses, fetchStatusesByInstance } from '@/api/status'
|
import { changeStatusScope, deleteStatus, fetchStatuses, fetchStatusesCount, fetchStatusesByInstance } from '@/api/status'
|
||||||
|
|
||||||
const status = {
|
const status = {
|
||||||
state: {
|
state: {
|
||||||
|
@ -12,7 +12,8 @@ const status = {
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
buttonLoading: false,
|
buttonLoading: false,
|
||||||
allLoaded: false
|
allLoaded: false
|
||||||
}
|
},
|
||||||
|
statusVisibility: {}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
CHANGE_GODMODE_CHECKBOX_VALUE: (state, value) => {
|
CHANGE_GODMODE_CHECKBOX_VALUE: (state, value) => {
|
||||||
|
@ -41,6 +42,9 @@ const status = {
|
||||||
},
|
},
|
||||||
SET_LOADING: (state, status) => {
|
SET_LOADING: (state, status) => {
|
||||||
state.loading = status
|
state.loading = status
|
||||||
|
},
|
||||||
|
SET_STATUS_VISIBILITY: (state, visibility) => {
|
||||||
|
state.statusVisibility = visibility
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -64,6 +68,12 @@ const status = {
|
||||||
dispatch('FetchStatusesByInstance')
|
dispatch('FetchStatusesByInstance')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async FetchStatusesCount({ commit, getters }) {
|
||||||
|
commit('SET_LOADING', true)
|
||||||
|
const { data } = await fetchStatusesCount(getters.authHost, getters.token)
|
||||||
|
commit('SET_STATUS_VISIBILITY', data.status_visibility)
|
||||||
|
commit('SET_LOADING', false)
|
||||||
|
},
|
||||||
async FetchStatusesByInstance({ commit, getters, state, rootState }) {
|
async FetchStatusesByInstance({ commit, getters, state, rootState }) {
|
||||||
commit('SET_LOADING', true)
|
commit('SET_LOADING', true)
|
||||||
if (state.statusesByInstance.selectedInstance === '') {
|
if (state.statusesByInstance.selectedInstance === '') {
|
||||||
|
|
|
@ -155,7 +155,7 @@ export default {
|
||||||
margin: 0 30px;
|
margin: 0 30px;
|
||||||
}
|
}
|
||||||
.emoji-packs-header {
|
.emoji-packs-header {
|
||||||
margin: 22px 0 20px 15px;
|
margin: 10px 0 20px 15px;
|
||||||
}
|
}
|
||||||
.import-pack-button {
|
.import-pack-button {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
|
|
@ -246,7 +246,7 @@ export default {
|
||||||
padding: 5px 20px 0 20px
|
padding: 5px 20px 0 20px
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
margin: 22px 0 0 15px;
|
margin: 10px 0 0 15px;
|
||||||
}
|
}
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
|
|
@ -130,7 +130,7 @@ export default {
|
||||||
margin: 0 15px;
|
margin: 0 15px;
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
margin: 22px 0 20px 0;
|
margin: 10px 0 20px 0;
|
||||||
}
|
}
|
||||||
.el-timeline {
|
.el-timeline {
|
||||||
margin: 25px 45px 0 0;
|
margin: 25px 45px 0 0;
|
||||||
|
|
|
@ -50,7 +50,7 @@ export default {
|
||||||
padding-bottom: 0
|
padding-bottom: 0
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
margin: 22px 0 0 15px;
|
margin: 10px 0 0 15px;
|
||||||
}
|
}
|
||||||
.no-reports-message {
|
.no-reports-message {
|
||||||
color: gray;
|
color: gray;
|
||||||
|
|
|
@ -457,7 +457,7 @@
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.settings-header-container {
|
.settings-header-container {
|
||||||
margin: 15px;
|
margin: 10px 15px 15px 15px;
|
||||||
}
|
}
|
||||||
.nav-container {
|
.nav-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -3,6 +3,12 @@
|
||||||
<h1>
|
<h1>
|
||||||
{{ $t('statuses.statuses') }}
|
{{ $t('statuses.statuses') }}
|
||||||
</h1>
|
</h1>
|
||||||
|
<el-button-group>
|
||||||
|
<el-button plain>{{ $t('statuses.direct') }}: {{ statusVisibility.direct }}</el-button>
|
||||||
|
<el-button plain>{{ $t('statuses.private') }}: {{ statusVisibility.private }}</el-button>
|
||||||
|
<el-button plain>{{ $t('statuses.public') }}: {{ statusVisibility.public }}</el-button>
|
||||||
|
<el-button plain>{{ $t('statuses.unlisted') }}: {{ statusVisibility.unlisted }}</el-button>
|
||||||
|
</el-button-group>
|
||||||
<div class="filter-container">
|
<div class="filter-container">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="selectedInstance"
|
v-model="selectedInstance"
|
||||||
|
@ -111,10 +117,14 @@ export default {
|
||||||
},
|
},
|
||||||
statuses() {
|
statuses() {
|
||||||
return this.$store.state.status.fetchedStatuses
|
return this.$store.state.status.fetchedStatuses
|
||||||
|
},
|
||||||
|
statusVisibility() {
|
||||||
|
return this.$store.state.status.statusVisibility
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$store.dispatch('FetchPeers')
|
this.$store.dispatch('FetchPeers')
|
||||||
|
this.$store.dispatch('FetchStatusesCount')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleFilterChange() {
|
handleFilterChange() {
|
||||||
|
@ -142,6 +152,9 @@ export default {
|
||||||
<style rel='stylesheet/scss' lang='scss'>
|
<style rel='stylesheet/scss' lang='scss'>
|
||||||
.statuses-container {
|
.statuses-container {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
|
h1 {
|
||||||
|
margin: 10px 0 15px 0;
|
||||||
|
}
|
||||||
.status-container {
|
.status-container {
|
||||||
margin: 0 0 10px;
|
margin: 0 0 10px;
|
||||||
}
|
}
|
||||||
|
@ -163,9 +176,6 @@ export default {
|
||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
h1 {
|
|
||||||
margin: 22px 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width:480px) {
|
@media only screen and (max-width:480px) {
|
||||||
.checkbox-container {
|
.checkbox-container {
|
||||||
|
|
|
@ -245,7 +245,7 @@ export default {
|
||||||
}
|
}
|
||||||
.users-container {
|
.users-container {
|
||||||
h1 {
|
h1 {
|
||||||
margin: 22px 0 0 15px;
|
margin: 10px 0 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
|
|
Loading…
Reference in a new issue