initial implementation of godmode
This commit is contained in:
parent
068c3c0654
commit
aa0cef12b1
4 changed files with 113 additions and 5 deletions
66
src/components/user_profile/user_profile_admin_view.js
Normal file
66
src/components/user_profile/user_profile_admin_view.js
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
import { get } from 'lodash'
|
||||
import { mapState } from 'pinia'
|
||||
|
||||
import Conversation from 'src/components/conversation/conversation.vue'
|
||||
import List from 'src/components/list/list.vue'
|
||||
import UserCard from 'src/components/user_card/user_card.vue'
|
||||
|
||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useAdminSettingsStore } from 'src/stores/admin_settings.js'
|
||||
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
|
||||
|
||||
library.add(faCircleNotch)
|
||||
|
||||
const defaultTabKey = 'statuses'
|
||||
|
||||
const UserProfileAdminView = {
|
||||
data() {
|
||||
return {
|
||||
userId: null,
|
||||
godmode: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.userId = this.$route.params.id
|
||||
console.log(this.userId)
|
||||
useInterfaceStore().setForeignProfileBackground(this.user?.background_image)
|
||||
},
|
||||
updated() {
|
||||
useInterfaceStore().setForeignProfileBackground(this.user?.background_image)
|
||||
},
|
||||
unmounted() {
|
||||
useInterfaceStore().setForeignProfileBackground(null)
|
||||
},
|
||||
computed: {
|
||||
fetchOptions() {
|
||||
return {
|
||||
pageSize: 20,
|
||||
godmode: this.godmode,
|
||||
userId: this.userId,
|
||||
withReblogs: false
|
||||
}
|
||||
},
|
||||
user() {
|
||||
return this.$store.getters.findUser(this.userId)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
fetchStatuses(page) {
|
||||
return useAdminSettingsStore()
|
||||
.fetchStatuses({
|
||||
...this.fetchOptions,
|
||||
page,
|
||||
})
|
||||
.then(({ count, users }) => ({ count, items: users }))
|
||||
},
|
||||
},
|
||||
components: {
|
||||
UserCard,
|
||||
List,
|
||||
Conversation,
|
||||
},
|
||||
}
|
||||
|
||||
export default UserProfileAdminView
|
||||
30
src/components/user_profile/user_profile_admin_view.vue
Normal file
30
src/components/user_profile/user_profile_admin_view.vue
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<template>
|
||||
<div
|
||||
v-if="user"
|
||||
class="user-profile panel panel-default"
|
||||
>
|
||||
<div class="panel-body card-wrapper">
|
||||
<UserCard
|
||||
:user-id="userId"
|
||||
:compact="compactProfiles"
|
||||
avatar-action="zoom"
|
||||
:hide-bio="true"
|
||||
/>
|
||||
</div>
|
||||
<List
|
||||
:fetch-function="fetchStatuses"
|
||||
@select="onSelect"
|
||||
scrollable
|
||||
>
|
||||
<template #item="{item}">
|
||||
<Conversation
|
||||
:user="item"
|
||||
/>
|
||||
</template>
|
||||
</List>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./user_profile_admin_view.js"></script>
|
||||
|
||||
<style src="./user_profile.scss" lang="scss"></style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue