enhance(client): improve file moderation ui
This commit is contained in:
@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<XModalWindow ref="dialog"
|
||||
:width="370"
|
||||
@close="$refs.dialog.close()"
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<template v-if="file" #header>{{ file.name }}</template>
|
||||
<div v-if="file" class="cxqhhsmd">
|
||||
<div class="_section">
|
||||
<MkSpacer :content-max="500" :margin-min="16" :margin-max="32">
|
||||
<div v-if="file" class="cxqhhsmd _formRoot">
|
||||
<div class="_formBlock">
|
||||
<MkDriveFileThumbnail class="thumbnail" :file="file" fit="contain"/>
|
||||
<div class="info">
|
||||
<span style="margin-right: 1em;">{{ file.type }}</span>
|
||||
@ -14,35 +9,33 @@
|
||||
<MkTime :time="file.createdAt" mode="detail" style="display: block;"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="_section">
|
||||
<div class="_content">
|
||||
<MkSwitch v-model="isSensitive" @update:modelValue="toggleIsSensitive">NSFW</MkSwitch>
|
||||
</div>
|
||||
<div class="_formBlock">
|
||||
<MkSwitch v-model="isSensitive" @update:modelValue="toggleIsSensitive">NSFW</MkSwitch>
|
||||
</div>
|
||||
<div class="_section">
|
||||
<div class="_content">
|
||||
<MkButton full @click="showUser"><i class="fas fa-external-link-square-alt"></i> {{ $ts.user }}</MkButton>
|
||||
<MkButton full danger @click="del"><i class="fas fa-trash-alt"></i> {{ $ts.delete }}</MkButton>
|
||||
</div>
|
||||
<div class="_formBlock">
|
||||
<MkButton full @click="showUser"><i class="fas fa-external-link-square-alt"></i> {{ $ts.user }}</MkButton>
|
||||
</div>
|
||||
<div v-if="info" class="_section">
|
||||
<div class="_formBlock">
|
||||
<MkButton full danger @click="del"><i class="fas fa-trash-alt"></i> {{ $ts.delete }}</MkButton>
|
||||
</div>
|
||||
<div v-if="info" class="_formBlock">
|
||||
<details class="_content rawdata">
|
||||
<pre><code>{{ JSON.stringify(info, null, 2) }}</code></pre>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</XModalWindow>
|
||||
</MkSpacer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
import MkButton from '@/components/ui/button.vue';
|
||||
import MkSwitch from '@/components/form/switch.vue';
|
||||
import XModalWindow from '@/components/ui/modal-window.vue';
|
||||
import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue';
|
||||
import bytes from '@/filters/bytes';
|
||||
import * as os from '@/os';
|
||||
import { i18n } from '@/i18n';
|
||||
import * as symbols from '@/symbols';
|
||||
|
||||
let file: any = $ref(null);
|
||||
let info: any = $ref(null);
|
||||
@ -72,7 +65,7 @@ async function del() {
|
||||
if (canceled) return;
|
||||
|
||||
os.apiWithDialog('drive/files/delete', {
|
||||
fileId: file.id
|
||||
fileId: file.id,
|
||||
});
|
||||
}
|
||||
|
||||
@ -80,6 +73,14 @@ async function toggleIsSensitive(v) {
|
||||
await os.api('drive/files/update', { fileId: props.fileId, isSensitive: v });
|
||||
isSensitive = v;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
[symbols.PAGE_INFO]: computed(() => ({
|
||||
title: file ? i18n.ts.file + ': ' + file.name : i18n.ts.file,
|
||||
icon: 'fas fa-file',
|
||||
bg: 'var(--bg)',
|
||||
})),
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
@ -82,9 +82,7 @@ function clear() {
|
||||
}
|
||||
|
||||
function show(file) {
|
||||
os.popup(defineAsyncComponent(() => import('./file-dialog.vue')), {
|
||||
fileId: file.id,
|
||||
}, {}, 'closed');
|
||||
os.pageWindow(`/admin-file/${file.id}`);
|
||||
}
|
||||
|
||||
async function find() {
|
||||
|
Reference in New Issue
Block a user