refactor(account): account delete, truncate, auto note removal

This commit is contained in:
무라쿠모 2024-09-07 22:32:45 +09:00
parent 4e99008e8d
commit d84bff37ec
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
17 changed files with 387 additions and 260 deletions

View file

@ -79,6 +79,9 @@ export const ROLE_POLICIES = [
'canCreateContent',
'canUpdateContent',
'canDeleteContent',
'canUseAutoNoteRemoval',
'canUseAccountRemoval',
'canUseAccountTruncate',
'canPurgeAccount',
'canUpdateAvatar',
'canUpdateBanner',
@ -108,7 +111,6 @@ export const ROLE_POLICIES = [
'userEachUserListsLimit',
'rateLimitFactor',
'avatarDecorationLimit',
'canUseAccountRemoval',
'mutualLinkSectionLimit',
'mutualLinkLimit',
] as const;

View file

@ -245,6 +245,26 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseAutoNoteRemoval, 'canUseAutoNoteRemoval'])">
<template #label>{{ i18n.ts._role._options.canUseAutoNoteRemoval }}</template>
<template #suffix>
<span v-if="role.policies.canUseAutoNoteRemoval.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.canUseAutoNoteRemoval.value ? i18n.ts.yes : i18n.ts.no }}</span>
<span :class="$style.priorityIndicator"><i :class="getPriorityIcon(role.policies.canUseAutoNoteRemoval)"></i></span>
</template>
<div class="_gaps">
<MkSwitch v-model="role.policies.canUseAutoNoteRemoval.useDefault" :readonly="readonly">
<template #label>{{ i18n.ts._role.useBaseValue }}</template>
</MkSwitch>
<MkSwitch v-model="role.policies.canUseAutoNoteRemoval.value" :disabled="role.policies.canUseAutoNoteRemoval.useDefault" :readonly="readonly">
<template #label>{{ i18n.ts.enable }}</template>
</MkSwitch>
<MkRange v-model="role.policies.canUseAutoNoteRemoval.priority" :min="0" :max="2" :step="1" easing :textConverter="(v) => v === 0 ? i18n.ts._role._priority.low : v === 1 ? i18n.ts._role._priority.middle : v === 2 ? i18n.ts._role._priority.high : ''">
<template #label>{{ i18n.ts._role.priority }}</template>
</MkRange>
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseAccountRemoval, 'canUseAccountRemoval'])">
<template #label>{{ i18n.ts._role._options.canUseAccountRemoval }}</template>
<template #suffix>
@ -265,6 +285,26 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseAccountTruncate, 'canUseAccountTruncate'])">
<template #label>{{ i18n.ts._role._options.canUseAccountTruncate }}</template>
<template #suffix>
<span v-if="role.policies.canUseAccountTruncate.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.canUseAccountTruncate.value ? i18n.ts.yes : i18n.ts.no }}</span>
<span :class="$style.priorityIndicator"><i :class="getPriorityIcon(role.policies.canUseAccountTruncate)"></i></span>
</template>
<div class="_gaps">
<MkSwitch v-model="role.policies.canUseAccountTruncate.useDefault" :readonly="readonly">
<template #label>{{ i18n.ts._role.useBaseValue }}</template>
</MkSwitch>
<MkSwitch v-model="role.policies.canUseAccountTruncate.value" :disabled="role.policies.canUseAccountTruncate.useDefault" :readonly="readonly">
<template #label>{{ i18n.ts.enable }}</template>
</MkSwitch>
<MkRange v-model="role.policies.canUseAccountTruncate.priority" :min="0" :max="2" :step="1" easing :textConverter="(v) => v === 0 ? i18n.ts._role._priority.low : v === 1 ? i18n.ts._role._priority.middle : v === 2 ? i18n.ts._role._priority.high : ''">
<template #label>{{ i18n.ts._role.priority }}</template>
</MkRange>
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canPurgeAccount, 'canPurgeAccount'])">
<template #label>{{ i18n.ts._role._options.canPurgeAccount }}</template>
<template #suffix>
@ -325,8 +365,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.mentionMax, 'mentionLimit'])">
<template #label>{{ i18n.ts._role._options.mentionMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.mentionLimit, 'mentionLimit'])">
<template #label>{{ i18n.ts._role._options.mentionLimit }}</template>
<template #suffix>
<span v-if="role.policies.mentionLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.mentionLimit.value }}</span>
@ -543,8 +583,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacityMb, 'driveCapacityMb'])">
<template #label>{{ i18n.ts._role._options.driveCapacityMb }}</template>
<template #suffix>
<span v-if="role.policies.driveCapacityMb.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.driveCapacityMb.value + 'MB' }}</span>
@ -603,8 +643,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.pinMax, 'pinLimit'])">
<template #label>{{ i18n.ts._role._options.pinMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.pinLimit, 'pinLimit'])">
<template #label>{{ i18n.ts._role._options.pinLimit }}</template>
<template #suffix>
<span v-if="role.policies.pinLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.pinLimit.value }}</span>
@ -622,8 +662,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaMax, 'antennaLimit'])">
<template #label>{{ i18n.ts._role._options.antennaMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaLimit, 'antennaLimit'])">
<template #label>{{ i18n.ts._role._options.antennaLimit }}</template>
<template #suffix>
<span v-if="role.policies.antennaLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.antennaLimit.value }}</span>
@ -641,8 +681,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaNotesMax, 'antennaNotesLimit'])">
<template #label>{{ i18n.ts._role._options.antennaNotesMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaNotesLimit, 'antennaNotesLimit'])">
<template #label>{{ i18n.ts._role._options.antennaNotesLimit }}</template>
<template #suffix>
<span v-if="role.policies.antennaNotesLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.antennaNotesLimit.value }}</span>
@ -660,8 +700,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.wordMuteMax, 'wordMuteLimit'])">
<template #label>{{ i18n.ts._role._options.wordMuteMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.wordMuteLimit, 'wordMuteLimit'])">
<template #label>{{ i18n.ts._role._options.wordMuteLimit }}</template>
<template #suffix>
<span v-if="role.policies.wordMuteLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.wordMuteLimit.value }}</span>
@ -680,8 +720,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.webhookMax, 'webhookLimit'])">
<template #label>{{ i18n.ts._role._options.webhookMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.webhookLimit, 'webhookLimit'])">
<template #label>{{ i18n.ts._role._options.webhookLimit }}</template>
<template #suffix>
<span v-if="role.policies.webhookLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.webhookLimit.value }}</span>
@ -699,8 +739,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.clipMax, 'clipLimit'])">
<template #label>{{ i18n.ts._role._options.clipMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.clipLimit, 'clipLimit'])">
<template #label>{{ i18n.ts._role._options.clipLimit }}</template>
<template #suffix>
<span v-if="role.policies.clipLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.clipLimit.value }}</span>
@ -718,8 +758,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.noteEachClipsMax, 'noteEachClipsLimit'])">
<template #label>{{ i18n.ts._role._options.noteEachClipsMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.noteEachClipsLimit, 'noteEachClipsLimit'])">
<template #label>{{ i18n.ts._role._options.noteEachClipsLimit }}</template>
<template #suffix>
<span v-if="role.policies.noteEachClipsLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.noteEachClipsLimit.value }}</span>
@ -737,8 +777,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userListMax, 'userListLimit'])">
<template #label>{{ i18n.ts._role._options.userListMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userListLimit, 'userListLimit'])">
<template #label>{{ i18n.ts._role._options.userListLimit }}</template>
<template #suffix>
<span v-if="role.policies.userListLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.userListLimit.value }}</span>
@ -756,8 +796,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userEachUserListsMax, 'userEachUserListsLimit'])">
<template #label>{{ i18n.ts._role._options.userEachUserListsMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userEachUserListsLimit, 'userEachUserListsLimit'])">
<template #label>{{ i18n.ts._role._options.userEachUserListsLimit }}</template>
<template #suffix>
<span v-if="role.policies.userEachUserListsLimit.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.userEachUserListsLimit.value }}</span>

View file

@ -80,6 +80,14 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseAutoNoteRemoval, 'canUseAutoNoteRemoval'])">
<template #label>{{ i18n.ts._role._options.canUseAutoNoteRemoval }}</template>
<template #suffix>{{ policies.canUseAutoNoteRemoval ? i18n.ts.yes : i18n.ts.no }}</template>
<MkSwitch v-model="policies.canUseAutoNoteRemoval">
<template #label>{{ i18n.ts.enable }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseAccountRemoval, 'canUseAccountRemoval'])">
<template #label>{{ i18n.ts._role._options.canUseAccountRemoval }}</template>
<template #suffix>{{ policies.canUseAccountRemoval ? i18n.ts.yes : i18n.ts.no }}</template>
@ -88,6 +96,14 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseAccountTruncate, 'canUseAccountTruncate'])">
<template #label>{{ i18n.ts._role._options.canUseAccountTruncate }}</template>
<template #suffix>{{ policies.canUseAccountTruncate ? i18n.ts.yes : i18n.ts.no }}</template>
<MkSwitch v-model="policies.canUseAccountTruncate">
<template #label>{{ i18n.ts.enable }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canPurgeAccount, 'canPurgeAccount'])">
<template #label>{{ i18n.ts._role._options.canPurgeAccount }}</template>
<template #suffix>{{ policies.canPurgeAccount ? i18n.ts.yes : i18n.ts.no }}</template>
@ -112,8 +128,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.mentionMax, 'mentionLimit'])">
<template #label>{{ i18n.ts._role._options.mentionMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.mentionLimit, 'mentionLimit'])">
<template #label>{{ i18n.ts._role._options.mentionLimit }}</template>
<template #suffix>{{ policies.mentionLimit }}</template>
<MkInput v-model="policies.mentionLimit" type="number">
</MkInput>
@ -198,8 +214,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacityMb, 'driveCapacityMb'])">
<template #label>{{ i18n.ts._role._options.driveCapacityMb }}</template>
<template #suffix>{{ policies.driveCapacityMb }}MB</template>
<MkInput v-model="policies.driveCapacityMb" type="number">
<template #suffix>MB</template>
@ -222,65 +238,65 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.pinMax, 'pinLimit'])">
<template #label>{{ i18n.ts._role._options.pinMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.pinLimit, 'pinLimit'])">
<template #label>{{ i18n.ts._role._options.pinLimit }}</template>
<template #suffix>{{ policies.pinLimit }}</template>
<MkInput v-model="policies.pinLimit" type="number">
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaMax, 'antennaLimit'])">
<template #label>{{ i18n.ts._role._options.antennaMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaLimit, 'antennaLimit'])">
<template #label>{{ i18n.ts._role._options.antennaLimit }}</template>
<template #suffix>{{ policies.antennaLimit }}</template>
<MkInput v-model="policies.antennaLimit" type="number">
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaNotesMax, 'antennaNotesLimit'])">
<template #label>{{ i18n.ts._role._options.antennaNotesMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.antennaNotesLimit, 'antennaNotesLimit'])">
<template #label>{{ i18n.ts._role._options.antennaNotesLimit }}</template>
<template #suffix>{{ policies.antennaNotesLimit }}</template>
<MkInput v-model="policies.antennaNotesLimit" type="number">
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.wordMuteMax, 'wordMuteLimit'])">
<template #label>{{ i18n.ts._role._options.wordMuteMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.wordMuteLimit, 'wordMuteLimit'])">
<template #label>{{ i18n.ts._role._options.wordMuteLimit }}</template>
<template #suffix>{{ policies.wordMuteLimit }}</template>
<MkInput v-model="policies.wordMuteLimit" type="number">
<template #suffix>items</template>
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.webhookMax, 'webhookLimit'])">
<template #label>{{ i18n.ts._role._options.webhookMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.webhookLimit, 'webhookLimit'])">
<template #label>{{ i18n.ts._role._options.webhookLimit }}</template>
<template #suffix>{{ policies.webhookLimit }}</template>
<MkInput v-model="policies.webhookLimit" type="number">
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.clipMax, 'clipLimit'])">
<template #label>{{ i18n.ts._role._options.clipMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.clipLimit, 'clipLimit'])">
<template #label>{{ i18n.ts._role._options.clipLimit }}</template>
<template #suffix>{{ policies.clipLimit }}</template>
<MkInput v-model="policies.clipLimit" type="number">
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.noteEachClipsMax, 'noteEachClipsLimit'])">
<template #label>{{ i18n.ts._role._options.noteEachClipsMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.noteEachClipsLimit, 'noteEachClipsLimit'])">
<template #label>{{ i18n.ts._role._options.noteEachClipsLimit }}</template>
<template #suffix>{{ policies.noteEachClipsLimit }}</template>
<MkInput v-model="policies.noteEachClipsLimit" type="number">
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userListMax, 'userListLimit'])">
<template #label>{{ i18n.ts._role._options.userListMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userListLimit, 'userListLimit'])">
<template #label>{{ i18n.ts._role._options.userListLimit }}</template>
<template #suffix>{{ policies.userListLimit }}</template>
<MkInput v-model="policies.userListLimit" type="number">
</MkInput>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userEachUserListsMax, 'userEachUserListsLimit'])">
<template #label>{{ i18n.ts._role._options.userEachUserListsMax }}</template>
<MkFolder v-if="matchQuery([i18n.ts._role._options.userEachUserListsLimit, 'userEachUserListsLimit'])">
<template #label>{{ i18n.ts._role._options.userEachUserListsLimit }}</template>
<template #suffix>{{ policies.userEachUserListsLimit }}</template>
<MkInput v-model="policies.userEachUserListsLimit" type="number">
</MkInput>

View file

@ -16,6 +16,40 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<FormSection>
<template #label><i class="ti ti-time-duration-off"></i> {{ i18n.ts.autoRemoval }}</template>
<template #description>{{ i18n.ts.autoRemovalDescription }}</template>
<div v-if="$i.policies.canUseAutoNoteRemoval" class="_gaps_m">
<MkInfo warn rounded>
{{ i18n.ts.thisIsExperimentalFeature }}
</MkInfo>
<MkSwitch v-model="autoRemoval" @update:modelValue="saveRemovalCondition()">{{ i18n.ts._autoRemoval.use }}</MkSwitch>
<template v-if="autoRemoval">
<MkInput v-model="deleteAfter" :type="'number'" :placeholder="'7'" :required="true" @update:modelValue="periodChanged = true">
<template #label>{{ i18n.ts._autoRemoval.deleteAfter }}</template>
<template #caption>{{ i18n.ts._autoRemoval.deleteAfterDescription }}</template>
</MkInput>
<MkButton v-if="periodChanged" primary class="save" @click="saveRemovalCondition"><i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
<MkSwitch v-model="noPiningNotes" @update:modelValue="saveRemovalCondition()">
<template #label>{{ i18n.ts._autoRemoval.noPiningNotes }}</template>
<template #caption>{{ i18n.ts._autoRemoval.noPiningNotesDescription }}</template>
</MkSwitch>
<MkSwitch v-model="noSpecifiedNotes" @update:modelValue="saveRemovalCondition()">
<template #label>{{ i18n.ts._autoRemoval.noSpecifiedNotes }}</template>
<template #caption>{{ i18n.ts._autoRemoval.noSpecifiedNotesDescription }}</template>
</MkSwitch>
</template>
</div>
<div v-else class="_gaps_m">
<MkInfo>{{ i18n.ts._autoRemoval.youCantUseThisTime }}</MkInfo>
</div>
</FormSection>
<FormSection>
<template #label><i class="ti ti-lock-access"></i> {{ i18n.ts.hideSensitiveInformation }}</template>
<template #description>{{ i18n.ts._hideSensitiveInformation.about }}</template>
@ -97,39 +131,6 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</div>
</FormSection>
<!--
<MkSelect v-model="followingVisibility" @update:modelValue="save()">
<template #label>{{ i18n.ts.followingVisibility }}</template>
<option value="public">{{ i18n.ts._ffVisibility.public }}</option>
<option value="followers">{{ i18n.ts._ffVisibility.followers }}</option>
<option value="private">{{ i18n.ts._ffVisibility.private }}</option>
</MkSelect>
<MkSelect v-model="followersVisibility" @update:modelValue="save()">
<template #label>{{ i18n.ts.followersVisibility }}</template>
<option value="public">{{ i18n.ts._ffVisibility.public }}</option>
<option value="followers">{{ i18n.ts._ffVisibility.followers }}</option>
<option value="private">{{ i18n.ts._ffVisibility.private }}</option>
</MkSelect>
<MkSwitch v-model="hideOnlineStatus" @update:modelValue="save()">
{{ i18n.ts.hideOnlineStatus }}
<template #caption>{{ i18n.ts.hideOnlineStatusDescription }}</template>
</MkSwitch>
<MkSwitch v-model="noCrawle" @update:modelValue="save()">
{{ i18n.ts.noCrawle }}
<template #caption>{{ i18n.ts.noCrawleDescription }}</template>
</MkSwitch>
<MkSwitch v-model="preventAiLearning" @update:modelValue="save()">
{{ i18n.ts.preventAiLearning }}<span class="_beta">{{ i18n.ts.beta }}</span>
<template #caption>{{ i18n.ts.preventAiLearningDescription }}</template>
</MkSwitch>
<MkSwitch v-model="isExplorable" @update:modelValue="save()">
{{ i18n.ts.makeExplorable }}
<template #caption>{{ i18n.ts.makeExplorableDescription }}</template>
</MkSwitch>
-->
</div>
</template>
@ -147,10 +148,16 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { defaultStore } from '@/store.js';
import * as os from '@/os.js';
import { unisonReload } from '@/scripts/unison-reload.js';
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/MkInput.vue";
const $i = signinRequired();
const isVacation = ref<boolean | undefined>($i.isVacation !== null ? $i.isVacation : undefined);
const autoRemoval = ref<boolean>($i.autoRemovalCondition.active);
const deleteAfter = ref<number>($i.autoRemovalCondition.deleteAfter || 7);
const noPiningNotes = ref<boolean>($i.autoRemovalCondition.noPiningNotes);
const noSpecifiedNotes = ref<boolean>($i.autoRemovalCondition.noSpecifiedNotes);
const periodChanged = ref<boolean>(false);
const hideCounters = computed(defaultStore.makeGetterSetter('hideCounters'));
const enableCondensedLineForAcct = computed(defaultStore.makeGetterSetter('enableCondensedLineForAcct'));
@ -160,6 +167,15 @@ const hideDriveFileList = computed(defaultStore.makeGetterSetter('hideDriveFileL
const hideModerationLog = computed(defaultStore.makeGetterSetter('hideModerationLog'));
const hideRoleList = computed(defaultStore.makeGetterSetter('hideRoleList'));
function saveRemovalCondition() {
misskeyApi('i/update-removal-condition', {
active: autoRemoval.value,
deleteAfter: deleteAfter.value,
noPiningNotes: noPiningNotes.value,
noSpecifiedNotes: noSpecifiedNotes.value,
});
}
function save() {
if (isVacation.value === true) {
defaultStore.set('vacationAlert', true);

View file

@ -36,61 +36,6 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder>
<template #label>{{ i18n.ts.autoRemoval }}</template>
<div class="_gaps_m">
<MkSwitch v-model="autoRemoval">{{ i18n.ts._autoRemoval.use }}</MkSwitch>
<template v-if="autoRemoval">
<MkInput v-model="deleteAfter" :type="'number'" :placeholder="'7'" :required="true">
<template #label>{{ i18n.ts._autoRemoval.deleteAfter }}</template>
<template #caption>{{ i18n.ts._autoRemoval.deleteAfterDescription }}</template>
</MkInput>
<MkSwitch v-model="noPiningNotes">
<template #label>{{ i18n.ts._autoRemoval.noPiningNotes }}</template>
<template #caption>{{ i18n.ts._autoRemoval.noPiningNotesDescription }}</template>
</MkSwitch>
<MkSwitch v-model="noSpecifiedNotes">
<template #label>{{ i18n.ts._autoRemoval.noSpecifiedNotes }}</template>
<template #caption>{{ i18n.ts._autoRemoval.noSpecifiedNotesDescription }}</template>
</MkSwitch>
</template>
<MkButton primary class="save" @click="saveRemovalCondition"><i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
</div>
</MkFolder>
<MkFolder>
<template #icon><i class="ti ti-alert-triangle"></i></template>
<template #label>{{ i18n.ts.closeAccount }}</template>
<div v-if="$i.policies.canUseAccountRemoval" class="_gaps_m">
<MkInfo warn>{{ i18n.ts._accountDelete.mayTakeTime }}</MkInfo>
<MkInfo>{{ i18n.ts._accountDelete.sendEmail }}</MkInfo>
<MkButton v-if="!$i.isDeleted" danger @click="deleteAccount">{{ i18n.ts._accountDelete.requestAccountDelete }}</MkButton>
<MkButton v-else disabled>{{ i18n.ts._accountDelete.inProgress }}</MkButton>
</div>
<div v-else class="_gaps_m">
<MkInfo warn>{{ i18n.ts._accountDelete.youCantUseThisTime }}</MkInfo>
</div>
</MkFolder>
<MkFolder>
<template #icon><i class="ti ti-recycle"></i></template>
<template #label>{{ i18n.ts.truncateAccount }}</template>
<div class="_gaps_m">
<FormInfo warn>{{ i18n.ts._accountTruncate.mayTakeTime }}</FormInfo>
<MkSwitch v-model="purgeDrive">
<template #label>{{ i18n.ts._accountTruncate.purgeDriveFiles }}</template>
</MkSwitch>
<MkButton v-if="!$i.isDeleted" danger @click="truncateAccount">{{ i18n.ts._accountTruncate.requestAccountTruncate }}</MkButton>
<MkButton v-else disabled>{{ i18n.ts._accountTruncate.inProgress }}</MkButton>
</div>
</MkFolder>
<MkFolder>
<template #icon><i class="ti ti-code"></i></template>
<template #label>{{ i18n.ts.developer }}</template>
@ -115,6 +60,48 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkButton danger @click="updateRepliesAll(false)"><i class="ti ti-messages-off"></i> {{ i18n.ts.hideRepliesToOthersInTimelineAll }}</MkButton>
</div>
</FormSection>
<FormSection>
<template #label><i class="ti ti-alert-circle"></i> {{ i18n.ts.dangerZone }}</template>
<template #description>{{ i18n.ts.dangerZoneDescription }}</template>
<div class="_gaps_s">
<MkFolder>
<template #icon><i class="ti ti-trash"></i></template>
<template #label>{{ i18n.ts.closeAccount }}</template>
<div v-if="$i.policies.canUseAccountRemoval && !$i.isRoot" class="_gaps_m">
<MkInfo warn>{{ i18n.ts._accountDelete.mayTakeTime }}</MkInfo>
<MkInfo>{{ i18n.ts._accountDelete.sendEmail }}</MkInfo>
<MkButton v-if="!$i.isDeleted" danger @click="deleteAccount">{{ i18n.ts._accountDelete.requestAccountDelete }}</MkButton>
<MkButton v-else disabled>{{ i18n.ts._accountDelete.inProgress }}</MkButton>
</div>
<div v-else-if="$i.isRoot === true" class="_gaps_m">
<MkInfo>{{ i18n.ts._accountDelete.youAreRootAndCantUseThisTime }}</MkInfo>
</div>
<div v-else class="_gaps_m">
<MkInfo>{{ i18n.ts._accountDelete.youCantUseThisTime }}</MkInfo>
</div>
</MkFolder>
<MkFolder>
<template #icon><i class="ti ti-bomb"></i></template>
<template #label>{{ i18n.ts.truncateAccount }}</template>
<div v-if="$i.policies.canUseAccountTruncate" class="_gaps_m">
<MkInfo warn>{{ i18n.ts._accountTruncate.mayTakeTime }}</MkInfo>
<MkSwitch v-model="purgeDrive">
<template #label>{{ i18n.ts._accountTruncate.purgeDriveFiles }}</template>
</MkSwitch>
<MkButton v-if="!$i.isDeleted" danger @click="truncateAccount">{{ i18n.ts._accountTruncate.requestAccountTruncate }}</MkButton>
<MkButton v-else disabled>{{ i18n.ts._accountTruncate.inProgress }}</MkButton>
</div>
<div v-else class="_gaps_m">
<MkInfo>{{ i18n.ts._accountTruncate.youCantUseThisTime }}</MkInfo>
</div>
</MkFolder>
</div>
</FormSection>
</div>
</template>
@ -140,19 +127,6 @@ const $i = signinRequired();
const purgeDrive = ref<boolean>(false);
const devMode = computed(defaultStore.makeGetterSetter('devMode'));
const defaultWithReplies = computed(defaultStore.makeGetterSetter('defaultWithReplies'));
const autoRemoval = ref<boolean>($i.autoRemovalCondition.active);
const deleteAfter = ref<number>($i.autoRemovalCondition.deleteAfter || 7);
const noPiningNotes = ref<boolean>($i.autoRemovalCondition.noPiningNotes);
const noSpecifiedNotes = ref<boolean>($i.autoRemovalCondition.noSpecifiedNotes);
function saveRemovalCondition() {
misskeyApi('i/update-removal-condition', {
active: autoRemoval.value,
deleteAfter: deleteAfter.value,
noPiningNotes: noPiningNotes.value,
noSpecifiedNotes: noSpecifiedNotes.value,
});
}
async function deleteAccount() {
{