2023-09-23 11:28:16 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-09-23 11:28:16 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
|
|
|
<MkSpacer :contentMax="900">
|
|
|
|
<div>
|
|
|
|
<div style="display: flex; gap: var(--margin); flex-wrap: wrap;">
|
|
|
|
<MkSelect v-model="type" style="margin: 0; flex: 1;">
|
|
|
|
<template #label>{{ i18n.ts.type }}</template>
|
|
|
|
<option :value="null">{{ i18n.ts.all }}</option>
|
2023-09-24 08:10:56 +02:00
|
|
|
<option v-for="t in Misskey.moderationLogTypes" :key="t" :value="t">{{ i18n.ts._moderationLogTypes[t] ?? t }}</option>
|
2023-09-23 11:28:16 +02:00
|
|
|
</MkSelect>
|
|
|
|
<MkInput v-model="moderatorId" style="margin: 0; flex: 1;">
|
|
|
|
<template #label>{{ i18n.ts.moderator }}(ID)</template>
|
|
|
|
</MkInput>
|
|
|
|
</div>
|
|
|
|
|
2024-04-21 12:17:17 +02:00
|
|
|
<MkPagination v-slot="{items}" ref="logs" :pagination="pagination" :displayLimit="50" style="margin-top: var(--margin);">
|
2023-09-23 11:28:16 +02:00
|
|
|
<div class="_gaps_s">
|
|
|
|
<XModLog v-for="item in items" :key="item.id" :log="item"/>
|
|
|
|
</div>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-07 06:42:09 +01:00
|
|
|
import { computed, shallowRef, ref } from 'vue';
|
2023-09-23 11:28:16 +02:00
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
import XHeader from './_header_.vue';
|
|
|
|
import XModLog from './modlog.ModLog.vue';
|
|
|
|
import MkSelect from '@/components/MkSelect.vue';
|
|
|
|
import MkInput from '@/components/MkInput.vue';
|
2023-12-27 07:55:09 +01:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2023-09-23 11:28:16 +02:00
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const logs = shallowRef<InstanceType<typeof MkPagination>>();
|
2023-09-23 11:28:16 +02:00
|
|
|
|
2023-12-26 06:19:35 +01:00
|
|
|
const type = ref<string | null>(null);
|
2023-12-07 06:42:09 +01:00
|
|
|
const moderatorId = ref('');
|
2023-09-23 11:28:16 +02:00
|
|
|
|
|
|
|
const pagination = {
|
|
|
|
endpoint: 'admin/show-moderation-logs' as const,
|
|
|
|
limit: 30,
|
|
|
|
params: computed(() => ({
|
2023-12-07 06:42:09 +01:00
|
|
|
type: type.value,
|
|
|
|
userId: moderatorId.value === '' ? null : moderatorId.value,
|
2023-09-23 11:28:16 +02:00
|
|
|
})),
|
2023-12-27 07:55:09 +01:00
|
|
|
};
|
2023-09-23 11:28:16 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerActions = computed(() => []);
|
2023-09-23 11:28:16 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerTabs = computed(() => []);
|
2023-09-23 11:28:16 +02:00
|
|
|
|
2024-02-16 08:17:09 +01:00
|
|
|
definePageMetadata(() => ({
|
2023-09-23 11:28:16 +02:00
|
|
|
title: i18n.ts.moderationLogs,
|
2023-11-03 23:20:53 +01:00
|
|
|
icon: 'ph-list ph-bold ph-lg-search',
|
2024-02-16 08:17:09 +01:00
|
|
|
}));
|
2023-09-23 11:28:16 +02:00
|
|
|
</script>
|