Merge branch 'develop' into feature/approval
This commit is contained in:
commit
182bf7e7d6
8 changed files with 121 additions and 0 deletions
|
@ -79,6 +79,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>
|
||||
|
@ -240,6 +241,7 @@ let moderator = $ref(false);
|
|||
let silenced = $ref(false);
|
||||
let approved = $ref(false);
|
||||
let suspended = $ref(false);
|
||||
let markedAsNSFW = $ref(false);
|
||||
let moderationNote = $ref('');
|
||||
let signupReason = $ref('');
|
||||
|
||||
|
@ -276,6 +278,7 @@ function createFetcher() {
|
|||
suspended = info.isSuspended;
|
||||
moderationNote = info.moderationNote;
|
||||
signupReason = info.signupReason;
|
||||
markedAsNSFW = info.alwaysMarkNsfw;
|
||||
|
||||
watch($$(moderationNote), async () => {
|
||||
await os.api('admin/update-user-note', { userId: user.id, text: moderationNote });
|
||||
|
@ -311,6 +314,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