2023-07-26 22:31:52 -07:00
|
|
|
<!--
|
2024-02-13 07:59:27 -08:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-26 22:31:52 -07:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-19 03:29:04 -07:00
|
|
|
<template>
|
2022-06-20 01:38:49 -07:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 04:52:15 -07:00
|
|
|
<MkSpacer :contentMax="900">
|
2024-06-07 23:34:19 -07:00
|
|
|
<div :class="$style.root" class="_gaps">
|
|
|
|
<div :class="$style.subMenus" class="_gaps">
|
2024-08-19 20:39:01 -07:00
|
|
|
<MkButton link to="/admin/abuse-report-notification-recipient" primary>{{ i18n.ts.notificationSetting }}</MkButton>
|
2024-06-07 23:34:19 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div :class="$style.inputs" class="_gaps">
|
|
|
|
<MkSelect v-model="state" style="margin: 0; flex: 1;">
|
|
|
|
<template #label>{{ i18n.ts.state }}</template>
|
|
|
|
<option value="all">{{ i18n.ts.all }}</option>
|
|
|
|
<option value="unresolved">{{ i18n.ts.unresolved }}</option>
|
|
|
|
<option value="resolved">{{ i18n.ts.resolved }}</option>
|
|
|
|
</MkSelect>
|
|
|
|
<MkSelect v-model="targetUserOrigin" style="margin: 0; flex: 1;">
|
|
|
|
<template #label>{{ i18n.ts.reporteeOrigin }}</template>
|
|
|
|
<option value="combined">{{ i18n.ts.all }}</option>
|
|
|
|
<option value="local">{{ i18n.ts.local }}</option>
|
|
|
|
<option value="remote">{{ i18n.ts.remote }}</option>
|
|
|
|
</MkSelect>
|
|
|
|
<MkSelect v-model="reporterOrigin" style="margin: 0; flex: 1;">
|
|
|
|
<template #label>{{ i18n.ts.reporterOrigin }}</template>
|
|
|
|
<option value="combined">{{ i18n.ts.all }}</option>
|
|
|
|
<option value="local">{{ i18n.ts.local }}</option>
|
|
|
|
<option value="remote">{{ i18n.ts.remote }}</option>
|
|
|
|
</MkSelect>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- TODO
|
2020-10-19 03:29:04 -07:00
|
|
|
<div class="inputs" style="display: flex; padding-top: 1.2em;">
|
2022-07-04 01:35:27 -07:00
|
|
|
<MkInput v-model="searchUsername" style="margin: 0; flex: 1;" type="text" :spellcheck="false">
|
2022-07-20 06:24:26 -07:00
|
|
|
<span>{{ i18n.ts.username }}</span>
|
2020-10-19 03:29:04 -07:00
|
|
|
</MkInput>
|
2022-07-04 01:35:27 -07:00
|
|
|
<MkInput v-model="searchHost" style="margin: 0; flex: 1;" type="text" :spellcheck="false" :disabled="pagination.params().origin === 'local'">
|
2022-07-20 06:24:26 -07:00
|
|
|
<span>{{ i18n.ts.host }}</span>
|
2020-10-19 03:29:04 -07:00
|
|
|
</MkInput>
|
|
|
|
</div>
|
|
|
|
-->
|
|
|
|
|
2024-06-07 23:34:19 -07:00
|
|
|
<MkPagination v-slot="{items}" ref="reports" :pagination="pagination" style="margin-top: var(--margin);">
|
|
|
|
<XAbuseReport v-for="report in items" :key="report.id" :report="report" @resolved="resolved"/>
|
|
|
|
</MkPagination>
|
2020-10-19 03:29:04 -07:00
|
|
|
</div>
|
2022-06-20 01:38:49 -07:00
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2020-10-19 03:29:04 -07:00
|
|
|
</template>
|
|
|
|
|
2022-04-26 23:17:49 -07:00
|
|
|
<script lang="ts" setup>
|
2023-12-06 21:42:09 -08:00
|
|
|
import { computed, shallowRef, ref } from 'vue';
|
2021-11-11 09:02:25 -08:00
|
|
|
|
2022-06-20 01:38:49 -07:00
|
|
|
import XHeader from './_header_.vue';
|
2023-01-06 22:09:46 -08:00
|
|
|
import MkSelect from '@/components/MkSelect.vue';
|
2023-12-26 22:55:09 -08:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2022-08-30 08:24:33 -07:00
|
|
|
import XAbuseReport from '@/components/MkAbuseReport.vue';
|
2023-09-19 00:37:43 -07:00
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2024-06-07 23:34:19 -07:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2020-10-19 03:29:04 -07:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const reports = shallowRef<InstanceType<typeof MkPagination>>();
|
2020-10-19 03:29:04 -07:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const state = ref('unresolved');
|
|
|
|
const reporterOrigin = ref('combined');
|
|
|
|
const targetUserOrigin = ref('combined');
|
|
|
|
const searchUsername = ref('');
|
|
|
|
const searchHost = ref('');
|
2021-04-22 06:29:33 -07:00
|
|
|
|
2022-04-26 23:17:49 -07:00
|
|
|
const pagination = {
|
|
|
|
endpoint: 'admin/abuse-user-reports' as const,
|
|
|
|
limit: 10,
|
|
|
|
params: computed(() => ({
|
2023-12-06 21:42:09 -08:00
|
|
|
state: state.value,
|
|
|
|
reporterOrigin: reporterOrigin.value,
|
|
|
|
targetUserOrigin: targetUserOrigin.value,
|
2022-04-26 23:17:49 -07:00
|
|
|
})),
|
2023-12-26 22:55:09 -08:00
|
|
|
};
|
2020-10-19 03:29:04 -07:00
|
|
|
|
2022-04-26 23:17:49 -07:00
|
|
|
function resolved(reportId) {
|
2024-06-07 23:34:19 -07:00
|
|
|
reports.value?.removeItem(reportId);
|
2022-04-26 23:17:49 -07:00
|
|
|
}
|
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const headerActions = computed(() => []);
|
2022-06-20 01:38:49 -07:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const headerTabs = computed(() => []);
|
2022-06-20 01:38:49 -07:00
|
|
|
|
2024-02-15 23:17:09 -08:00
|
|
|
definePageMetadata(() => ({
|
2022-06-20 01:38:49 -07:00
|
|
|
title: i18n.ts.abuseReports,
|
2022-12-19 02:01:30 -08:00
|
|
|
icon: 'ti ti-exclamation-circle',
|
2024-02-15 23:17:09 -08:00
|
|
|
}));
|
2020-10-19 03:29:04 -07:00
|
|
|
</script>
|
2024-06-07 23:34:19 -07:00
|
|
|
|
|
|
|
<style module lang="scss">
|
|
|
|
.root {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: stretch;
|
|
|
|
}
|
|
|
|
|
|
|
|
.subMenus {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: flex-end;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.inputs {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
</style>
|