parent
5c7f517895
commit
cb9bd6a004
8 changed files with 121 additions and 0 deletions
|
@ -77,6 +77,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<FormSection>
|
||||
<div class="_gaps">
|
||||
<MkSwitch v-model="suspended" @update:modelValue="toggleSuspend">{{ i18n.ts.suspend }}</MkSwitch>
|
||||
<MkSwitch v-model="markedAsNSFW" @update:modelValue="toggleNSFW">{{ i18n.ts.markAsNSFW }}</MkSwitch>
|
||||
|
||||
<div>
|
||||
<MkButton v-if="user.host == null" inline style="margin-right: 8px;" @click="resetPassword"><i class="ph-key ph-bold ph-lg"></i> {{ i18n.ts.resetPassword }}</MkButton>
|
||||
|
@ -223,6 +224,7 @@ let ap = $ref(null);
|
|||
let moderator = $ref(false);
|
||||
let silenced = $ref(false);
|
||||
let suspended = $ref(false);
|
||||
let markedAsNSFW = $ref(false);
|
||||
let moderationNote = $ref('');
|
||||
const filesPagination = {
|
||||
endpoint: 'admin/drive/files' as const,
|
||||
|
@ -255,6 +257,7 @@ function createFetcher() {
|
|||
silenced = info.isSilenced;
|
||||
suspended = info.isSuspended;
|
||||
moderationNote = info.moderationNote;
|
||||
markedAsNSFW = info.alwaysMarkNsfw;
|
||||
|
||||
watch($$(moderationNote), async () => {
|
||||
await os.api('admin/update-user-note', { userId: user.id, text: moderationNote });
|
||||
|
@ -290,6 +293,19 @@ async function resetPassword() {
|
|||
}
|
||||
}
|
||||
|
||||
async function toggleNSFW(v) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
text: v ? i18n.ts.nsfwConfirm : i18n.ts.unNsfwConfirm,
|
||||
});
|
||||
if (confirm.canceled) {
|
||||
markedAsNSFW = !v;
|
||||
} else {
|
||||
await os.api(v ? 'admin/nsfw-user' : 'admin/unnsfw-user', { userId: user.id });
|
||||
await refreshUser();
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleSuspend(v) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'warning',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue