akkoma-fe/src/components/mod_modal/tabs/users_tab/users_tab.js
2023-01-16 20:31:51 +02:00

71 lines
1.5 KiB
JavaScript

import Popover from 'src/components/popover/popover.vue'
import { forEach } from 'lodash'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faFilter,
faSearch
} from '@fortawesome/free-solid-svg-icons'
library.add(
faFilter,
faSearch
)
const UsersTab = {
data () {
return {
accountType: {
local: true,
external: false,
all: false
},
status: {
active: true,
deactivated: false,
pending: false,
unconfirmed: false,
all: false
},
actorType: {
person: true,
bot: true,
application: true,
all: true
}
}
},
components: {
Popover
},
methods: {
setAccountType (type) {
if (type === 'all') {
forEach(this.accountType, (k, v) => { this.accountType[v] = true })
} else {
forEach(this.accountType, (k, v) => { this.accountType[v] = false })
this.accountType[type] = true
}
},
setStatus (status) {
if (status === 'all') {
forEach(this.status, (k, v) => { this.status[v] = true })
} else {
forEach(this.status, (k, v) => { this.status[v] = false })
this.status[status] = true
}
},
setActorType (type) {
if (type === 'all') {
forEach(this.actorType, (k, v) => { this.actorType[v] = true })
} else {
forEach(this.actorType, (k, v) => { this.actorType[v] = false })
this.actorType[type] = true
}
}
}
}
export default UsersTab