Add group moderation log sorting, fix private to bottom

This commit is contained in:
Natsumi
2026-02-10 11:02:00 +13:00
parent 4bf08bb17e
commit 2406486850
9 changed files with 51 additions and 15 deletions
@@ -1,13 +1,38 @@
import Location from '@/components/Location.vue'; import Location from '@/components/Location.vue';
import { i18n } from '@/plugin'; import { i18n } from '@/plugin';
import { formatDateFilter } from '@/shared/utils'; import { formatDateFilter } from '@/shared/utils';
import { ArrowUpDown } from 'lucide-vue-next';
import { Button } from '@/components/ui/button';
const { t } = i18n.global; 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 }) => [ export const createColumns = ({ onShowUser }) => [
{ {
accessorKey: 'created_at', 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, size: 170,
cell: ({ row }) => ( cell: ({ row }) => (
<span>{formatDateFilter(row.original?.created_at, 'long')}</span> <span>{formatDateFilter(row.original?.created_at, 'long')}</span>
@@ -15,13 +40,22 @@ export const createColumns = ({ onShowUser }) => [
}, },
{ {
accessorKey: 'eventType', accessorKey: 'eventType',
header: () => t('dialog.group_member_moderation.type'), header: ({ column }) =>
sortButton({
column,
label: t('dialog.group_member_moderation.type')
}),
size: 190, size: 190,
cell: ({ row }) => <span>{row.original?.eventType}</span> cell: ({ row }) => <span>{row.original?.eventType}</span>
}, },
{ {
accessorKey: 'actorDisplayName', 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, size: 160,
cell: ({ row }) => { cell: ({ row }) => {
const original = row.original; const original = row.original;
@@ -50,7 +84,8 @@ export const createColumns = ({ onShowUser }) => [
const targetId = original?.targetId ?? ''; const targetId = original?.targetId ?? '';
return ( return (
<span> <span>
{typeof targetId === 'string' && targetId.startsWith('wrld_') ? ( {typeof targetId === 'string' &&
targetId.startsWith('wrld_') ? (
<Location location={targetId} /> <Location location={targetId} />
) : null} ) : null}
<span>{original?.description}</span> <span>{original?.description}</span>
@@ -65,7 +100,8 @@ export const createColumns = ({ onShowUser }) => [
cell: ({ row }) => { cell: ({ row }) => {
const original = row.original; const original = row.original;
const data = original?.data; 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>; return <span>{hasData ? JSON.stringify(data) : ''}</span>;
} }
} }
+1 -1
View File
@@ -43,7 +43,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
const updateToastRelease = ref(''); const updateToastRelease = ref('');
async function initVRCXUpdaterSettings() { async function initVRCXUpdaterSettings() {
if (!LINUX) { if (LINUX) {
arch.value = await window.electron.getArch(); arch.value = await window.electron.getArch();
noUpdater.value = await window.electron.getNoUpdater(); noUpdater.value = await window.electron.getNoUpdater();
console.log('Architecture:', arch.value); console.log('Architecture:', arch.value);
@@ -1,6 +1,6 @@
<template> <template>
<Dialog v-model:open="isDialogVisible"> <Dialog v-model:open="isDialogVisible">
<DialogContent> <DialogContent class="sm:max-w-xl">
<DialogHeader> <DialogHeader>
<DialogTitle>{{ t('dialog.avatar_export.header') }}</DialogTitle> <DialogTitle>{{ t('dialog.avatar_export.header') }}</DialogTitle>
</DialogHeader> </DialogHeader>
@@ -1,6 +1,6 @@
<template> <template>
<Dialog v-model:open="isVisible"> <Dialog v-model:open="isVisible">
<DialogContent> <DialogContent class="sm:max-w-xl">
<DialogHeader> <DialogHeader>
<DialogTitle>{{ t('dialog.avatar_import.header') }}</DialogTitle> <DialogTitle>{{ t('dialog.avatar_import.header') }}</DialogTitle>
</DialogHeader> </DialogHeader>
@@ -1,6 +1,6 @@
<template> <template>
<Dialog v-model:open="isDialogVisible"> <Dialog v-model:open="isDialogVisible">
<DialogContent> <DialogContent class="sm:max-w-xl">
<DialogHeader> <DialogHeader>
<DialogTitle>{{ t('dialog.friend_export.header') }}</DialogTitle> <DialogTitle>{{ t('dialog.friend_export.header') }}</DialogTitle>
</DialogHeader> </DialogHeader>
@@ -1,6 +1,6 @@
<template> <template>
<Dialog v-model:open="isVisible"> <Dialog v-model:open="isVisible">
<DialogContent> <DialogContent class="sm:max-w-xl">
<DialogHeader> <DialogHeader>
<DialogTitle>{{ t('dialog.friend_import.header') }}</DialogTitle> <DialogTitle>{{ t('dialog.friend_import.header') }}</DialogTitle>
</DialogHeader> </DialogHeader>
@@ -1,6 +1,6 @@
<template> <template>
<Dialog v-model:open="isDialogVisible"> <Dialog v-model:open="isDialogVisible">
<DialogContent> <DialogContent class="sm:max-w-xl">
<DialogHeader> <DialogHeader>
<DialogTitle>{{ t('dialog.world_export.header') }}</DialogTitle> <DialogTitle>{{ t('dialog.world_export.header') }}</DialogTitle>
</DialogHeader> </DialogHeader>
@@ -1,6 +1,6 @@
<template> <template>
<Dialog v-model:open="isVisible"> <Dialog v-model:open="isVisible">
<DialogContent> <DialogContent class="sm:max-w-xl">
<DialogHeader> <DialogHeader>
<DialogTitle>{{ t('dialog.world_import.header') }}</DialogTitle> <DialogTitle>{{ t('dialog.world_import.header') }}</DialogTitle>
</DialogHeader> </DialogHeader>
@@ -240,7 +240,7 @@
<SelectItem value="Sort by Status">{{ <SelectItem value="Sort by Status">{{
t('view.settings.appearance.side_panel.sorting.status') t('view.settings.appearance.side_panel.sorting.status')
}}</SelectItem> }}</SelectItem>
<SelectItem value="Sort Private to ArrowDown">{{ <SelectItem value="Sort Private to Bottom">{{
t('view.settings.appearance.side_panel.sorting.private_to_bottom') t('view.settings.appearance.side_panel.sorting.private_to_bottom')
}}</SelectItem> }}</SelectItem>
<SelectItem value="Sort by Last Active">{{ <SelectItem value="Sort by Last Active">{{
@@ -273,7 +273,7 @@
<SelectItem value="Sort by Status">{{ <SelectItem value="Sort by Status">{{
t('view.settings.appearance.side_panel.sorting.status') t('view.settings.appearance.side_panel.sorting.status')
}}</SelectItem> }}</SelectItem>
<SelectItem value="Sort Private to ArrowDown">{{ <SelectItem value="Sort Private to Bottom">{{
t('view.settings.appearance.side_panel.sorting.private_to_bottom') t('view.settings.appearance.side_panel.sorting.private_to_bottom')
}}</SelectItem> }}</SelectItem>
<SelectItem value="Sort by Last Active">{{ <SelectItem value="Sort by Last Active">{{
@@ -306,7 +306,7 @@
<SelectItem value="Sort by Status">{{ <SelectItem value="Sort by Status">{{
t('view.settings.appearance.side_panel.sorting.status') t('view.settings.appearance.side_panel.sorting.status')
}}</SelectItem> }}</SelectItem>
<SelectItem value="Sort Private to ArrowDown">{{ <SelectItem value="Sort Private to Bottom">{{
t('view.settings.appearance.side_panel.sorting.private_to_bottom') t('view.settings.appearance.side_panel.sorting.private_to_bottom')
}}</SelectItem> }}</SelectItem>
<SelectItem value="Sort by Last Active">{{ <SelectItem value="Sort by Last Active">{{