2020-10-19 19:29:04 +09:00
|
|
|
<template>
|
2022-06-20 17:38:49 +09:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
|
|
|
<MkSpacer :content-max="900">
|
|
|
|
<div class="lcixvhis">
|
|
|
|
<div class="_section reports">
|
|
|
|
<div class="_content">
|
|
|
|
<div class="inputs" style="display: flex;">
|
|
|
|
<MkSelect v-model="state" style="margin: 0; flex: 1;">
|
2022-07-20 22:24:26 +09:00
|
|
|
<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>
|
2022-06-20 17:38:49 +09:00
|
|
|
</MkSelect>
|
|
|
|
<MkSelect v-model="targetUserOrigin" style="margin: 0; flex: 1;">
|
2022-07-20 22:24:26 +09:00
|
|
|
<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>
|
2022-06-20 17:38:49 +09:00
|
|
|
</MkSelect>
|
|
|
|
<MkSelect v-model="reporterOrigin" style="margin: 0; flex: 1;">
|
2022-07-20 22:24:26 +09:00
|
|
|
<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>
|
2022-06-20 17:38:49 +09:00
|
|
|
</MkSelect>
|
|
|
|
</div>
|
|
|
|
<!-- TODO
|
2020-10-19 19:29:04 +09:00
|
|
|
<div class="inputs" style="display: flex; padding-top: 1.2em;">
|
2022-07-04 17:35:27 +09:00
|
|
|
<MkInput v-model="searchUsername" style="margin: 0; flex: 1;" type="text" :spellcheck="false">
|
2022-07-20 22:24:26 +09:00
|
|
|
<span>{{ i18n.ts.username }}</span>
|
2020-10-19 19:29:04 +09:00
|
|
|
</MkInput>
|
2022-07-04 17:35:27 +09:00
|
|
|
<MkInput v-model="searchHost" style="margin: 0; flex: 1;" type="text" :spellcheck="false" :disabled="pagination.params().origin === 'local'">
|
2022-07-20 22:24:26 +09:00
|
|
|
<span>{{ i18n.ts.host }}</span>
|
2020-10-19 19:29:04 +09:00
|
|
|
</MkInput>
|
|
|
|
</div>
|
|
|
|
-->
|
|
|
|
|
2022-06-20 17:38:49 +09: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>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-10-19 19:29:04 +09:00
|
|
|
</div>
|
2022-06-20 17:38:49 +09:00
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2020-10-19 19:29:04 +09:00
|
|
|
</template>
|
|
|
|
|
2022-04-27 15:17:49 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
import XHeader from './_header_.vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import MkInput from '@/components/form/input.vue';
|
|
|
|
import MkSelect from '@/components/form/select.vue';
|
2022-09-06 18:21:49 +09:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2022-08-31 00:24:33 +09:00
|
|
|
import XAbuseReport from '@/components/MkAbuseReport.vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import * as os from '@/os';
|
2022-04-27 15:17:49 +09:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 17:38:49 +09:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2020-10-19 19:29:04 +09:00
|
|
|
|
2022-04-27 15:17:49 +09:00
|
|
|
let reports = $ref<InstanceType<typeof MkPagination>>();
|
2020-10-19 19:29:04 +09:00
|
|
|
|
2022-04-27 15:17:49 +09:00
|
|
|
let state = $ref('unresolved');
|
|
|
|
let reporterOrigin = $ref('combined');
|
|
|
|
let targetUserOrigin = $ref('combined');
|
|
|
|
let searchUsername = $ref('');
|
|
|
|
let searchHost = $ref('');
|
2021-04-22 22:29:33 +09:00
|
|
|
|
2022-04-27 15:17:49 +09:00
|
|
|
const pagination = {
|
|
|
|
endpoint: 'admin/abuse-user-reports' as const,
|
|
|
|
limit: 10,
|
|
|
|
params: computed(() => ({
|
|
|
|
state,
|
|
|
|
reporterOrigin,
|
|
|
|
targetUserOrigin,
|
|
|
|
})),
|
|
|
|
};
|
2020-10-19 19:29:04 +09:00
|
|
|
|
2022-04-27 15:17:49 +09:00
|
|
|
function resolved(reportId) {
|
|
|
|
reports.removeItem(item => item.id === reportId);
|
|
|
|
}
|
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.abuseReports,
|
2022-12-19 19:01:30 +09:00
|
|
|
icon: 'ti ti-exclamation-circle',
|
2020-10-19 19:29:04 +09:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-04-22 22:29:33 +09:00
|
|
|
.lcixvhis {
|
|
|
|
margin: var(--margin);
|
|
|
|
}
|
2020-10-19 19:29:04 +09:00
|
|
|
</style>
|