2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-03-13 09:37:22 +01:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :tabs="headerTabs"/></template>
|
2023-05-19 13:52:15 +02:00
|
|
|
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
|
2023-03-13 09:37:22 +01:00
|
|
|
<FormSuspense :p="init">
|
|
|
|
<div class="_gaps_m">
|
2023-05-01 10:09:07 +02:00
|
|
|
<MkSwitch v-model="enableRegistration">
|
|
|
|
<template #label>{{ i18n.ts.enableRegistration }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
|
|
|
|
<MkSwitch v-model="emailRequiredForSignup">
|
|
|
|
<template #label>{{ i18n.ts.emailRequiredForSignup }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
|
2023-10-18 02:41:36 +02:00
|
|
|
<MkSwitch v-model="approvalRequiredForSignup">
|
2023-10-18 03:00:48 +02:00
|
|
|
<template #label>{{ i18n.ts.approvalRequiredForSignup }}</template>
|
2023-10-18 02:41:36 +02:00
|
|
|
</MkSwitch>
|
|
|
|
|
2023-05-01 10:09:07 +02:00
|
|
|
<FormLink to="/admin/server-rules">{{ i18n.ts.serverRules }}</FormLink>
|
|
|
|
|
2023-10-30 05:41:40 +01:00
|
|
|
<MkInput v-model="tosUrl" type="url">
|
2024-06-21 15:48:54 +02:00
|
|
|
<template #prefix><i class="ti ti-link"></i></template>
|
2023-05-01 10:09:07 +02:00
|
|
|
<template #label>{{ i18n.ts.tosUrl }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
2023-10-30 05:41:40 +01:00
|
|
|
<MkInput v-model="privacyPolicyUrl" type="url">
|
2024-06-21 15:48:54 +02:00
|
|
|
<template #prefix><i class="ti ti-link"></i></template>
|
2023-10-07 06:13:13 +02:00
|
|
|
<template #label>{{ i18n.ts.privacyPolicyUrl }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
2023-12-04 02:10:51 +01:00
|
|
|
<MkTextarea v-if="bubbleTimelineEnabled" v-model="bubbleTimeline">
|
|
|
|
<template #label>Bubble timeline</template>
|
|
|
|
<template #caption>Choose which instances should be displayed in the bubble.</template>
|
|
|
|
</MkTextarea>
|
|
|
|
|
2024-05-31 03:12:23 +02:00
|
|
|
<MkInput v-model="inquiryUrl" type="url">
|
2024-06-21 15:48:54 +02:00
|
|
|
<template #prefix><i class="ti ti-link"></i></template>
|
2024-05-31 03:12:23 +02:00
|
|
|
<template #label>{{ i18n.ts._serverSettings.inquiryUrl }}</template>
|
|
|
|
<template #caption>{{ i18n.ts._serverSettings.inquiryUrlDescription }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
2023-05-01 10:09:07 +02:00
|
|
|
<MkTextarea v-model="preservedUsernames">
|
|
|
|
<template #label>{{ i18n.ts.preservedUsernames }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.preservedUsernamesDescription }}</template>
|
|
|
|
</MkTextarea>
|
2023-07-08 00:08:16 +02:00
|
|
|
|
2023-05-01 10:09:07 +02:00
|
|
|
<MkTextarea v-model="sensitiveWords">
|
|
|
|
<template #label>{{ i18n.ts.sensitiveWords }}</template>
|
2023-05-10 11:02:41 +02:00
|
|
|
<template #caption>{{ i18n.ts.sensitiveWordsDescription }}<br>{{ i18n.ts.sensitiveWordsDescription2 }}</template>
|
2023-05-01 10:09:07 +02:00
|
|
|
</MkTextarea>
|
2023-11-30 06:35:56 +01:00
|
|
|
|
2024-02-09 02:07:18 +01:00
|
|
|
<MkTextarea v-model="prohibitedWords">
|
|
|
|
<template #label>{{ i18n.ts.prohibitedWords }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.prohibitedWordsDescription }}<br>{{ i18n.ts.prohibitedWordsDescription2 }}</template>
|
|
|
|
</MkTextarea>
|
|
|
|
|
2023-11-30 06:35:56 +01:00
|
|
|
<MkTextarea v-model="hiddenTags">
|
|
|
|
<template #label>{{ i18n.ts.hiddenTags }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.hiddenTagsDescription }}</template>
|
|
|
|
</MkTextarea>
|
2023-03-13 09:37:22 +01:00
|
|
|
</div>
|
|
|
|
</FormSuspense>
|
|
|
|
</MkSpacer>
|
|
|
|
<template #footer>
|
|
|
|
<div :class="$style.footer">
|
2023-05-19 13:52:15 +02:00
|
|
|
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="16">
|
2024-06-21 14:09:24 +02:00
|
|
|
<MkButton primary rounded @click="save"><i class="ti ti-check"></i> {{ i18n.ts.save }}</MkButton>
|
2023-03-13 09:37:22 +01:00
|
|
|
</MkSpacer>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</MkStickyContainer>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-07 06:42:09 +01:00
|
|
|
import { ref, computed } from 'vue';
|
2023-03-13 09:37:22 +01: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 FormSuspense from '@/components/form/suspense.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import * as os from '@/os.js';
|
2024-01-04 10:32:46 +01:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { fetchInstance } from '@/instance.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2023-03-13 09:37:22 +01:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-04-29 10:03:14 +02:00
|
|
|
import FormLink from '@/components/form/link.vue';
|
2023-03-13 09:37:22 +01:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const enableRegistration = ref<boolean>(false);
|
|
|
|
const emailRequiredForSignup = ref<boolean>(false);
|
2023-12-23 02:09:23 +01:00
|
|
|
const approvalRequiredForSignup = ref<boolean>(false);
|
|
|
|
const bubbleTimelineEnabled = ref<boolean>(false);
|
2023-12-07 06:42:09 +01:00
|
|
|
const sensitiveWords = ref<string>('');
|
2024-02-09 02:07:18 +01:00
|
|
|
const prohibitedWords = ref<string>('');
|
2023-12-07 06:42:09 +01:00
|
|
|
const hiddenTags = ref<string>('');
|
|
|
|
const preservedUsernames = ref<string>('');
|
2023-12-23 02:09:23 +01:00
|
|
|
const bubbleTimeline = ref<string>('');
|
2023-12-07 06:42:09 +01:00
|
|
|
const tosUrl = ref<string | null>(null);
|
|
|
|
const privacyPolicyUrl = ref<string | null>(null);
|
2024-05-31 03:12:23 +02:00
|
|
|
const inquiryUrl = ref<string | null>(null);
|
2023-03-13 09:37:22 +01:00
|
|
|
|
|
|
|
async function init() {
|
2024-01-04 10:32:46 +01:00
|
|
|
const meta = await misskeyApi('admin/meta');
|
2023-12-07 06:42:09 +01:00
|
|
|
enableRegistration.value = !meta.disableRegistration;
|
|
|
|
emailRequiredForSignup.value = meta.emailRequiredForSignup;
|
2023-12-23 02:09:23 +01:00
|
|
|
approvalRequiredForSignup.value = meta.approvalRequiredForSignup;
|
2023-12-07 06:42:09 +01:00
|
|
|
sensitiveWords.value = meta.sensitiveWords.join('\n');
|
2024-02-09 02:07:18 +01:00
|
|
|
prohibitedWords.value = meta.prohibitedWords.join('\n');
|
2023-12-07 06:42:09 +01:00
|
|
|
hiddenTags.value = meta.hiddenTags.join('\n');
|
|
|
|
preservedUsernames.value = meta.preservedUsernames.join('\n');
|
|
|
|
tosUrl.value = meta.tosUrl;
|
|
|
|
privacyPolicyUrl.value = meta.privacyPolicyUrl;
|
2023-12-23 02:09:23 +01:00
|
|
|
bubbleTimeline.value = meta.bubbleInstances.join('\n');
|
|
|
|
bubbleTimelineEnabled.value = meta.policies.btlAvailable;
|
2024-05-31 03:12:23 +02:00
|
|
|
inquiryUrl.value = meta.inquiryUrl;
|
2023-03-13 09:37:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function save() {
|
|
|
|
os.apiWithDialog('admin/update-meta', {
|
2023-12-07 06:42:09 +01:00
|
|
|
disableRegistration: !enableRegistration.value,
|
|
|
|
emailRequiredForSignup: emailRequiredForSignup.value,
|
2023-12-23 02:09:23 +01:00
|
|
|
approvalRequiredForSignup: approvalRequiredForSignup.value,
|
2023-12-07 06:42:09 +01:00
|
|
|
tosUrl: tosUrl.value,
|
|
|
|
privacyPolicyUrl: privacyPolicyUrl.value,
|
2024-05-31 03:12:23 +02:00
|
|
|
inquiryUrl: inquiryUrl.value,
|
2023-12-07 06:42:09 +01:00
|
|
|
sensitiveWords: sensitiveWords.value.split('\n'),
|
2024-02-09 02:07:18 +01:00
|
|
|
prohibitedWords: prohibitedWords.value.split('\n'),
|
2023-12-07 06:42:09 +01:00
|
|
|
hiddenTags: hiddenTags.value.split('\n'),
|
|
|
|
preservedUsernames: preservedUsernames.value.split('\n'),
|
2023-12-23 02:09:23 +01:00
|
|
|
bubbleInstances: bubbleTimeline.value.split('\n'),
|
2023-03-13 09:37:22 +01:00
|
|
|
}).then(() => {
|
2024-02-23 02:47:17 +01:00
|
|
|
fetchInstance(true);
|
2023-03-13 09:37:22 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerTabs = computed(() => []);
|
2023-03-13 09:37:22 +01:00
|
|
|
|
2024-02-16 08:17:09 +01:00
|
|
|
definePageMetadata(() => ({
|
2023-03-13 09:37:22 +01:00
|
|
|
title: i18n.ts.moderation,
|
2024-06-21 14:20:42 +02:00
|
|
|
icon: 'ti ti-shield',
|
2024-02-16 08:17:09 +01:00
|
|
|
}));
|
2023-03-13 09:37:22 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.footer {
|
|
|
|
-webkit-backdrop-filter: var(--blur, blur(15px));
|
|
|
|
backdrop-filter: var(--blur, blur(15px));
|
|
|
|
}
|
|
|
|
</style>
|