-
-
-
-
-
-
-
-
-
toggle_admin(v)"
- >
- {{ $t('admin_dash.users.is_admin') }}
-
-
toggle_moderator(v)"
- >
- {{ $t('admin_dash.users.is_moderator') }}
-
-
-
-
-
-
-
-
-
-
toggle_activation(v)"
- >
- {{ $t('admin_dash.users.is_active') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ $t('admin_dash.users.expand_user') }}
+
+
+
+ {{ $t('admin_dash.users.collapse_user') }}
+
+
+
toggle_admin(v)"
+ >
+ {{ $t('admin_dash.users.is_admin') }}
+
+
toggle_moderator(v)"
+ >
+ {{ $t('admin_dash.users.is_moderator') }}
+
+
+
+ {{ $t('admin_dash.users.is_confirmed') }}
+
+
+ {{ $t('admin_dash.users.resend_confirmation_email') }}
+
+
+
+
+ {{ $t('admin_dash.users.approve') }}
+
+
+
+
toggle_activation(v)"
+ >
+ {{ $t('admin_dash.users.is_active') }}
+
+
+ {{ $t('admin_dash.users.delete_user') }}
+
+
+
+
+ {{ $t('admin_dash.users.expand_timeline') }}
+
+
+
+
+ {{ $t('admin_dash.users.collapse_timeline') }}
+
+
+
+
+
+
+
+
+
+ {{ $t('admin_dash.users.expand_raw_info') }}
+
+
+
+
+ {{ $t('admin_dash.users.collapse_raw_info') }}
+
+
{{ $t('admin_dash.users.title_database') }}
+
{{ JSON.stringify(user, null, 2) }}
+
{{ $t('admin_dash.users.title_details') }}
+
{{ JSON.stringify(user_details, null, 2) }}
+
+
diff --git a/src/components/settings_modal/admin_tabs/admin_status_card.js b/src/components/settings_modal/admin_tabs/admin_status_card.js
index 312fe0232..0ea042782 100644
--- a/src/components/settings_modal/admin_tabs/admin_status_card.js
+++ b/src/components/settings_modal/admin_tabs/admin_status_card.js
@@ -4,27 +4,27 @@ import StatusBody from 'src/components/status_body/status_body.vue'
import { parseStatus } from 'src/services/entity_normalizer/entity_normalizer.service.js'
const AdminStatusCard = {
- props: ['statusDetails'],
+ props: ['status_details'],
data () {
return {
json_expanded: false,
- statusCache: undefined,
+ status_cache: undefined,
}
},
computed: {
is_sensitive () {
- return this.statusDetails.sensitive === true
+ return this.status_details.sensitive === true
},
visibility () {
- return this.statusDetails.visibility
+ return this.status_details.visibility
}
},
methods: {
change_sensitivity (v) {
- this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.statusDetails.id, sensitive: v }}).then(res => parseStatus(res)).then(p => p).then(s => this.statusCache = s)
+ this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.status_details.id, sensitive: v }}).then(res => parseStatus(res)).then(s => this.status_cache = s)
},
change_visibility (v) {
- this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.statusDetails.id, visibility: v }}).then(res => parseStatus(res)).then(p => p).then(s => this.statusCache = s)
+ this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.status_details.id, visibility: v }}).then(res => parseStatus(res)).then(s => this.status_cache = s)
}
},
components: {
@@ -33,7 +33,7 @@ const AdminStatusCard = {
StatusBody,
},
mounted () {
- this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.statusDetails.id }}).then(res => parseStatus(res)).then(p => p).then(s => this.statusCache = s)
+ this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.status_details.id }}).then(res => parseStatus(res)).then(s => this.status_cache = s)
}
}
diff --git a/src/components/settings_modal/admin_tabs/admin_status_card.vue b/src/components/settings_modal/admin_tabs/admin_status_card.vue
index 98365b41d..f969b32db 100644
--- a/src/components/settings_modal/admin_tabs/admin_status_card.vue
+++ b/src/components/settings_modal/admin_tabs/admin_status_card.vue
@@ -1,14 +1,14 @@
{{ $t('admin_dash.users.title_info') }}:
-
{{ $t('admin_dash.users.status_id') }}: {{ statusDetails.id }}
-
{{ $t('admin_dash.users.created_at') }}: {{ statusDetails.created_at }}
-
{{ $t('admin_dash.users.edited_at') }}: {{ statusDetails.edited_at }}
+
{{ $t('admin_dash.users.status_id') }}: {{ status_details.id }}
+
{{ $t('admin_dash.users.created_at') }}: {{ status_details.created_at }}
+
{{ $t('admin_dash.users.edited_at') }}: {{ status_details.edited_at }}
{{ $t('admin_dash.users.title_content') }}:
- {{ $t('admin_dash.users.link_source') }}
+ {{ $t('admin_dash.users.link_source') }}
{{ $t('admin_dash.users.collapse_raw_info') }}
-
details
-
{{ JSON.stringify(statusDetails, null, 2) }}
+
{{ $t('admin_dash.users.title_details') }}
+
{{ JSON.stringify(status_details, null, 2) }}
diff --git a/src/components/settings_modal/admin_tabs/users_tab.js b/src/components/settings_modal/admin_tabs/users_tab.js
index 48a81b2fb..a3d43468d 100644
--- a/src/components/settings_modal/admin_tabs/users_tab.js
+++ b/src/components/settings_modal/admin_tabs/users_tab.js
@@ -7,147 +7,137 @@ import PageList from 'src/components/page_list/page_list.vue'
import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
const UsersTab = {
- provide () {
- return {
- defaultDraftMode: true,
- defaultSource: 'admin'
+ provide () {
+ return {
+ defaultDraftMode: true,
+ defaultSource: 'admin'
+ }
+ },
+ data() {
+ return {
+ /* filters must match the filter options below initially, or the ui is gonna have a computer moment
+ * no, i won't fix this
+ * */
+ filters_origin: 'local',
+ filters_activity: 'all',
+ filters_permission: 'all',
+ filters_query: '',
+ filters_name: '',
+ filters_email: '',
+ filters: {
+ local: false,
+ external: false,
+ active: false,
+ need_approval: false,
+ unconfirmed: false,
+ deactivated: false,
+ is_admin: false,
+ is_moderator: false,
+ },
+ expandedUser: null,
+ loading: false
+ }
+ },
+ components: {
+ Checkbox,
+ Select,
+ BasicUserCard,
+ PageList,
+ ProgressButton,
+ AdminCard,
+ TabSwitcher,
+ },
+ methods: {
+ update_origin (v) {
+ switch (v) {
+ case 'local':
+ this.filters.local = true
+ this.filters.external = false
+ break;
+ case 'external':
+ this.filters.local = false
+ this.filters.external = true
+ break;
+ default:
+ case 'all':
+ this.filters.local = false
+ this.filters.external = false
+ break;
}
- },
- data() {
- return {
- /* filters must match the filter options below initially, or the ui is gonna have a computer moment
- * no, i won't fix this
- * */
- filters_origin: "all",
- filters_activity: "all",
- filters_permission: "all",
- filters_query: "",
- filters_name: "",
- filters_email: "",
- filters: {
- local: false,
- external: false,
- active: false,
- need_approval: false,
- unconfirmed: false,
- deactivated: false,
- is_admin: false,
- is_moderator: false,
- },
- expandedUser: null,
- loading: false
+ this.reset()
+ },
+ update_activity (v) {
+ switch (v) {
+ case 'active':
+ this.filters.active = true
+ this.filters.deactivated = false
+ break;
+ case 'deactivated':
+ this.filters.active = false
+ this.filters.deactivated = true
+ break;
+ default:
+ case 'all':
+ this.filters.active = false
+ this.filters.deactivated = false
+ break;
}
- },
- components: {
- Checkbox,
- Select,
- BasicUserCard,
- PageList,
- ProgressButton,
- AdminCard,
- TabSwitcher,
- },
- methods: {
- update_origin (v) {
- switch (v) {
- case 'local':
- this.filters.local = true
- this.filters.external = false
- break;
- case 'external':
- this.filters.local = false
- this.filters.external = true
- break;
- default:
- case 'all':
- this.filters.local = false
- this.filters.external = false
- break;
- }
- this.reset()
- },
- update_activity (v) {
- switch (v) {
- case 'active':
- this.filters.active = true
- this.filters.deactivated = false
- break;
- case 'deactivated':
- this.filters.active = false
- this.filters.deactivated = true
- break;
- default:
- case 'all':
- this.filters.active = false
- this.filters.deactivated = false
- break;
- }
- this.reset()
- },
- update_permission (v) {
- switch (v) {
- case 'admin':
- this.filters.is_admin = true
- this.filters.is_moderator = false
- break;
- case 'moderator':
- this.filters.is_admin = false
- this.filters.is_moderator = true
- break;
- case 'modsnadmins':
- this.filters.is_admin = true
- this.filters.is_moderator = true
- break;
- default:
- case 'all':
- this.filters.is_admin = false
- this.filters.is_moderator = false
- break;
- }
- this.reset()
- },
- update_query (v) {
- this.filters_query = v
- this.reset()
- },
- update_name (v) {
- this.filters_name = v
- this.reset()
- },
- update_email (v) {
- this.filters_email = v
- this.reset()
- },
- delete_user () {},
- fetch_page (store, opts) {
- opts.query = this.filters_query
- opts.filters = this.filters
- opts.name = this.filters_name
- opts.email = this.filters_email
- const users = store.dispatch('fetchAdminUsers', opts)
- return users
- },
- reset () {
- this.$refs.userList.reset()
- },
- toggleLocal () {
- this.filters.local = !this.filters.local
- this.reset()
- },
- activate_selection () {
- const s = this.$refs.userList.selected()
- s.forEach(u => this.$store.dispatch('adminActivateUser', this.$store.getters.findUser(u.id)))
- },
- deactivate_selection () {
- const s = this.$refs.userList.selected()
- s.forEach(u => this.$store.dispatch('adminDeactivateUser', this.$store.getters.findUser(u.id)))
- },
- delete_selection () {
- const s = this.$refs.userList.selected()
- s.forEach(u => this.$store.dispatch('adminDeleteUser', this.$store.getters.findUser(u.id)))
- this.reset()
+ this.reset()
+ },
+ update_permission (v) {
+ switch (v) {
+ case 'admin':
+ this.filters.is_admin = true
+ this.filters.is_moderator = false
+ break;
+ case 'moderator':
+ this.filters.is_admin = false
+ this.filters.is_moderator = true
+ break;
+ case 'modsnadmins':
+ this.filters.is_admin = true
+ this.filters.is_moderator = true
+ break;
+ default:
+ case 'all':
+ this.filters.is_admin = false
+ this.filters.is_moderator = false
+ break;
}
- }
+ this.reset()
+ },
+ fetch_page (store, opts) {
+ const users = store.dispatch('fetchAdminUsers', { ...opts, ...{
+ query: this.filters_query,
+ filters: this.filters,
+ name: this.filters_name,
+ email: this.filters_email
+ }})
+ return users
+ },
+ reset () {
+ this.$refs.userList.reset()
+ },
+ activate_selection () {
+ const s = this.$refs.userList.selected()
+ s.forEach(u => this.$store.dispatch('adminActivateUser', this.$store.getters.findUser(u.id)))
+ },
+ deactivate_selection () {
+ const s = this.$refs.userList.selected()
+ s.forEach(u => this.$store.dispatch('adminDeactivateUser', this.$store.getters.findUser(u.id)))
+ },
+ delete_selection () {
+ const s = this.$refs.userList.selected()
+ s.forEach(u => this.$store.dispatch('adminDeleteUser', this.$store.getters.findUser(u.id)))
+ this.reset()
+ }
+ },
+ mounted () {
+ /* make sure init state is correct */
+ this.update_origin(this.filters_origin)
+ this.update_activity(this.filters_activity)
+ this.update_permission(this.filters_permission)
+ }
}
export default UsersTab
diff --git a/src/components/settings_modal/admin_tabs/users_tab.scss b/src/components/settings_modal/admin_tabs/users_tab.scss
index a42308167..d9fa70d1b 100644
--- a/src/components/settings_modal/admin_tabs/users_tab.scss
+++ b/src/components/settings_modal/admin_tabs/users_tab.scss
@@ -1,3 +1,10 @@
.user-tab {
height: 100%;
}
+
+.stacked-container {
+ /* vite:stylelint complains about this, saying it's not important.
+ this is a mistake: it is important, so vite:stylelint should shut up */
+ display: flex !important;
+ flex-direction: column;
+}
diff --git a/src/components/settings_modal/admin_tabs/users_tab.vue b/src/components/settings_modal/admin_tabs/users_tab.vue
index e1a3d026e..308680c50 100644
--- a/src/components/settings_modal/admin_tabs/users_tab.vue
+++ b/src/components/settings_modal/admin_tabs/users_tab.vue
@@ -2,24 +2,28 @@
diff --git a/src/i18n/en.json b/src/i18n/en.json
index eba99c125..d498841eb 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -1175,9 +1175,11 @@
"scope_unlisted": "unlisted",
"scope_private": "private",
"scope_direct": "direct",
- "title_info": "info",
- "title_content": "content",
- "link_source": "source"
+ "title_info": "Info",
+ "title_content": "Content",
+ "link_source": "source",
+ "title_database": "Database",
+ "title_details": "Details"
},
"limits": {
"arbitrary_limits": "Arbitrary limits",
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index bad234153..5a468738e 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -115,7 +115,7 @@ const PLEROMA_ADMIN_CONFIG_URL = '/api/pleroma/admin/config'
const PLEROMA_ADMIN_DESCRIPTIONS_URL = '/api/pleroma/admin/config/descriptions'
const PLEROMA_ADMIN_FRONTENDS_URL = '/api/pleroma/admin/frontends'
const PLEROMA_ADMIN_FRONTENDS_INSTALL_URL = '/api/pleroma/admin/frontends/install'
-const PLEROMA_ADMIN_USERS_URL = ({page, pageSize, filters = {}, query = '', name = '', email = ''}) => {
+const PLEROMA_ADMIN_USERS_URL = ({page, page_size, filters = {}, query = '', name = '', email = ''}) => {
const {
local = false,
external = false,
@@ -134,7 +134,7 @@ const PLEROMA_ADMIN_USERS_URL = ({page, pageSize, filters = {}, query = '', name
+ (deactivated ? 'deactivated,' : '')
+ (is_admin ? 'is_admin,' : '')
+ (is_moderator ? 'is_moderator,' : '')
- return `/api/v1/pleroma/admin/users?page=${page}&page_size=${pageSize}&filters=${filters_str}&query=${query}&name=${name}&email=${email}`
+ return `/api/v1/pleroma/admin/users?page=${page}&page_size=${page_size}&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'