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,