diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 90b9a40d96..3824d437fe 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -738,6 +738,9 @@ user: "ユーザー" administration: "管理" accounts: "アカウント" switch: "切り替え" +noMaintainerInformationWarning: "管理者情報が設定されていません。" +noBotProtectionWarning: "Bot防御が設定されていません。" +configure: "設定する" _email: _follow: diff --git a/src/client/pages/instance/overview.vue b/src/client/pages/instance/overview.vue index 651ace08f9..dca2529e1b 100644 --- a/src/client/pages/instance/overview.vue +++ b/src/client/pages/instance/overview.vue @@ -1,6 +1,9 @@ <template> <FormBase> <FormSuspense :p="init"> + <FormInfo v-if="noMaintainerInformation" warn>{{ $ts.noMaintainerInformationWarning }} <MkA to="/instance/settings" class="_link">{{ $ts.configure }}</MkA></FormInfo> + <FormInfo v-if="noBotProtection" warn>{{ $ts.noBotProtectionWarning }} <MkA to="/instance/bot-protection" class="_link">{{ $ts.configure }}</MkA></FormInfo> + <FormSuspense :p="fetchStats" v-slot="{ result: stats }"> <FormGroup> <FormKeyValueView> @@ -44,7 +47,6 @@ <script lang="ts"> import { computed, defineComponent, markRaw } from 'vue'; -import VueJsonPretty from 'vue-json-pretty'; import FormKeyValueView from '@client/components/form/key-value-view.vue'; import FormInput from '@client/components/form/input.vue'; import FormButton from '@client/components/form/button.vue'; @@ -72,15 +74,10 @@ export default defineComponent({ FormBase, FormSuspense, FormGroup, + FormInfo, FormKeyValueView, MkInstanceStats, - MkButton, - MkSelect, - MkInput, - MkContainer, - MkFolder, XMetrics, - VueJsonPretty, }, emits: ['info'], @@ -99,6 +96,8 @@ export default defineComponent({ fetchServerInfo: () => os.api('admin/server-info', {}), fetchJobs: () => os.api('admin/queue/deliver-delayed', {}), fetchModLogs: () => os.api('admin/show-moderation-logs', {}), + noMaintainerInformation: false, + noBotProtection: false, } }, @@ -109,6 +108,11 @@ export default defineComponent({ methods: { async init() { this.meta = await os.api('meta', { detail: true }); + + const isEmpty = (x: any) => x == null || x == ''; + + this.noMaintainerInformation = isEmpty(this.meta.maintainerName) || isEmpty(this.meta.maintainerEmail); + this.noBotProtection = !this.meta.enableHcaptcha && !this.meta.enableRecaptcha; }, async showInstanceInfo(q) {