2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-03-13 10:37:22 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :tabs="headerTabs"/></template>
|
2023-05-19 14:52:15 +03:00
|
|
|
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
|
2023-03-13 10:37:22 +02:00
|
|
|
<FormSuspense :p="init">
|
|
|
|
<div class="_gaps_m">
|
2023-05-01 11:09:07 +03:00
|
|
|
<MkSwitch v-model="enableRegistration">
|
|
|
|
<template #label>{{ i18n.ts.enableRegistration }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
|
|
|
|
<MkSwitch v-model="emailRequiredForSignup">
|
|
|
|
<template #label>{{ i18n.ts.emailRequiredForSignup }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
|
|
|
|
<FormLink to="/admin/server-rules">{{ i18n.ts.serverRules }}</FormLink>
|
|
|
|
|
2023-10-30 06:41:40 +02:00
|
|
|
<MkInput v-model="tosUrl" type="url">
|
2023-05-01 11:09:07 +03:00
|
|
|
<template #prefix><i class="ti ti-link"></i></template>
|
|
|
|
<template #label>{{ i18n.ts.tosUrl }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
2023-10-30 06:41:40 +02:00
|
|
|
<MkInput v-model="privacyPolicyUrl" type="url">
|
2023-10-07 07:13:13 +03:00
|
|
|
<template #prefix><i class="ti ti-link"></i></template>
|
|
|
|
<template #label>{{ i18n.ts.privacyPolicyUrl }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
2023-05-01 11:09:07 +03:00
|
|
|
<MkTextarea v-model="preservedUsernames">
|
|
|
|
<template #label>{{ i18n.ts.preservedUsernames }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.preservedUsernamesDescription }}</template>
|
|
|
|
</MkTextarea>
|
2023-07-08 01:08:16 +03:00
|
|
|
|
2023-05-01 11:09:07 +03:00
|
|
|
<MkTextarea v-model="sensitiveWords">
|
|
|
|
<template #label>{{ i18n.ts.sensitiveWords }}</template>
|
2023-05-10 12:02:41 +03:00
|
|
|
<template #caption>{{ i18n.ts.sensitiveWordsDescription }}<br>{{ i18n.ts.sensitiveWordsDescription2 }}</template>
|
2023-05-01 11:09:07 +03:00
|
|
|
</MkTextarea>
|
2023-11-30 07:35:56 +02:00
|
|
|
|
|
|
|
<MkTextarea v-model="hiddenTags">
|
|
|
|
<template #label>{{ i18n.ts.hiddenTags }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.hiddenTagsDescription }}</template>
|
|
|
|
</MkTextarea>
|
2023-03-13 10:37:22 +02:00
|
|
|
</div>
|
|
|
|
</FormSuspense>
|
|
|
|
</MkSpacer>
|
|
|
|
<template #footer>
|
|
|
|
<div :class="$style.footer">
|
2023-05-19 14:52:15 +03:00
|
|
|
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="16">
|
2023-03-13 10:37:22 +02:00
|
|
|
<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>
|
2023-12-07 07:42:09 +02:00
|
|
|
import { ref, computed } from 'vue';
|
2023-03-13 10:37:22 +02:00
|
|
|
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';
|
2023-09-19 10:37:43 +03:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { fetchInstance } from '@/instance.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2023-03-13 10:37:22 +02:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-04-29 11:03:14 +03:00
|
|
|
import FormLink from '@/components/form/link.vue';
|
2023-03-13 10:37:22 +02:00
|
|
|
|
2023-12-07 07:42:09 +02:00
|
|
|
const enableRegistration = ref<boolean>(false);
|
|
|
|
const emailRequiredForSignup = ref<boolean>(false);
|
|
|
|
const sensitiveWords = ref<string>('');
|
|
|
|
const hiddenTags = ref<string>('');
|
|
|
|
const preservedUsernames = ref<string>('');
|
|
|
|
const tosUrl = ref<string | null>(null);
|
|
|
|
const privacyPolicyUrl = ref<string | null>(null);
|
2023-03-13 10:37:22 +02:00
|
|
|
|
|
|
|
async function init() {
|
|
|
|
const meta = await os.api('admin/meta');
|
2023-12-07 07:42:09 +02:00
|
|
|
enableRegistration.value = !meta.disableRegistration;
|
|
|
|
emailRequiredForSignup.value = meta.emailRequiredForSignup;
|
|
|
|
sensitiveWords.value = meta.sensitiveWords.join('\n');
|
|
|
|
hiddenTags.value = meta.hiddenTags.join('\n');
|
|
|
|
preservedUsernames.value = meta.preservedUsernames.join('\n');
|
|
|
|
tosUrl.value = meta.tosUrl;
|
|
|
|
privacyPolicyUrl.value = meta.privacyPolicyUrl;
|
2023-03-13 10:37:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function save() {
|
|
|
|
os.apiWithDialog('admin/update-meta', {
|
2023-12-07 07:42:09 +02:00
|
|
|
disableRegistration: !enableRegistration.value,
|
|
|
|
emailRequiredForSignup: emailRequiredForSignup.value,
|
|
|
|
tosUrl: tosUrl.value,
|
|
|
|
privacyPolicyUrl: privacyPolicyUrl.value,
|
|
|
|
sensitiveWords: sensitiveWords.value.split('\n'),
|
|
|
|
hiddenTags: hiddenTags.value.split('\n'),
|
|
|
|
preservedUsernames: preservedUsernames.value.split('\n'),
|
2023-03-13 10:37:22 +02:00
|
|
|
}).then(() => {
|
|
|
|
fetchInstance();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-12-07 07:42:09 +02:00
|
|
|
const headerTabs = computed(() => []);
|
2023-03-13 10:37:22 +02:00
|
|
|
|
|
|
|
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>
|