This commit is contained in:
syuilo 2024-11-15 19:22:25 +09:00
parent c99425690b
commit 3d96656c54
3 changed files with 17 additions and 2 deletions

4
locales/index.d.ts vendored
View File

@ -5214,6 +5214,10 @@ export interface Locale extends ILocale {
* *
*/ */
"availableRoles": string; "availableRoles": string;
/**
*
*/
"acknowledgeNotesAndEnable": string;
"_accountSettings": { "_accountSettings": {
/** /**
* *

View File

@ -1299,6 +1299,7 @@ thisContentsAreMarkedAsSigninRequiredByAuthor: "投稿者により、表示に
lockdown: "ロックダウン" lockdown: "ロックダウン"
pleaseSelectAccount: "アカウントを選択してください" pleaseSelectAccount: "アカウントを選択してください"
availableRoles: "利用可能なロール" availableRoles: "利用可能なロール"
acknowledgeNotesAndEnable: "注意事項を理解した上でオンにします。"
_accountSettings: _accountSettings:
requireSigninToViewContents: "コンテンツの表示にログインを必須にする" requireSigninToViewContents: "コンテンツの表示にログインを必須にする"

View File

@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32"> <MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
<FormSuspense :p="init"> <FormSuspense :p="init">
<div class="_gaps_m"> <div class="_gaps_m">
<MkSwitch v-model="enableRegistration" @change="onChange_enableRegistration"> <MkSwitch :modelValue="enableRegistration" @update:modelValue="onChange_enableRegistration">
<template #label>{{ i18n.ts._serverSettings.openRegistration }}</template> <template #label>{{ i18n.ts._serverSettings.openRegistration }}</template>
<template #caption> <template #caption>
<div>{{ i18n.ts._serverSettings.thisSettingWillAutomaticallyOffWhenModeratorsInactive }}</div> <div>{{ i18n.ts._serverSettings.thisSettingWillAutomaticallyOffWhenModeratorsInactive }}</div>
@ -167,7 +167,17 @@ async function init() {
mediaSilencedHosts.value = meta.mediaSilencedHosts.join('\n'); mediaSilencedHosts.value = meta.mediaSilencedHosts.join('\n');
} }
function onChange_enableRegistration(value: boolean) { async function onChange_enableRegistration(value: boolean) {
if (value) {
const { canceled } = await os.confirm({
type: 'warning',
text: i18n.ts.acknowledgeNotesAndEnable,
});
if (canceled) return;
}
enableRegistration.value = value;
os.apiWithDialog('admin/update-meta', { os.apiWithDialog('admin/update-meta', {
disableRegistration: !value, disableRegistration: !value,
}).then(() => { }).then(() => {