From 25580e8afc2afa8bd5dca3b0a15aea5527792ef8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 1 May 2023 17:09:07 +0900 Subject: [PATCH] :art: --- .../frontend/src/pages/admin/moderation.vue | 47 ++++++++++++------- .../frontend/src/pages/admin/settings.vue | 14 ------ 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/packages/frontend/src/pages/admin/moderation.vue b/packages/frontend/src/pages/admin/moderation.vue index 1ee07d383..ffd3b6e23 100644 --- a/packages/frontend/src/pages/admin/moderation.vue +++ b/packages/frontend/src/pages/admin/moderation.vue @@ -3,25 +3,32 @@ - {{ i18n.ts.serverRules }}
- -
- - - - - - - - - - - - -
-
+ + + + + + + + + {{ i18n.ts.serverRules }} + + + + + + + + + + + + + + +
@@ -52,12 +59,16 @@ import { definePageMetadata } from '@/scripts/page-metadata'; import MkButton from '@/components/MkButton.vue'; import FormLink from '@/components/form/link.vue'; +let enableRegistration: boolean = $ref(false); +let emailRequiredForSignup: boolean = $ref(false); let sensitiveWords: string = $ref(''); let preservedUsernames: string = $ref(''); let tosUrl: string | null = $ref(null); async function init() { const meta = await os.api('admin/meta'); + enableRegistration = !meta.disableRegistration; + emailRequiredForSignup = meta.emailRequiredForSignup; sensitiveWords = meta.sensitiveWords.join('\n'); preservedUsernames = meta.preservedUsernames.join('\n'); tosUrl = meta.tosUrl; @@ -65,6 +76,8 @@ async function init() { function save() { os.apiWithDialog('admin/update-meta', { + disableRegistration: !enableRegistration, + emailRequiredForSignup, tosUrl, sensitiveWords: sensitiveWords.split('\n'), preservedUsernames: preservedUsernames.split('\n'), diff --git a/packages/frontend/src/pages/admin/settings.vue b/packages/frontend/src/pages/admin/settings.vue index e9de6f7b0..0bf7d772d 100644 --- a/packages/frontend/src/pages/admin/settings.vue +++ b/packages/frontend/src/pages/admin/settings.vue @@ -31,14 +31,6 @@
- - - - - - - - @@ -174,8 +166,6 @@ let defaultLightTheme: any = $ref(null); let defaultDarkTheme: any = $ref(null); let pinnedUsers: string = $ref(''); let cacheRemoteFiles: boolean = $ref(false); -let enableRegistration: boolean = $ref(false); -let emailRequiredForSignup: boolean = $ref(false); let enableServiceWorker: boolean = $ref(false); let enableChartsForRemoteUser: boolean = $ref(false); let enableChartsForFederatedInstances: boolean = $ref(false); @@ -198,8 +188,6 @@ async function init() { maintainerEmail = meta.maintainerEmail; pinnedUsers = meta.pinnedUsers.join('\n'); cacheRemoteFiles = meta.cacheRemoteFiles; - enableRegistration = !meta.disableRegistration; - emailRequiredForSignup = meta.emailRequiredForSignup; enableServiceWorker = meta.enableServiceWorker; enableChartsForRemoteUser = meta.enableChartsForRemoteUser; enableChartsForFederatedInstances = meta.enableChartsForFederatedInstances; @@ -223,8 +211,6 @@ function save() { maintainerEmail, pinnedUsers: pinnedUsers.split('\n'), cacheRemoteFiles, - disableRegistration: !enableRegistration, - emailRequiredForSignup, enableServiceWorker, enableChartsForRemoteUser, enableChartsForFederatedInstances,