snake_case to camelCase
This commit is contained in:
parent
94ea4c33d6
commit
2630f17cd5
9 changed files with 186 additions and 182 deletions
|
|
@ -5,48 +5,48 @@ const PageList = {
|
|||
SelectableList
|
||||
},
|
||||
props: {
|
||||
box_only: {
|
||||
boxOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
page_size: {
|
||||
pageSize: {
|
||||
type: Number,
|
||||
default: 50
|
||||
},
|
||||
fetch_page: {
|
||||
fetchPage: {
|
||||
type: Function,
|
||||
default: async () => []
|
||||
},
|
||||
single_page: {
|
||||
singlePage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
page_index: 1,
|
||||
pageIndex: 1,
|
||||
items: [],
|
||||
can_load_more: true,
|
||||
is_loading: false
|
||||
canLoadMore: true,
|
||||
isLoading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset () {
|
||||
this.can_load_more = true
|
||||
this.page_index = 1
|
||||
this.canLoadMore = true
|
||||
this.pageIndex = 1
|
||||
this.items = []
|
||||
this.is_loading = false
|
||||
this.load_more() // load one page
|
||||
this.isLoading = false
|
||||
this.loadMore() // load one page
|
||||
},
|
||||
load_more () {
|
||||
if (!this.is_loading && this.can_load_more) {
|
||||
this.is_loading = true
|
||||
this.fetch_page(this.$store, {
|
||||
page: this.page_index++,
|
||||
page_size: this.page_size
|
||||
loadMore () {
|
||||
if (!this.isLoading && this.canLoadMore) {
|
||||
this.isLoading = true
|
||||
this.fetchPage(this.$store, {
|
||||
page: this.pageIndex++,
|
||||
pageSize: this.pageSize
|
||||
}).then(items => {
|
||||
this.items = [...this.items, ...items]
|
||||
this.is_loading = false
|
||||
this.isLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
@ -55,7 +55,7 @@ const PageList = {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
this.load_more()
|
||||
this.loadMore()
|
||||
}
|
||||
}
|
||||
export default PageList
|
||||
|
|
|
|||
|
|
@ -20,25 +20,25 @@
|
|||
</template>
|
||||
<template #load="slotProps">
|
||||
<slot
|
||||
v-if="is_loading"
|
||||
v-if="isLoading"
|
||||
name="load"
|
||||
v-bind="slotProps"
|
||||
/>
|
||||
</template>
|
||||
<template #empty="slotProps">
|
||||
<slot
|
||||
v-if="items.length == 0 && !is_loading"
|
||||
v-if="items.length == 0 && !isLoading"
|
||||
name="empty"
|
||||
v-bind="slotProps"
|
||||
/>
|
||||
</template>
|
||||
</SelectableList>
|
||||
<div v-if="!single_page">
|
||||
<div v-if="!singlePage">
|
||||
<button
|
||||
v-if="can_load_more"
|
||||
v-if="canLoadMore"
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="load_more"
|
||||
@click="loadMore"
|
||||
>
|
||||
{{ $t('page_list.load_more') }}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ import PageList from 'src/components/page_list/page_list.vue'
|
|||
import AdminStatusCard from 'src/components/settings_modal/admin_tabs/admin_status_card.vue'
|
||||
|
||||
const AdminCard = {
|
||||
props: ['user_details'],
|
||||
props: ['userDetails'],
|
||||
data () {
|
||||
return {
|
||||
progress: false,
|
||||
top_level_expanded: false,
|
||||
json_expanded: false,
|
||||
timeline_expanded: false,
|
||||
just_approved: false,
|
||||
just_confirmed: false,
|
||||
just_deleted: false,
|
||||
topLevelExpanded: false,
|
||||
jsonExpanded: false,
|
||||
timelineExpanded: false,
|
||||
justApproved: false,
|
||||
justConfirmed: false,
|
||||
justDeleted: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -21,45 +21,45 @@ const AdminCard = {
|
|||
return typeof(this.user) !== 'undefined'
|
||||
},
|
||||
user () {
|
||||
return this.$store.getters.findUser(this.user_details.id)
|
||||
return this.$store.getters.findUser(this.userDetails.id)
|
||||
},
|
||||
relationship () {
|
||||
return this.$store.getters.relationship(this.user_details.id)
|
||||
return this.$store.getters.relationship(this.userDetails.id)
|
||||
},
|
||||
is_local () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
isLocal () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
if (typeof(u) !== 'undefined') {
|
||||
return u.is_local === true
|
||||
}
|
||||
return false
|
||||
},
|
||||
is_admin () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
isAdmin () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
if (typeof(u) !== 'undefined') {
|
||||
return u.rights.admin === true
|
||||
}
|
||||
return false
|
||||
},
|
||||
is_moderator () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
isModerator () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
if (typeof(u) !== 'undefined') {
|
||||
return u.rights.moderator === true
|
||||
}
|
||||
return false
|
||||
},
|
||||
is_activated () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
isActivated () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
if (typeof(u) !== 'undefined') {
|
||||
return u.deactivated === false
|
||||
}
|
||||
return false
|
||||
},
|
||||
is_confirmed () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
return (u._original.pleroma.is_confirmed === true) || (this.just_confirmed === true)
|
||||
isConfirmed () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
return (u._original.pleroma.is_confirmed === true) || (this.justConfirmed === true)
|
||||
},
|
||||
is_approved () {
|
||||
return (this.user_details._original.is_approved === true) || (this.just_approved === true)
|
||||
isApproved () {
|
||||
return (this.userDetails._original.is_approved === true) || (this.justApproved === true)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
@ -69,62 +69,62 @@ const AdminCard = {
|
|||
AdminStatusCard,
|
||||
},
|
||||
methods: {
|
||||
toggle_admin (v) {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
toggleAdmin (v) {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
if (v === true) {
|
||||
this.$store.dispatch('adminAddUserToAdminGroup', u)
|
||||
} else {
|
||||
this.$store.dispatch('adminRemoveUserFromAdminGroup', u)
|
||||
}
|
||||
},
|
||||
toggle_moderator (v) {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
toggleModerator (v) {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
if (v === true) {
|
||||
this.$store.dispatch('adminAddUserToModeratorGroup', u)
|
||||
} else {
|
||||
this.$store.dispatch('adminRemoveUserFromModeratorGroup', u)
|
||||
}
|
||||
},
|
||||
toggle_activation (v) {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
toggleActivation (v) {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
if (v === true) {
|
||||
this.$store.dispatch('adminActivateUser', u)
|
||||
} else {
|
||||
this.$store.dispatch('adminDeactivateUser', u)
|
||||
}
|
||||
},
|
||||
confirm_user () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
confirmUser () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
this.$store.dispatch('adminConfirmUser', u)
|
||||
this.just_confirmed = true
|
||||
},
|
||||
resend_confirmation_email () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
resendConfirmationEmail () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
this.$store.dispatch('adminResendConfirmationEmail', u)
|
||||
},
|
||||
toggle_approval () {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
toggleApproval () {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
this.$store.dispatch('adminApproveUser', u)
|
||||
},
|
||||
force_update_user () {
|
||||
this.$store.dispatch('fetchUser', this.user_details.id)
|
||||
forceUpdateUser () {
|
||||
this.$store.dispatch('fetchUser', this.userDetails.id)
|
||||
},
|
||||
delete_selection () {
|
||||
deleteSelection () {
|
||||
const l = this.$refs.timelineList
|
||||
const s = l.getSelected()
|
||||
s.forEach(p => this.$store.dispatch('deleteStatus', p))
|
||||
l.reset()
|
||||
},
|
||||
delete_user () {
|
||||
if (!this.just_deleted) {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
deleteUser () {
|
||||
if (!this.justDeleted) {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
this.$store.dispatch('adminDeleteUser', u)
|
||||
this.just_deleted = true
|
||||
this.justDeleted = true
|
||||
}
|
||||
},
|
||||
fetch_statuses (store, opts) {
|
||||
const u = this.$store.getters.findUser(this.user_details.id)
|
||||
const res = store.dispatch('adminListStatuses', { user: u, opts: { page_size: opts.pageSize, godmode: true, with_reblogs: true}})
|
||||
fetchStatuses (store, opts) {
|
||||
const u = this.$store.getters.findUser(this.userDetails.id)
|
||||
const res = store.dispatch('adminListStatuses', { user: u, opts: { pageSize: opts.pageSize, godmode: true, withReblogs: true}})
|
||||
return Promise.resolve(res.then(r => r.activities))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
<template>
|
||||
<div v-if="!just_deleted">
|
||||
<div v-if="!justDeleted">
|
||||
<div v-if="!isLoaded">
|
||||
{{ $t('admin_dash.users.loading_user') }}
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="user_details.id !== $store.state.users.currentUser.id">
|
||||
<div v-if="userDetails.id !== $store.state.users.currentUser.id">
|
||||
<BasicUserCard :user="user" />
|
||||
<div v-if="!top_level_expanded">
|
||||
<div v-if="!topLevelExpanded">
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="top_level_expanded = true"
|
||||
@click="topLevelExpanded = true"
|
||||
>
|
||||
{{ $t('admin_dash.users.expand_user') }}
|
||||
</button>
|
||||
|
|
@ -23,68 +23,68 @@
|
|||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="top_level_expanded = false"
|
||||
@click="topLevelExpanded = false"
|
||||
>
|
||||
{{ $t('admin_dash.users.collapse_user') }}
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
v-if="is_local"
|
||||
v-if="isLocal"
|
||||
>
|
||||
<Checkbox
|
||||
:model-value="is_admin"
|
||||
@update:model-value="v => toggle_admin(v)"
|
||||
:model-value="isAdmin"
|
||||
@update:model-value="v => toggleAdmin(v)"
|
||||
>
|
||||
{{ $t('admin_dash.users.is_admin') }}
|
||||
</Checkbox>
|
||||
</li>
|
||||
<li
|
||||
v-if="is_local"
|
||||
v-if="isLocal"
|
||||
>
|
||||
<Checkbox
|
||||
:model-value="is_moderator"
|
||||
@update:model-value="v => toggle_moderator(v)"
|
||||
:model-value="isModerator"
|
||||
@update:model-value="v => toggleModerator(v)"
|
||||
>
|
||||
{{ $t('admin_dash.users.is_moderator') }}
|
||||
</Checkbox>
|
||||
</li>
|
||||
<li
|
||||
v-if="is_local && !just_confirmed && !is_confirmed"
|
||||
v-if="isLocal && !justConfirmed && !isConfirmed"
|
||||
>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="confirm_user()"
|
||||
@click="confirmUser()"
|
||||
>
|
||||
{{ $t('admin_dash.users.is_confirmed') }}
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
v-if="is_local && !just_confirmed && !is_confirmed"
|
||||
v-if="isLocal && !justConfirmed && !isConfirmed"
|
||||
>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="resend_confirmation_email()"
|
||||
@click="resendConfirmationEmail()"
|
||||
>
|
||||
{{ $t('admin_dash.users.resend_confirmation_email') }}
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
v-if="is_local && !is_approved"
|
||||
v-if="isLocal && !isApproved"
|
||||
>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="toggle_approval(true)"
|
||||
@click="toggleApproval(true)"
|
||||
>
|
||||
{{ $t('admin_dash.users.approve') }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<Checkbox
|
||||
:model-value="is_activated"
|
||||
@update:model-value="v => toggle_activation(v)"
|
||||
:model-value="isActivated"
|
||||
@update:model-value="v => toggleActivation(v)"
|
||||
>
|
||||
{{ $t('admin_dash.users.is_active') }}
|
||||
</Checkbox>
|
||||
|
|
@ -93,18 +93,18 @@
|
|||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="delete_user()"
|
||||
@click="deleteUser()"
|
||||
>
|
||||
{{ $t('admin_dash.users.delete_user') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-if="!timeline_expanded">
|
||||
<div v-if="!timelineExpanded">
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="timeline_expanded = true"
|
||||
@click="timelineExpanded = true"
|
||||
>
|
||||
{{ $t('admin_dash.users.expand_timeline') }}
|
||||
</button>
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="timeline_expanded = false"
|
||||
@click="timelineExpanded = false"
|
||||
>
|
||||
{{ $t('admin_dash.users.collapse_timeline') }}
|
||||
</button>
|
||||
|
|
@ -124,22 +124,22 @@
|
|||
ref="timelineList"
|
||||
:refresh="true"
|
||||
:get-key="i => i"
|
||||
:box_only="true"
|
||||
:page_size="20"
|
||||
:single_page="true"
|
||||
:fetch_page="(store, opts) => fetch_statuses(store, opts)"
|
||||
:box-only="true"
|
||||
:page-size="20"
|
||||
:single-page="true"
|
||||
:fetch-page="(store, opts) => fetchStatuses(store, opts)"
|
||||
>
|
||||
<template #header>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="delete_selection"
|
||||
@click="deleteSelection"
|
||||
>
|
||||
{{ $t('admin_dash.users.delete') }}
|
||||
</button>
|
||||
</template>
|
||||
<template #item="{item}">
|
||||
<AdminStatusCard :status_details="item" />
|
||||
<AdminStatusCard :status-details="item" />
|
||||
</template>
|
||||
<template #empty>
|
||||
<p> {{ $t('admin_dash.users.user_has_no_posts') }} </p>
|
||||
|
|
@ -149,11 +149,11 @@
|
|||
</template>
|
||||
</PageList>
|
||||
</div>
|
||||
<div v-if="!json_expanded">
|
||||
<div v-if="!jsonExpanded">
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="json_expanded = true"
|
||||
@click="jsonExpanded = true"
|
||||
>
|
||||
{{ $t('admin_dash.users.expand_raw_info') }}
|
||||
</button>
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="json_expanded = false"
|
||||
@click="jsonExpanded = false"
|
||||
>
|
||||
{{ $t('admin_dash.users.collapse_raw_info') }}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -4,27 +4,27 @@ import Status from 'src/components/status/status.vue'
|
|||
import { parseStatus } from 'src/services/entity_normalizer/entity_normalizer.service.js'
|
||||
|
||||
const AdminStatusCard = {
|
||||
props: ['status_details'],
|
||||
props: ['statusDetails'],
|
||||
data () {
|
||||
return {
|
||||
json_expanded: false,
|
||||
status_cache: undefined,
|
||||
jsonExpanded: false,
|
||||
statusCache: undefined,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
is_sensitive () {
|
||||
return this.status_details.sensitive === true
|
||||
isSensitive () {
|
||||
return this.statusDetails.sensitive === true
|
||||
},
|
||||
visibility () {
|
||||
return this.status_details.visibility
|
||||
return this.statusDetails.visibility
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change_sensitivity (v) {
|
||||
this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.status_details.id, sensitive: v }}).then(res => parseStatus(res)).then(s => this.status_cache = s)
|
||||
changeSensitivity (v) {
|
||||
this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.statusDetails.id, sensitive: v }}).then(res => parseStatus(res)).then(s => this.statusCache = s)
|
||||
},
|
||||
change_visibility (v) {
|
||||
this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.status_details.id, visibility: v }}).then(res => parseStatus(res)).then(s => this.status_cache = s)
|
||||
changeVisibility (v) {
|
||||
this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.statusDetails.id, visibility: v }}).then(res => parseStatus(res)).then(s => this.statusCache = s)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
@ -33,7 +33,7 @@ const AdminStatusCard = {
|
|||
Status,
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.status_details.id }}).then(res => parseStatus(res)).then(s => this.status_cache = s)
|
||||
this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.statusDetails.id }}).then(res => parseStatus(res)).then(s => this.statusCache = s)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
class="setting-list"
|
||||
>
|
||||
<li>
|
||||
<span> {{ $t('admin_dash.users.status_id') }}: {{ status_details.id }} </span>
|
||||
<span> {{ $t('admin_dash.users.status_id') }}: {{ statusDetails.id }} </span>
|
||||
</li>
|
||||
<li>
|
||||
<span> {{ $t('admin_dash.users.created_at') }}: {{ new Date(status_details.created_at).toLocaleString() }} </span>
|
||||
<span> {{ $t('admin_dash.users.created_at') }}: {{ new Date(statusDetails.created_at).toLocaleString() }} </span>
|
||||
</li>
|
||||
<li>
|
||||
<span v-if="status_details.edited_at !== null"> {{ $t('admin_dash.users.edited_at') }}: {{ new Date(status_details.edited_at).toLocaleString() }} </span>
|
||||
<span v-if="statusDetails.edited_at !== null"> {{ $t('admin_dash.users.edited_at') }}: {{ new Date(statusDetails.edited_at).toLocaleString() }} </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2> {{ $t('admin_dash.users.title_content') }}: </h2>
|
||||
|
|
@ -20,10 +20,10 @@
|
|||
>
|
||||
<li>
|
||||
<Status
|
||||
v-if="typeof(status_cache) !== 'undefined'"
|
||||
v-if="typeof(statusCache) !== 'undefined'"
|
||||
class="Notification"
|
||||
:compact="true"
|
||||
:statusoid="status_cache"
|
||||
:statusoid="statusCache"
|
||||
@interacted="false"
|
||||
/>
|
||||
</li>
|
||||
|
|
@ -31,15 +31,15 @@
|
|||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="delete_status(status.id)"
|
||||
@click="deleteStatus(status.id)"
|
||||
>
|
||||
{{ $t('admin_dash.users.delete_status') }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<Checkbox
|
||||
:model-value="is_sensitive"
|
||||
@update:model-value="v => change_sensitivity(v)"
|
||||
:model-value="isSensitive"
|
||||
@update:model-value="v => changeSensitivity(v)"
|
||||
>
|
||||
{{ $t('admin_dash.users.content_nsfw') }}
|
||||
</Checkbox>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
<li>
|
||||
<Select
|
||||
:model-value="visibility"
|
||||
@update:model-value="v => change_visibility(v)"
|
||||
@update:model-value="v => changeVisibility(v)"
|
||||
>
|
||||
<option
|
||||
value="public"
|
||||
|
|
@ -72,14 +72,14 @@
|
|||
</Select>
|
||||
</li>
|
||||
<li>
|
||||
<a :href="status_details.url"> {{ $t('admin_dash.users.link_source') }} </a>
|
||||
<a :href="statusDetails.url"> {{ $t('admin_dash.users.link_source') }} </a>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-if="!json_expanded">
|
||||
<div v-if="!jsonExpanded">
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="json_expanded = !json_expanded"
|
||||
@click="jsonExpanded = !jsonExpanded"
|
||||
>
|
||||
{{ $t('admin_dash.users.expand_raw_info') }}
|
||||
</button>
|
||||
|
|
@ -88,12 +88,12 @@
|
|||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="json_expanded = !json_expanded"
|
||||
@click="jsonExpanded = !jsonExpanded"
|
||||
>
|
||||
{{ $t('admin_dash.users.collapse_raw_info') }}
|
||||
</button>
|
||||
<h2> {{ $t('admin_dash.users.title_details') }} </h2>
|
||||
<pre> {{ JSON.stringify(status_details, null, 2) }} </pre>
|
||||
<pre> {{ JSON.stringify(statusDetails, null, 2) }} </pre>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -16,34 +16,36 @@ const UsersTab = {
|
|||
data() {
|
||||
return {
|
||||
init: false,
|
||||
filters_origin: 'local',
|
||||
filters_activity: 'all',
|
||||
filters_permission: 'all',
|
||||
filters_query: '',
|
||||
filters_name: '',
|
||||
filters_email: '',
|
||||
filtersOrigin: 'local',
|
||||
filtersActivity: 'all',
|
||||
filtersPermission: 'all',
|
||||
filtersNeedApproval: false,
|
||||
filtersUnconfirmed: false,
|
||||
filtersQuery: '',
|
||||
filtersName: '',
|
||||
filtersEmail: '',
|
||||
expandedUser: null,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filters_is_admin () {
|
||||
return this.filters_permission === 'admin' || this.filters_permission === 'modsnadmins'
|
||||
filtersIsAdmin () {
|
||||
return this.filtersPermission === 'admin' || this.filtersPermission === 'modsnadmins'
|
||||
},
|
||||
filters_is_moderator () {
|
||||
return this.filters_permission === 'moderator' || this.filters_permission === 'modsnadmins'
|
||||
filtersIsModerator () {
|
||||
return this.filtersPermission === 'moderator' || this.filtersPermission === 'modsnadmins'
|
||||
},
|
||||
filters_active () {
|
||||
return this.filters_activity === 'active'
|
||||
filtersActive () {
|
||||
return this.filtersActivity === 'active'
|
||||
},
|
||||
filters_deactivated () {
|
||||
return this.filters_activity === 'deactivated'
|
||||
filtersDeactivated () {
|
||||
return this.filtersActivity === 'deactivated'
|
||||
},
|
||||
filters_local () {
|
||||
return this.filters_origin === 'local'
|
||||
filtersLocal () {
|
||||
return this.filtersOrigin === 'local'
|
||||
},
|
||||
filters_external () {
|
||||
return this.filters_origin === 'external'
|
||||
filtersExternal () {
|
||||
return this.filtersOrigin === 'external'
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
@ -56,36 +58,38 @@ const UsersTab = {
|
|||
TabSwitcher,
|
||||
},
|
||||
methods: {
|
||||
fetch_page (store, opts) {
|
||||
fetchPage (store, opts) {
|
||||
if(!this.init) return new Promise(() => [])
|
||||
const filters = {
|
||||
is_admin: this.filters_is_admin,
|
||||
is_moderator: this.filters_is_moderator,
|
||||
active: this.filters_active,
|
||||
deactivated: this.filters_deactivated,
|
||||
local: this.filters_local,
|
||||
external: this.filters_external
|
||||
isAdmin: this.filtersIsAdmin,
|
||||
isModerator: this.filtersIsModerator,
|
||||
active: this.filtersActive,
|
||||
deactivated: this.filtersDeactivated,
|
||||
local: this.filtersLocal,
|
||||
external: this.filtersExternal,
|
||||
needApproval: this.filtersNeedApproval,
|
||||
unconfirmed: this.filtersUnconfirmeUnconfirmed
|
||||
}
|
||||
const users = store.dispatch('fetchAdminUsers', { ...opts, ...{
|
||||
query: this.filters_query,
|
||||
query: this.filtersQuery,
|
||||
filters,
|
||||
name: this.filters_name,
|
||||
email: this.filters_email
|
||||
name: this.filtersName,
|
||||
email: this.filtersEmail
|
||||
}})
|
||||
return users
|
||||
},
|
||||
reset () {
|
||||
this.$refs.userList.reset()
|
||||
},
|
||||
activate_selection () {
|
||||
activateSelection () {
|
||||
const s = this.$refs.userList.getSelected()
|
||||
s.forEach(u => this.$store.dispatch('adminActivateUser', this.$store.getters.findUser(u.id)))
|
||||
},
|
||||
deactivate_selection () {
|
||||
deactivateSelection () {
|
||||
const s = this.$refs.userList.getSelected()
|
||||
s.forEach(u => this.$store.dispatch('adminDeactivateUser', this.$store.getters.findUser(u.id)))
|
||||
},
|
||||
delete_selection () {
|
||||
deleteSelection () {
|
||||
const s = this.$refs.userList.getSelected()
|
||||
s.forEach(u => this.$store.dispatch('adminDeleteUser', this.$store.getters.findUser(u.id)))
|
||||
this.reset()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
>
|
||||
<li>
|
||||
<input
|
||||
v-model="filters_query"
|
||||
v-model="filtersQuery"
|
||||
:placeholder="$t('admin_dash.users.placeholder_query')"
|
||||
class="input string-input"
|
||||
@input="reset()"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<input
|
||||
v-model="filters_name"
|
||||
v-model="filtersName"
|
||||
:placeholder="$t('admin_dash.users.placeholder_name')"
|
||||
class="input string-input"
|
||||
@input="reset()"
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<input
|
||||
v-model="filters_email"
|
||||
v-model="filtersEmail"
|
||||
:placeholder="$t('admin_dash.users.placeholder_email')"
|
||||
class="input string-input"
|
||||
@input="reset()"
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<Select
|
||||
v-model="filters_origin"
|
||||
v-model="filtersOrigin"
|
||||
@update:model-value="reset"
|
||||
>
|
||||
<option
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<Select
|
||||
v-model="filters_activity"
|
||||
v-model="filtersActivity"
|
||||
@update:model-value="reset"
|
||||
>
|
||||
<option
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<Select
|
||||
v-model="filters_permission"
|
||||
v-model="filtersPermission"
|
||||
@update:model-value="reset"
|
||||
>
|
||||
<option
|
||||
|
|
@ -102,14 +102,14 @@
|
|||
</li>
|
||||
<li>
|
||||
<Checkbox
|
||||
@update:model-value="v => {filters.need_approval = v; reset();}"
|
||||
@update:model-value="v => {filtersNneedApproval = v; reset();}"
|
||||
>
|
||||
{{ $t('admin_dash.users.only_unapproved') }}
|
||||
</Checkbox>
|
||||
</li>
|
||||
<li>
|
||||
<Checkbox
|
||||
@update:model-value="v => {filters.unconfirmed = v; reset();}"
|
||||
@update:model-value="v => {filtersUnconfirmed = v; reset();}"
|
||||
>
|
||||
{{ $t('admin_dash.users.only_unconfirmed') }}
|
||||
</Checkbox>
|
||||
|
|
@ -133,35 +133,35 @@
|
|||
ref="userList"
|
||||
:refresh="true"
|
||||
:get-key="i => i"
|
||||
:box_only="true"
|
||||
:page_size="20"
|
||||
:fetch_page="(store, opts) => fetch_page(store, opts)"
|
||||
:box-only="true"
|
||||
:page-size="20"
|
||||
:fetch-page="(store, opts) => fetchPage(store, opts)"
|
||||
>
|
||||
<template #header>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="activate_selection"
|
||||
@click="activateSelection"
|
||||
>
|
||||
{{ $t('admin_dash.users.activate') }}
|
||||
</button>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="deactivate_selection"
|
||||
@click="deactivateSelection"
|
||||
>
|
||||
{{ $t('admin_dash.users.deactivate') }}
|
||||
</button>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="delete_selection"
|
||||
@click="deleteSelection"
|
||||
>
|
||||
{{ $t('admin_dash.users.delete') }}
|
||||
</button>
|
||||
</template>
|
||||
<template #item="{item}">
|
||||
<AdminCard :user_details="item" />
|
||||
<AdminCard :user-details="item" />
|
||||
</template>
|
||||
</PageList>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -116,34 +116,34 @@ const PLEROMA_ADMIN_CONFIG_URL = '/api/v1/pleroma/admin/config'
|
|||
const PLEROMA_ADMIN_DESCRIPTIONS_URL = '/api/v1/pleroma/admin/config/descriptions'
|
||||
const PLEROMA_ADMIN_FRONTENDS_URL = '/api/v1/pleroma/admin/frontends'
|
||||
const PLEROMA_ADMIN_FRONTENDS_INSTALL_URL = '/api/v1/pleroma/admin/frontends/install'
|
||||
const PLEROMA_ADMIN_USERS_URL = ({page, page_size, filters = {}, query = '', name = '', email = ''}) => {
|
||||
const PLEROMA_ADMIN_USERS_URL = ({page, pageSize, filters = {}, query = '', name = '', email = ''}) => {
|
||||
const {
|
||||
local = false,
|
||||
external = false,
|
||||
active = false,
|
||||
need_approval = false,
|
||||
needApproval = false,
|
||||
unconfirmed = false,
|
||||
deactivated = false,
|
||||
is_admin = true,
|
||||
is_moderator = true,
|
||||
isAdmin = true,
|
||||
isModerator = true,
|
||||
} = filters
|
||||
const filters_str = [
|
||||
local && 'local',
|
||||
external && 'external',
|
||||
active && 'active',
|
||||
need_approval && 'need_approval',
|
||||
needApproval && 'need_approval',
|
||||
unconfirmed && 'unconfirmed',
|
||||
deactivated && 'deactivated',
|
||||
is_admin && 'is_admin',
|
||||
is_moderator && 'is_moderator'
|
||||
isAdmin && 'is_admin',
|
||||
isModerator && 'is_moderator'
|
||||
].filter(x => x).join(',')
|
||||
return `/api/v1/pleroma/admin/users?page=${page}&page_size=${page_size}&filters=${filters_str}&query=${query}&name=${name}&email=${email}`
|
||||
return `/api/v1/pleroma/admin/users?page=${page}&page_size=${pageSize}&filters=${filters_str}&query=${query}&name=${name}&email=${email}`
|
||||
}
|
||||
const PLEROMA_ADMIN_MODIFY_GROUP_URL = (nickname, group) => `/api/v1/pleroma/admin/users/${nickname}/permission_group/${group}`
|
||||
const PLEROMA_ADMIN_CONFIRM_USER_URL = '/api/v1/pleroma/admin/users/confirm_email'
|
||||
const PLEROMA_ADMIN_RESEND_CONFIRMATION_EMAIL_URL = '/api/v1/pleroma/admin/users/resend_confirmation_email'
|
||||
const PLEROMA_ADMIN_APPROVE_URL = '/api/v1/pleroma/admin/users/approve'
|
||||
const PLEROMA_ADMIN_LIST_STATUSES_URL = (id, page_size, godmode, with_reblogs) => `/api/v1/pleroma/admin/users/${id}/statuses?page_size=${page_size}&godmode=${godmode}&with_reblogs=${with_reblogs}`
|
||||
const PLEROMA_ADMIN_LIST_STATUSES_URL = (id, page_size, godmode, with_reblogs) => `/api/v1/pleroma/admin/users/${id}/statuses?page_size=${pageSize}&godmode=${godmode}&with_reblogs=${withReblogs}`
|
||||
const PLEROMA_ADMIN_CHANGE_STATUS_SCOPE_URL = (id) => `/api/v1/pleroma/admin/statuses/${id}`
|
||||
|
||||
const PLEROMA_EMOJI_RELOAD_URL = '/api/pleroma/admin/reload_emoji'
|
||||
|
|
@ -1563,8 +1563,8 @@ const adminApproveUser = ({user : { screen_name: nickname }, credentials }) => {
|
|||
return r
|
||||
}
|
||||
|
||||
const adminListStatuses = ({user: { id }, opts: { page_size, godmode, with_reblogs }, credentials }) => {
|
||||
const url = PLEROMA_ADMIN_LIST_STATUSES_URL(id, page_size, godmode, with_reblogs)
|
||||
const adminListStatuses = ({user: { id }, opts: { pageSize, godmode, withReblogs }, credentials }) => {
|
||||
const url = PLEROMA_ADMIN_LIST_STATUSES_URL(id, pageSize, godmode, withReblogs)
|
||||
return promisedRequest({url: url,
|
||||
credentials,
|
||||
method: 'GET'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue