2020-10-19 12:29:04 +02:00
|
|
|
<template>
|
2021-04-22 15:29:33 +02:00
|
|
|
<div class="lcixvhis">
|
2020-10-19 12:29:04 +02:00
|
|
|
<div class="_section reports">
|
|
|
|
<div class="_content">
|
|
|
|
<div class="inputs" style="display: flex;">
|
2021-08-06 15:29:19 +02:00
|
|
|
<MkSelect v-model="state" style="margin: 0; flex: 1;">
|
2020-12-26 02:47:36 +01:00
|
|
|
<template #label>{{ $ts.state }}</template>
|
|
|
|
<option value="all">{{ $ts.all }}</option>
|
|
|
|
<option value="unresolved">{{ $ts.unresolved }}</option>
|
|
|
|
<option value="resolved">{{ $ts.resolved }}</option>
|
2020-10-19 12:29:04 +02:00
|
|
|
</MkSelect>
|
2021-08-06 15:29:19 +02:00
|
|
|
<MkSelect v-model="targetUserOrigin" style="margin: 0; flex: 1;">
|
2021-11-05 04:32:35 +01:00
|
|
|
<template #label>{{ $ts.reporteeOrigin }}</template>
|
2020-12-26 02:47:36 +01:00
|
|
|
<option value="combined">{{ $ts.all }}</option>
|
|
|
|
<option value="local">{{ $ts.local }}</option>
|
|
|
|
<option value="remote">{{ $ts.remote }}</option>
|
2020-10-19 12:29:04 +02:00
|
|
|
</MkSelect>
|
2021-08-06 15:29:19 +02:00
|
|
|
<MkSelect v-model="reporterOrigin" style="margin: 0; flex: 1;">
|
2020-12-26 02:47:36 +01:00
|
|
|
<template #label>{{ $ts.reporterOrigin }}</template>
|
|
|
|
<option value="combined">{{ $ts.all }}</option>
|
|
|
|
<option value="local">{{ $ts.local }}</option>
|
|
|
|
<option value="remote">{{ $ts.remote }}</option>
|
2020-10-19 12:29:04 +02:00
|
|
|
</MkSelect>
|
|
|
|
</div>
|
|
|
|
<!-- TODO
|
|
|
|
<div class="inputs" style="display: flex; padding-top: 1.2em;">
|
2021-09-29 17:50:45 +02:00
|
|
|
<MkInput v-model="searchUsername" style="margin: 0; flex: 1;" type="text" spellcheck="false" @update:modelValue="$refs.reports.reload()">
|
2020-12-26 02:47:36 +01:00
|
|
|
<span>{{ $ts.username }}</span>
|
2020-10-19 12:29:04 +02:00
|
|
|
</MkInput>
|
2021-09-29 17:50:45 +02:00
|
|
|
<MkInput v-model="searchHost" style="margin: 0; flex: 1;" type="text" spellcheck="false" @update:modelValue="$refs.reports.reload()" :disabled="pagination.params().origin === 'local'">
|
2020-12-26 02:47:36 +01:00
|
|
|
<span>{{ $ts.host }}</span>
|
2020-10-19 12:29:04 +02:00
|
|
|
</MkInput>
|
|
|
|
</div>
|
|
|
|
-->
|
|
|
|
|
2021-12-02 12:09:12 +01:00
|
|
|
<MkPagination v-slot="{items}" ref="reports" :pagination="pagination" style="margin-top: var(--margin);">
|
2022-01-20 19:06:38 +01:00
|
|
|
<XAbuseReport v-for="report in items" :key="report.id" :report="report" @resolved="resolved"/>
|
2020-10-19 12:29:04 +02:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2022-01-09 19:30:35 +01:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
|
|
|
|
import MkInput from '@/components/form/input.vue';
|
|
|
|
import MkSelect from '@/components/form/select.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
2022-01-20 19:06:38 +01:00
|
|
|
import XAbuseReport from '@/components/abuse-report.vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-10-19 12:29:04 +02:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
MkInput,
|
|
|
|
MkSelect,
|
|
|
|
MkPagination,
|
2022-01-20 19:06:38 +01:00
|
|
|
XAbuseReport,
|
2020-10-19 12:29:04 +02:00
|
|
|
},
|
|
|
|
|
2021-04-22 15:29:33 +02:00
|
|
|
emits: ['info'],
|
|
|
|
|
2020-10-19 12:29:04 +02:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 05:54:12 +02:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 02:47:36 +01:00
|
|
|
title: this.$ts.abuseReports,
|
2021-10-02 16:11:21 +02:00
|
|
|
icon: 'fas fa-exclamation-circle',
|
|
|
|
bg: 'var(--bg)',
|
2020-10-19 12:29:04 +02:00
|
|
|
},
|
|
|
|
searchUsername: '',
|
|
|
|
searchHost: '',
|
|
|
|
state: 'unresolved',
|
|
|
|
reporterOrigin: 'combined',
|
|
|
|
targetUserOrigin: 'combined',
|
|
|
|
pagination: {
|
2022-01-12 18:26:10 +01:00
|
|
|
endpoint: 'admin/abuse-user-reports' as const,
|
2020-10-19 12:29:04 +02:00
|
|
|
limit: 10,
|
2022-01-09 19:30:35 +01:00
|
|
|
params: computed(() => ({
|
2020-10-19 12:29:04 +02:00
|
|
|
state: this.state,
|
|
|
|
reporterOrigin: this.reporterOrigin,
|
|
|
|
targetUserOrigin: this.targetUserOrigin,
|
2022-01-09 19:30:35 +01:00
|
|
|
})),
|
2020-10-19 12:29:04 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2022-01-20 19:06:38 +01:00
|
|
|
resolved(reportId) {
|
|
|
|
this.$refs.reports.removeItem(item => item.id === reportId);
|
2020-10-19 12:29:04 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-04-22 15:29:33 +02:00
|
|
|
.lcixvhis {
|
|
|
|
margin: var(--margin);
|
|
|
|
}
|
2020-10-19 12:29:04 +02:00
|
|
|
</style>
|