2023-03-13 08:37:22 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :tabs="headerTabs"/></template>
|
|
|
|
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
|
2023-04-19 12:24:31 +00:00
|
|
|
<FormLink to="/admin/server-rules">{{ i18n.ts.serverRules }}</FormLink>
|
2023-03-13 08:37:22 +00:00
|
|
|
<FormSuspense :p="init">
|
|
|
|
<div class="_gaps_m">
|
|
|
|
<FormSection first>
|
|
|
|
<div class="_gaps_m">
|
2023-04-19 12:24:31 +00:00
|
|
|
<MkInput v-model="tosUrl">
|
|
|
|
<template #prefix><i class="ti ti-link"></i></template>
|
|
|
|
<template #label>{{ i18n.ts.tosUrl }}</template>
|
|
|
|
</MkInput>
|
2023-04-29 08:03:14 +00:00
|
|
|
<MkTextarea v-model="preservedUsernames">
|
|
|
|
<template #label>{{ i18n.ts.preservedUsernames }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.preservedUsernamesDescription }}</template>
|
|
|
|
</MkTextarea>
|
2023-03-13 08:37:22 +00:00
|
|
|
<MkTextarea v-model="sensitiveWords">
|
|
|
|
<template #label>{{ i18n.ts.sensitiveWords }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.sensitiveWordsDescription }}</template>
|
|
|
|
</MkTextarea>
|
|
|
|
</div>
|
|
|
|
</FormSection>
|
|
|
|
</div>
|
|
|
|
</FormSuspense>
|
|
|
|
</MkSpacer>
|
|
|
|
<template #footer>
|
|
|
|
<div :class="$style.footer">
|
|
|
|
<MkSpacer :content-max="700" :margin-min="16" :margin-max="16">
|
|
|
|
<MkButton primary rounded @click="save"><i class="ti ti-check"></i> {{ i18n.ts.save }}</MkButton>
|
|
|
|
</MkSpacer>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</MkStickyContainer>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import XHeader from './_header_.vue';
|
|
|
|
import MkSwitch from '@/components/MkSwitch.vue';
|
|
|
|
import MkInput from '@/components/MkInput.vue';
|
|
|
|
import MkTextarea from '@/components/MkTextarea.vue';
|
|
|
|
import FormSection from '@/components/form/section.vue';
|
|
|
|
import FormSplit from '@/components/form/split.vue';
|
|
|
|
import FormSuspense from '@/components/form/suspense.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import { fetchInstance } from '@/instance';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-04-29 08:03:14 +00:00
|
|
|
import FormLink from '@/components/form/link.vue';
|
2023-03-13 08:37:22 +00:00
|
|
|
|
|
|
|
let sensitiveWords: string = $ref('');
|
2023-04-29 08:03:14 +00:00
|
|
|
let preservedUsernames: string = $ref('');
|
2023-04-19 12:24:31 +00:00
|
|
|
let tosUrl: string | null = $ref(null);
|
2023-03-13 08:37:22 +00:00
|
|
|
|
|
|
|
async function init() {
|
|
|
|
const meta = await os.api('admin/meta');
|
2023-03-23 08:07:46 +00:00
|
|
|
sensitiveWords = meta.sensitiveWords.join('\n');
|
2023-04-29 08:03:14 +00:00
|
|
|
preservedUsernames = meta.preservedUsernames.join('\n');
|
2023-04-19 12:24:31 +00:00
|
|
|
tosUrl = meta.tosUrl;
|
2023-03-13 08:37:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function save() {
|
|
|
|
os.apiWithDialog('admin/update-meta', {
|
2023-04-19 12:24:31 +00:00
|
|
|
tosUrl,
|
2023-03-13 08:37:22 +00:00
|
|
|
sensitiveWords: sensitiveWords.split('\n'),
|
2023-04-29 08:03:14 +00:00
|
|
|
preservedUsernames: preservedUsernames.split('\n'),
|
2023-03-13 08:37:22 +00:00
|
|
|
}).then(() => {
|
|
|
|
fetchInstance();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.moderation,
|
|
|
|
icon: 'ti ti-shield',
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.footer {
|
|
|
|
-webkit-backdrop-filter: var(--blur, blur(15px));
|
|
|
|
backdrop-filter: var(--blur, blur(15px));
|
|
|
|
}
|
|
|
|
</style>
|