mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 14:23:51 +02:00
Add group moderation log sorting, fix private to bottom
This commit is contained in:
@@ -1,13 +1,38 @@
|
||||
import Location from '@/components/Location.vue';
|
||||
import { i18n } from '@/plugin';
|
||||
import { formatDateFilter } from '@/shared/utils';
|
||||
import { ArrowUpDown } from 'lucide-vue-next';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
const { t } = i18n.global;
|
||||
|
||||
const sortButton = ({ column, label, descFirst = false }) => (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
class="-ml-2 h-8 px-2"
|
||||
onClick={() => {
|
||||
const sorted = column.getIsSorted();
|
||||
if (!sorted && descFirst) {
|
||||
column.toggleSorting(true);
|
||||
return;
|
||||
}
|
||||
column.toggleSorting(sorted === 'asc');
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
<ArrowUpDown class="ml-1 h-4 w-4" />
|
||||
</Button>
|
||||
);
|
||||
|
||||
export const createColumns = ({ onShowUser }) => [
|
||||
{
|
||||
accessorKey: 'created_at',
|
||||
header: () => t('dialog.group_member_moderation.created_at'),
|
||||
header: ({ column }) =>
|
||||
sortButton({
|
||||
column,
|
||||
label: t('dialog.group_member_moderation.created_at')
|
||||
}),
|
||||
size: 170,
|
||||
cell: ({ row }) => (
|
||||
<span>{formatDateFilter(row.original?.created_at, 'long')}</span>
|
||||
@@ -15,13 +40,22 @@ export const createColumns = ({ onShowUser }) => [
|
||||
},
|
||||
{
|
||||
accessorKey: 'eventType',
|
||||
header: () => t('dialog.group_member_moderation.type'),
|
||||
header: ({ column }) =>
|
||||
sortButton({
|
||||
column,
|
||||
label: t('dialog.group_member_moderation.type')
|
||||
}),
|
||||
size: 190,
|
||||
cell: ({ row }) => <span>{row.original?.eventType}</span>
|
||||
},
|
||||
{
|
||||
accessorKey: 'actorDisplayName',
|
||||
header: () => t('dialog.group_member_moderation.display_name'),
|
||||
header: ({ column }) =>
|
||||
sortButton({
|
||||
column,
|
||||
label: t('dialog.group_member_moderation.display_name')
|
||||
}),
|
||||
enableSorting: true,
|
||||
size: 160,
|
||||
cell: ({ row }) => {
|
||||
const original = row.original;
|
||||
@@ -50,7 +84,8 @@ export const createColumns = ({ onShowUser }) => [
|
||||
const targetId = original?.targetId ?? '';
|
||||
return (
|
||||
<span>
|
||||
{typeof targetId === 'string' && targetId.startsWith('wrld_') ? (
|
||||
{typeof targetId === 'string' &&
|
||||
targetId.startsWith('wrld_') ? (
|
||||
<Location location={targetId} />
|
||||
) : null}
|
||||
<span>{original?.description}</span>
|
||||
@@ -65,7 +100,8 @@ export const createColumns = ({ onShowUser }) => [
|
||||
cell: ({ row }) => {
|
||||
const original = row.original;
|
||||
const data = original?.data;
|
||||
const hasData = data && typeof data === 'object' && Object.keys(data).length;
|
||||
const hasData =
|
||||
data && typeof data === 'object' && Object.keys(data).length;
|
||||
return <span>{hasData ? JSON.stringify(data) : ''}</span>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
||||
const updateToastRelease = ref('');
|
||||
|
||||
async function initVRCXUpdaterSettings() {
|
||||
if (!LINUX) {
|
||||
if (LINUX) {
|
||||
arch.value = await window.electron.getArch();
|
||||
noUpdater.value = await window.electron.getNoUpdater();
|
||||
console.log('Architecture:', arch.value);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog v-model:open="isDialogVisible">
|
||||
<DialogContent>
|
||||
<DialogContent class="sm:max-w-xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ t('dialog.avatar_export.header') }}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog v-model:open="isVisible">
|
||||
<DialogContent>
|
||||
<DialogContent class="sm:max-w-xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ t('dialog.avatar_import.header') }}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog v-model:open="isDialogVisible">
|
||||
<DialogContent>
|
||||
<DialogContent class="sm:max-w-xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ t('dialog.friend_export.header') }}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog v-model:open="isVisible">
|
||||
<DialogContent>
|
||||
<DialogContent class="sm:max-w-xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ t('dialog.friend_import.header') }}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog v-model:open="isDialogVisible">
|
||||
<DialogContent>
|
||||
<DialogContent class="sm:max-w-xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ t('dialog.world_export.header') }}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog v-model:open="isVisible">
|
||||
<DialogContent>
|
||||
<DialogContent class="sm:max-w-xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{{ t('dialog.world_import.header') }}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
<SelectItem value="Sort by Status">{{
|
||||
t('view.settings.appearance.side_panel.sorting.status')
|
||||
}}</SelectItem>
|
||||
<SelectItem value="Sort Private to ArrowDown">{{
|
||||
<SelectItem value="Sort Private to Bottom">{{
|
||||
t('view.settings.appearance.side_panel.sorting.private_to_bottom')
|
||||
}}</SelectItem>
|
||||
<SelectItem value="Sort by Last Active">{{
|
||||
@@ -273,7 +273,7 @@
|
||||
<SelectItem value="Sort by Status">{{
|
||||
t('view.settings.appearance.side_panel.sorting.status')
|
||||
}}</SelectItem>
|
||||
<SelectItem value="Sort Private to ArrowDown">{{
|
||||
<SelectItem value="Sort Private to Bottom">{{
|
||||
t('view.settings.appearance.side_panel.sorting.private_to_bottom')
|
||||
}}</SelectItem>
|
||||
<SelectItem value="Sort by Last Active">{{
|
||||
@@ -306,7 +306,7 @@
|
||||
<SelectItem value="Sort by Status">{{
|
||||
t('view.settings.appearance.side_panel.sorting.status')
|
||||
}}</SelectItem>
|
||||
<SelectItem value="Sort Private to ArrowDown">{{
|
||||
<SelectItem value="Sort Private to Bottom">{{
|
||||
t('view.settings.appearance.side_panel.sorting.private_to_bottom')
|
||||
}}</SelectItem>
|
||||
<SelectItem value="Sort by Last Active">{{
|
||||
|
||||
Reference in New Issue
Block a user